scala-maven-plugin: Run script in execution doesn't work
I just read in the Maven Handbook (http://www.sonatype.com/books/mcookbook/reference/sect-scala-script-inline.html) that it’s possible to run a scala script inside the Maven Scala Plugin. I tried the example in the book, which doesn’t work. Altering the script to a hello world also doesn’t work. Tried different versions of Scala (Scala 2.7.0, Scala 2.7.3, Scala 2.8.RC2) and different versions of the Maven Scala Plugin. But i always get the following error to run any script inside the MSP: java.lang.NoClassDefFoundError: scala/ScalaObject
Steps to reproduce: create scala maven project from archetype 1.2, add the following execution to the executions-tag of the maven scala plugin:
<execution>
<id>prepare-package</id>
<phase>prepare-package</phase>
<goals>
<goal>script</goal>
</goals>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<keepGeneratedScript>true</keepGeneratedScript>
<script>
<![CDATA[
println("hello from scala script")
]]>
</script>
</configuration>
</execution>
Then, run “mvn prepare-package” from command line.
About this issue
- Original URL
- State: closed
- Created 14 years ago
- Comments: 16 (10 by maintainers)
Commits related to this issue
- fixe #31 script: classpath of external script by default run in scope without maven — committed to davidB/scala-maven-plugin by davidB 10 years ago
For the record, we use the script goal extensively and it works. Can this issue be closed?