Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECJ: Duplicate source files with generated sources when compiling without clean #229

Closed
famod opened this issue Jul 5, 2022 · 1 comment · Fixed by #230
Closed

ECJ: Duplicate source files with generated sources when compiling without clean #229

famod opened this issue Jul 5, 2022 · 1 comment · Fixed by #230

Comments

@famod
Copy link
Contributor

famod commented Jul 5, 2022

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:

Potential fix: use Set or make addExtraSources() more intelligent.

@famod
Copy link
Contributor Author

famod commented Jul 5, 2022

I'll send a PR soon...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant