Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
@famod

Description

@famod

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions