Closed
Description
Using latest plexus-compiler-eclipse
(and ecj
), when changing a java file and just compiling without clean
, I'm getting:
Compilation failure
Unknown source: java.lang.IllegalArgumentException: File /home/foo/target/generated-sources/annotations/foo/SomeMapperImpl.java is specified more than once
The mapper is generated via mapstruct.
When adding -X
I can see here that the file is indeed passed twice to ECJ:
https://github.com/codehaus-plexus/plexus-compiler/blob/plexus-compiler-2.12.0/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java#L357
Cause:
- file is added initially here (as expected): https://github.com/codehaus-plexus/plexus-compiler/blob/plexus-compiler-2.12.0/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java#L247
- but it is added again via
addExtraSources()
:
Potential fix: use Set
or make addExtraSources()
more intelligent.
Metadata
Metadata
Assignees
Labels
No labels