facebook

Filtering resources by Maven for Eclipse

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #293435 Reply

    windheartwen
    Member

    Is resources filtering support by maven for eclipse?

    I try to add
    <resources>
    <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
    </resource>
    </resources>
    in pom.xml

    but still, I can’t get any resources in the default output folder.

    Thanks in advance.

    #293439 Reply

    Loyal Water
    Member

    Is resources filtering support by maven for eclipse?

    It is not supported by Maven4MyEclipse. Sorry about that.

    #293476 Reply

    windheartwen
    Member

    Thanks for reply. Any workaround?

    #293501 Reply

    allenparslow
    Member

    If you are missing a resource that needs to be in the output folder (target/classes or target/test-classes) from src/main/resources or src/test/resources, then try following workaround:

    1. Right-click you project, choose properties.
    2. In the properties dialog, choose ‘Java Build Path’, then goto the ‘Source’ tab.
    3. Under src/main/resources, click on ‘Excluded: **’, then press the ‘Remove Button’.

    This will output the entire contents of src/main/resources without filtering.

    #293522 Reply

    windheartwen
    Member

    As I have enabled profiles in my pom file, I need filtering. Any other alternatives?

    #293523 Reply

    windheartwen
    Member

    And will later MyEclipse release will support this function?

    Thanks.

    #293559 Reply

    Riyad Kalla
    Member

    windheartwen,

    Maven4MyEclipse provides integration with Maven. When your pom is processed by Maven (either through Maven4MyEclipse or directly from the command line) Maven is parsing that and following any directives you have set forth in the pom.

    In MyEclipse, MyEclipse/Eclipse handles building your project and doesn’t look at your pom for instructions on how to do that, ignoring the filtering statements you have (allenparslow’s solution is exactly right). But when you run from the command line or fire off the build manually from inside MyEclipse, the pom directives will all be honored.

    Hope that clarifies why you are seeing this behavior.

    #293577 Reply

    cherngje
    Member

    @support-rkalla wrote:

    windheartwen,

    Maven4MyEclipse provides integration with Maven. When your pom is processed by Maven (either through Maven4MyEclipse or directly from the command line) Maven is parsing that and following any directives you have set forth in the pom.

    In MyEclipse, MyEclipse/Eclipse handles building your project and doesn’t look at your pom for instructions on how to do that, ignoring the filtering statements you have (allenparslow’s solution is exactly right). But when you run from the command line or fire off the build manually from inside MyEclipse, the pom directives will all be honored.

    Hope that clarifies why you are seeing this behavior.

    Hi support-rkalla,

    This approach leads to several issues with MyEclipse’s type of projects (for example web and ear project). Where MyEclipse’s web and ear project can be inconsistent with pom set up when deploy with MyEclipse’s regular deploy set up. I don’t think MyEclipse use pom to package the project and deploy it to the container. As matter in fact, MyEclipse still can not support maven ear project.

    There are three aspects of this issue. How Eclipse/MyEclipse package the project, what kind of features/fuctions/supports can maven-eclipse plugin provide, and how MyEclipse’s deploy mechanism utilize Eclipse’s base features and features from maven-eclipse’s plugin. I understand that it will be huge task for MyEclipse to ensure the consistent between MyEclipse’s project setup and maven set up (ie. MyEclipse should use maven pom to build the artifacts then deploy to the container, instead of using the original deploy setup.) However, if MyEclipse can get it work consistently, it will be less confuse to the developers who are using MyEclipse and maven together.

    relate forum topic:
    https://www.genuitec.com/forums/topic/maven-ear-plugin-support/
    https://www.genuitec.com/forums/topic/7-0-1-ignoring-quot-provided-quot-scope-when-deploying-to/

    #293590 Reply

    Riyad Kalla
    Member

    I don’t think MyEclipse use pom to package the project and deploy it to the container. As matter in fact, MyEclipse still can not support maven ear project.

    Correct

    I understand that it will be huge task for MyEclipse to ensure the consistent between MyEclipse’s project setup and maven set up (ie. MyEclipse should use maven pom to build the artifacts then deploy to the container, instead of using the original deploy setup.) However, if MyEclipse can get it work consistently, it will be less confuse to the developers who are using MyEclipse and maven together.

    You are absolutely right that it would be nice *and* that it would be a huge undertaking requiring changes throughout our deployer, builder and project model. We haven’t had the user demand yet to justify this investment of work. Sorry about the inconsistency, I know it can be unnecessarily confusing.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Filtering resources by Maven for Eclipse

You must be logged in to post in the forum log in