You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Stefan Seifert (JIRA)" <ji...@apache.org> on 2014/06/13 17:33:02 UTC
[jira] [Commented] (FELIX-4535) Calling eclipse:eclipse with
maven-scr-plugin r1.15.0 and up leads to corrupt Eclipse project
[ https://issues.apache.org/jira/browse/FELIX-4535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14030746#comment-14030746 ]
Stefan Seifert commented on FELIX-4535:
---------------------------------------
p.s. the problem seems to occur in m2eclipse as well if adding a lifecycle-mapping like this one which i found in the test project attached to FELIX-4241:
{code:xml}
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>scr</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
<runOnConfiguration>true</runOnConfiguration>
</execute>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<versionRange>[2.0.0,)</versionRange>
<goals>
<goal>manifest</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
<runOnConfiguration>true</runOnConfiguration>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
{code}
when "Maven -> Update Project" is called the message "Source folder 'src/main/java' in project 'scr-testproject' cannot output to distinct source folder" is displayed as well. but i did not research this further because we currently do not use m2eclipse.
> Calling eclipse:eclipse with maven-scr-plugin r1.15.0 and up leads to corrupt Eclipse project
> ---------------------------------------------------------------------------------------------
>
> Key: FELIX-4535
> URL: https://issues.apache.org/jira/browse/FELIX-4535
> Project: Felix
> Issue Type: Bug
> Affects Versions: maven-scr-plugin 1.15.0, maven-scr-plugin 1.16.0, maven-scr-plugin 1.17.0
> Reporter: Stefan Seifert
> Attachments: FELIX-4535-testproject.zip
>
>
> in r1.15.0 of the eclipse plugin (FELIX-4241) the default output directory of the generated SCR metadata files was changed to {{$\{project.build.directory\}/classes}}
> this leads to problems when generating and eclipse project with the maven-eclipse plugin like this - eclipse reports an error like this:
> {noformat}
> Source folder 'src/main/java' in project 'scr-testproject' cannot output to distinct source folder
> The project cannot be built until build path errors are resolved
> {noformat}
> to be precise, the error occurs only when the eclipse project is generated at the same time as the SCR generation, e.g.
> {noformat}
> mvn clean install eclipse:eclipse
> {noformat}
> if this is done in two independent steps it does not occur:
> {noformat}
> mvn clean install
> mvn eclipse:eclipse
> {noformat}
> if the plugin version is downgraded to 1.14.0 it works as usual.
> the source of the problem is that when the project is generated at the same time as in the build, an additional "source" folder is added to the {{.classpath}} eclipse project file - so it exists twice, once as source folder and once as target folder:
> {code:xml}
> <classpathentry kind="src" path="target/classes" excluding="**/*.java"/>
> <classpathentry kind="output" path="target/classes"/>
> {code}
> i'm not sure why this is happening. i assume the problem is the method {{SCRDescriptorMojo.updateProjectResources()}} in the maven-scr-plugin, but i'm not sure for what it is needed.
> please note that this problem was already mentioned in the comments of FELIX-4241, but the solution from robert is not plausible for me: "The conflict seems to be with the explicit pluginExecution definition for the maven-scr-plugin. If I remove that, all works fine.". if the execution "generate-scr-scrdescriptor" is removed, no SCR metadata is generated at all for the annotated classes. this removes the eclipse project problem, but the component are no longer SCR components as well.
> attached is a minimal test project to reproduce the problem with the mvn calls mentioned above.
--
This message was sent by Atlassian JIRA
(v6.2#6252)