Created
October 16, 2013 14:48
-
-
Save diegopacheco/7008905 to your computer and use it in GitHub Desktop.
Scala Maven Plugin Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Inside your parent pom.xml: | |
<build> | |
<pluginManagement> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>2.3.2</version> | |
</plugin> | |
<plugin> | |
<groupId>net.alchim31.maven</groupId> | |
<artifactId>scala-maven-plugin</artifactId> | |
<version>3.1.5</version> | |
</plugin> | |
</plugins> | |
</pluginManagement> | |
</build> | |
You can hava mixed java and scala on the same project as long as you have the folders: src/mai/scala, src/main/java, src/main/resources, src/test/scala, src/test/java/, src/test, resources. So in your pom.xml you do: | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>net.alchim31.maven</groupId> | |
<artifactId>scala-maven-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>scala-compile-first</id> | |
<phase>process-resources</phase> | |
<goals> | |
<goal>add-source</goal> | |
<goal>compile</goal> | |
</goals> | |
</execution> | |
<execution> | |
<id>scala-test-compile</id> | |
<phase>process-test-resources</phase> | |
<goals> | |
<goal>testCompile</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<executions> | |
<execution> | |
<phase>compile</phase> | |
<goals> | |
<goal>compile</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
**To run parallel builds with maven 3 you use -T, so you can do $ mvn -T 1.5C clean install, I realize a redution of 3minutes more or less using this on total build time. | |
no, here is just a sample, in real life i use profile variables :-)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any specific reason why you fixed the maven-compiler-plugin version?