Thursday, June 07, 2012

Spire, a generic scala math library - How to use with Maven

Spire is a scala library that supports Complex, Rational and other fun useful math types. As I do most of my project builds using Maven, I've outlined the steps needed to build and use Spire in your Maven projects.

1. Check out the source:
  git clone https://github.com/non/spire.git

2. Build Spire
  cd spire
  sbt clean compile package make-pom package-src

3. Install in your local Maven repo
  cd target/scala-2.9.2
   mvn install:install-file -DartifactId=spire \
    -DgroupId=com.github.non \
    -Dpackaging=jar \
    -DpomFile=spire_2.9.2-0.2.0.pom \
    -Dfile=spire_2.9.2-0.2.0.jar \
    -Dversion=0.2.0 \
    -Dclassifier=2.9.2 \
    -Dsources=spire_2.9.2-0.2.0-sources.jar

4. Include Spire in your Maven project using:
  <dependency>
        <groupId>com.github.non</groupId>
        <artifactId>spire</artifactId>
        <version>0.2.0</version>
        <classifier>2.9.2</classifier>
    </dependency>

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.