Output path intersects with source root warning

Answered

During compilation IntelliJ shows below warning:

Warning:Output path [..]JPABootstrapping/target/generated-sources/annotations intersects with a source root. Only files that were created by build will be cleaned.

Could you please explain the reason of the warning and how I can avoid it.

Just for additional details, my pom.xml has below plugins which are used for source generation:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
    <execution>
        <id>add-source</id>
        <phase>generate-sources</phase>
        <goals>
            <goal>add-source</goal>
        </goals>
        <configuration>
            <sources>
                <source>target/generated-sources/annotations</source>
            </sources>
        </configuration>
    </execution>
</executions>
</plugin>
...
<plugins>
    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
            <compilerArguments>
                <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
            </compilerArguments>
        </configuration>
    </plugin>
</plugins>

Thank you!

2
6 comments

As a workaround, it was suggested to "set Maven clean phase as "Execute before rebuild". But since I see only "Before launch", could you please explain where I can find "Execute before rebuild" item in UI.

Thank you!

0

Got it! Thank you very much for the help!

0

Thanks, fixed the link.

0

Please sign in to leave a comment.