| Summary: | avoid injecting duplicate source folders into maven model | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Jan Sievers <jan.sievers> | ||||
| Component: | Tycho | Assignee: | Jan Sievers <jan.sievers> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | t-oberlies | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Jan Sievers
(In reply to comment #0) > Idea: only inject source folder into compile source roots of maven model if > it's not already present in test compile source roots. This is unstable: assuming that it is really necessary (e.g. for interoperability), that the compile root of eclipse-test-plugin is set as Maven compile source root, Tycho should not behave differently if the Tycho source root happens to be src/test/java. Instead, the duplicate entry should be removed the Maven test source roots. (In reply to comment #1) > (In reply to comment #0) > > Idea: only inject source folder into compile source roots of maven model if > > it's not already present in test compile source roots. > This is unstable: assuming that it is really necessary (e.g. for > interoperability), that the compile root of eclipse-test-plugin is set as Maven > compile source root, Tycho should not behave differently if the Tycho source > root happens to be src/test/java. > > Instead, the duplicate entry should be removed the Maven test source roots. just need to make sure an empty test compile roots list will not cause trouble somewhere else (in maven it's never be empty) Created attachment 209449 [details] sample project reproducing the bug Steps to reproduce: 1. download sonar from http://www.sonarsource.org/downloads/ 2. unzip and start it http://docs.codehaus.org/display/SONAR/Install+Sonar#InstallSonar-The2minutestutorial 3. unzip example 4. run mvn -X clean install sonar:sonar => build fails with Caused by: org.sonar.api.resources.DuplicatedSourceException: test.TestMe at org.sonar.batch.index.SourcePersister.saveSource(SourcePersister.java:45) at org.sonar.batch.index.DefaultPersistenceManager.setSource(DefaultPersistenceManager.java:78) at org.sonar.batch.index.DefaultIndex.setSource(DefaultIndex.java:411) at org.sonar.batch.DefaultSensorContext.saveSource(DefaultSensorContext.java:159) at org.sonar.plugins.squid.JavaSourceImporter.importSource(JavaSourceImporter.java:83) ... 39 more [ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException |