davidB/scala-maven-plugin — pull request #84 by argv-minus-one (2012-03-24 02:07:32+00:00)
Title: Use Maven 3.0 toolchain API to configure a specific JDK to build with

Maven has a [toolchain API](http://maven.apache.org/ref/3.0.4/maven-core/apidocs/org/apache/maven/toolchain/package-summary.html) ([sources](http://svn.apache.org/viewvc/maven/maven-3/tags/maven-3.0.4/maven-core/src/main/java/org/apache/maven/toolchain/)) that can be used to locate JDK tools, including the `java` launcher that's being used to run the Scala compiler.

This changes `scala-maven-plugin` to compile against Maven 3.0, and adds support for the toolchain API. If a project uses the `maven-toolchains-plugin` to select a specific JDK, `scala-maven-plugin` will use it instead of the JDK that Maven was run with. If the project doesn't configure a JDK with the `maven-toolchains-plugin`, the `java.home` system property is used as usual.

There are a few other changes that I needed to make to get `scala-maven-plugin` to build against Maven 3.0. I had to use `maven-artifact` 2.2.1 because of a couple of classes that were removed in 3.0, but this seems to work anyway.