Updated Maven Scala POM-file

Want to use Maven for building your Scala project? Here’s a template for you to download!

Click here to download: pom.xml

The POM-file is set up with:

  • Scala 2.9.1
  • ScalaTest 1.6.1
  • JUnit 4.4

Note: Before using this POM-file, you should set up your project structure:

  • /src/main/scala/
  • /src/test/scala/
  • /src/main/java/
  • /src/test/java/

Maven will include both java and scala files, but if you dont need a hybrid-project then dont  add the “/src/…/java/” directories.

To generate Eclipse project files simply run “mvn eclipse:eclipse“.

To run your Scala-project run run “mvn scala:run“. This will execute the class configured in the build-configuration block, so remember to change it to your own class. You’ll also have to change package names and groupId to match your own project.

This POM-file uses the maven-scala-plugin version 2.15.2,  but is also set up so you can simly change a property to use another version. Here is the Maven repository for the plugin.

If you have some tips on how to make this POM-file better, then please let me know!

BTW: If you are using Maven to build your Scala projects, then you should seriously consider using SBT instead.

This entry was posted in Maven, Scala and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>