davidB/maven-scala-plugin — Issue #78: Scala script dependencies not added to classloader at runtime
Author: galderz
Created: 2012-03-04 19:17:06+00:00
State: open

Just found the Github issue area. Originally opened a user question here (http://groups.google.com/group/maven-and-scala/browse_thread/thread/5d0b191a1680c1) but I've provided an update below:

---

Hi all,

I couldn't figure out where to log issues in the Maven Scala plugin,
so decided to email this group instead.

When running a Scala script from Maven, seems like the compile time
dependencies are not added to runtime classpath.

[ERROR] Failed to execute goal org.scala-tools:maven-scala-plugin:
2.15.2:script (scala-magic) on project assembly: wrap:
java.lang.Exception: A ExceptionInInitializerError exception was
thrown: Could not find extension loader impl class in any of the
configured ClassLoaders: Could not find requested class
"org.jboss.shrinkwrap.impl.base.ServiceExtensionLoader" in any of the
associated ClassLoaders: [ClassRealm[plugin>org.scala-tools:maven-
scala-plugin:2.15.2, parent: sun.misc.Launcher
$AppClassLoader@5ab8df17]] -> [Help 1]

I've added a dependency for:

org.jboss.shrinkwrap
shrinkwrap-impl-base

But this does not seem to work. When traced, the classloader is:
ClassRealm[plugin>org.scala-tools:maven-scala-plugin:2.15.2, parent:
sun.misc.Launcher$AppClassLoader@535ff48b]

And contains these classes: https://gist.github.com/1974373

This would appear to be a bug? Surely the dependencies I set should be
available at runtime in case I do any class loading at runtime.

Any workarounds for this? I've see addToClasspath but does not work.

Cheers,
Galder