maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bertram, Alexander" <a...@bedatadriven.com>
Subject Plugins and project classpath
Date Fri, 11 Jan 2013 09:00:34 GMT
Hi there,
I'm working on the maven plugin for Renjin (R on the JVM) and had a
question about best practices for plugin goals that require project
dependencies.

The renjin-maven-plugin has a compile-namespace goal and a test goal, which
both evaluate R scripts in src/main/R, and so require that the project's
dependencies be included on the classpath.

I've written it now [1] so that the plugin creates a new ClassLoader with
the necessary dependencies. This is a bit awkward however -- as far as I
can tell this means I have to use reflection to communicate between the
Mojo and the evaluator, and then only using types loaded by the system
class loader (and so common to both classloaders). I'm not sure how to
properly do logging, for example.

It also exhausts the permgen space, which you can of course fix with a
MAVEN_OPTS flag, but it will be an extra annoyance to users.

What's the best way to go about this? Should I create a new JVM like
surefire does? Am I just implementing the classloader strategy poorly? Is
there another way to signal to maven that my plugin needs project
dependencies?


Thanks!
Alex


[1]
https://github.com/bedatadriven/renjin/blob/refactor-packages/tools/maven-plugin/src/main/java/org/renjin/maven/NamespaceMojo.java

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message