Community
Participate
Working Groups
Build Identifier: 20110301-1815 Extra source folders added by the build-helper plugin are correctly added as Eclipse project source folder during project (re)configuration but are not made available to other plugins during the Eclipse build (it is with Maven CLI). One example of such mis-behaviour is that the XDoclet2 plugin cannot process sources that are located in such added source directories. A sample standalone Eclipse project is attached to demonstrate this problem : TestEntity.java in src/main/java is correctly processed while TestEntityBad.java in src/other-sources (added by build-helper) is not. Note that both classes are correctly compiled by Eclipse in target/classes. Reproducible: Always
Created attachment 198120 [details] Standalone testcase project
There are at least two related problems here First, m2e maintain MavenProject state during project import, configuration update and workspace build the same way as during command line build. In case of build-helper-maven-plugin:add-sources this means adding compile source roots to the model, but other configurators will need to provide similar functionality. Second, we need to make sure MavenProject state either survives workbench restart or is properly recreated after workbench restart. Currently, new project instance is read after restart and project configurators do not get the chance to make any changes to the project instance.
*** Bug 357873 has been marked as a duplicate of this bug. ***
*** Bug 352494 has been marked as a duplicate of this bug. ***
I pushed first set of changes to [1] and [2]. [1] http://git.eclipse.org/c/m2e/m2e-core.git/log/?h=349586-MavenProject-changes [2] https://github.com/sonatype/m2e-core-tests/tree/349586-MavenProject-changes
This should be fixed now. Fix will be included in m2e 1.1 M3 build, but current snapshot version can be installed from https://repository.sonatype.org/content/repositories/forge-sites/m2e/1.1.0/N/LATEST/ Two major changes were required to properly support propagation of MavenProject instance changes from one mojo execution to the next. To make sure changes to the MavenProject instance are taken into account during project import and/or configuration update, m2e executes all compatible mojo executions before execution of project configurators #configure methods. Compatible mojo executions are marked with <runOnConfiguration>true</runOnConfiguration> <execute/> mapping subelement. By default runOnConfiguration is false. For example, <action> <execute> <runOnConfiguration>true</runOnConfiguration> <runOnIncremental>true</runOnIncremental> </execute> </action> Mutable MavenProject instance state (i.e. sources, resources and properties) is reset after each build. This is allows reuse of the same MavenProject instance, otherwise pom.xml will need to be reparsed during each workspace build, which would likely result in significant performance degradation compared to m2e 1.0.
Igor, have you tested your fix against the testcase in bug 352494? I just updated my Eclipse to the snapshot you linked to but still am experiencing the same problem.
(In reply to comment #7) > Igor, have you tested your fix against the testcase in bug 352494? I just > updated my Eclipse to the snapshot you linked to but still am experiencing the > same problem. yes, it works. kinda. see attached project and my comment in bug 352494.
Moved to https://github.com/eclipse-m2e/m2e-core/issues/