Details
Description
Using mavens build-helper and eclipse causes following .classpath files (see the missing output attribute for all main sources; instead the default output folder is addedd by kind="output")
<classpath> <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/> <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/> <classpathentry kind="src" path="src/main/java" including="**/*.java"/> <classpathentry kind="src" path="src/main/buildsupport" including="**/*.java"/> <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/> <classpathentry kind="output" path="target/classes"/> ...
running sonar with the maven-plugin does correctly analyses the files in target/classes (default maven structure folder), but running sonar from within eclipse anaylises target/test-classes. Nothing more.
Issue Links
- depends upon
-
SONAR-3739
ProjectFileSystem#getBuildOutputDir() should return a list of folders
-
- relates to
-
SONARIDE-209
Divide source code for tests and main source code
-
By browsing the code I found, that org.sonar.ide.eclipse.internal.jdt.JavaProjectConfigurator does a good job and adds all potential output folders to the ProjectDefinition. But org.sonar.batch.DefaultProjectFileSystem2.getBuildOutputDir() just returns one of the output folders (in out case always the wrong one). It seems, that ProjectDefinition is capable of multiple output folders, but DefaultProjectFileSystem2 and all bytecode-analising plugins (findbugs, jacoco, ???) not.
I would like to fix this issue - what would you recommend? Extending the api to support multiple output-folders or change DefaultProjectFileSystem2 in another way? Why is DefaultProjectFileSystem2 relying on ProjectDefinition and the MavenProject?