I have one jar dependency in my java project that contains sources as well and when I run mvn compile, these java sources appear as class files in my compiled maven output :(…
How can I exclude these files.. (I only want my own compiled files in the compiled output)
I tried something like:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<excludes>
<exclude>**/bv/**/*.java</exclude>
</excludes>
</configuration>
</plugin>
Played with it but they keep appearing in my maven compiled output 🙁 ..
Any idea’s ?
My understanding is that this is a normal behavior of
javacthat searches the whole classpath for source files to compile unless the-sourcepathoption is given (and this would be the solution here).Unfortunately, there is a Jira issue about
-sourcepathnot being passed tojavacby the Maven Compiler Plugin (see MCOMPILER-98) but there is a workaround. So, could you please try this: