I have a project with several Scala modules using Maven 3. I want to make sure that the Scala compiler works before the Java compiler, both for the compilation phases and for testing.
I tried both in the parent POM and in the POM module, listing the plugins in the build section to the first Scala compiler plugin, and yet Maven still insists on starting Java compilation, cases where I have a mixed source.
I know that I can solve this problem by binding Scala compilation to resource processes instead of compilation, but I would prefer to know how I can tell Maven about ordering plugins (or is this possible).
Here is the part of my parent POM that defines these two plugins:
<plugin> <groupId>org.scala-tools</groupId> <artifactId>maven-scala-plugin</artifactId> <version>2.15.2</version> <configuration> <scalaVersion>${scala.version}</scalaVersion> </configuration> <executions> <execution> <id>compile</id> <goals> <goal>compile</goal> </goals> <phase>compile</phase> </execution> <execution> <id>test-compile</id> <goals> <goal>testCompile</goal> </goals> <phase>test-compile</phase> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin>
The child module has its own <plugins>, but does not override any of these plugins (just exec-maven-plugin).
source share