Hi,
I want to cross compile a Scala jar using the Scala Maven plugin. I am following the instructions here:
However it does not make the artifact id correctly - if I take this approach:
<artifactId>myjar_${scalaVersion}</artifactId>
Then if scalaVersion is defined in pom.xml - for example if I give it an initial value then override it with the profile - it takes the initial value, not the version supplied at the command line via:
mvn -DscalaVersion=2.11
My initial value was 2.10 so I keep getting error messages like this when I try to use the jar:
> inconsistent module metadata found.
Descriptor: myorg:myjar_2.10:0.1-SNAPSHOT
Errors: bad module name: expected='myjar_2.11' found='myjar_2.10'
If I don't give it an initial value then this happens:
> inconsistent module metadata found.
Descriptor: myorg:myjar_${scalaVersion}:0.1-SNAPSHOT
Errors: bad module name: expected='myjar_2.11' found='myjar_${scalaVersion}'
Maybe something changed in Maven since David wrote his FAQ?
Does anybody know any way around this? I tried searching Github but I couldn't find any example of using Maven to cross compile for Scala.
Thanks!
Mark