There is a mixed (Java Scala) Maven project.
Only a small part is written in Scala and it does not depend on Java code.
Java code depends on compilation results of the Scala part.
I'm looking for a way to compile in two steps:
- compile only Scala code (using
scala-maven-plugin
) - compile only Java code (using
maven-compiler-plugin
)
By default scala-maven-plugin
compiles everything in src/main/java, src/main/scala
and it would be great to have an option to alter this behaviour.
Tried to search in documentation, but did not manage to find any mentions of how to exclude sources from compilation.
How to configure scala-maven-plugin
so it would compile only Scala source code?
CodePudding user response:
From this snippet in an integration test:
<configuration>
<includes>
<include>**/*.scala</include>
<include>**/TestClass.java</include>
</includes>
<excludes>
<exclude>bad.scala</exclude>
</excludes>
</configuration>
It appears that you can probably use the <excludes>
tag inside <configuration>
to exclude src/main/java/**/*.java
.