Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-27 Thread Benjamin Bentmann
Andreas Gies wrote: [INFO] org.scala-tools:scala-mojo-support:jar:0.3-SNAPSHOT ... [INFO] | +- org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile [INFO] | | \- org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile [INFO] | | \- org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile ... [INFO]

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-27 Thread Jörg Schaible
Benjamin, Benjamin Bentmann wrote: Andreas Gies wrote: [INFO] org.scala-tools:scala-mojo-support:jar:0.3-SNAPSHOT ... [INFO] | +- org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile [INFO] | | \- org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile [INFO] | | \-

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-27 Thread Benjamin Bentmann
Jörg Schaible wrote: Is it save now in M3 to declare a different plugin artifact as dependency? You mean plugin A having a dependency on plugin B? This shouldn't cause an issue for Maven 3 when running the plugin (it should also work in recent Maven 2.x releases IIRC). That inheriting

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-27 Thread Jörg Schaible
Benjamin Bentmann wrote: Jörg Schaible wrote: Is it save now in M3 to declare a different plugin artifact as dependency? You mean plugin A having a dependency on plugin B? This shouldn't cause an issue for Maven 3 when running the plugin (it should also work in recent Maven 2.x releases

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-26 Thread Andreas Gies
Hi Mike I posting my dependency tree below. Perhaps you can double check against the output of a mvn dependency:tree on your side; also perhaps you can post a build log. I was banging my head for weeks on this one; perhaps I can spot something. Best regards Andreas [INFO] ---

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-25 Thread Mike Lenner
Andreas - Thanks - this works for me with one huge caveat (perhaps not experienced by you since you're using scala?). When the DefaultMavenPluginManager is loaded, it's loaded as part of an org.apache.maven:maven-core specific classloader. One of the classes loaded in the PlexusConfiguration.

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-25 Thread Andreas Gies
Hi mike I believe that might be related to a wrong dependency and I seem to believe that I have seen this. You could post a dependency tree of your pluton and I will double check against my own pluton. Andreas Sent from my iPhone On Oct 26, 2010, at 12:03 AM, Mike Lenner

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-25 Thread Mike Lenner
Really? Should I not be indicating a dependency on maven-core? Seems like I'd have to though to compile against the DefaultMavenPluginManager. What do you have? Here are the dependencies for my plugin (I'm calling the assembly plugin from within my plugin - that's the reason for the final

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-23 Thread Andreas Gies
Hi there i *think* the key point was to call getMojoConfiguration on the Mojodescriptor I had resolved. In my case that gives me all the default configurations as I would have expected. I need only to set configs that differ from the default settings. I am attaching the latest code for my

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-22 Thread Mike Lenner
Thanks very much for this thread. I'm trying to write a plugin with maven 3.0 (simply in Java) that executes another plugin as well - this has been very helpful. Just to clear up what you've discovered, were you able to use mojoDescriptor.getMojoConfiguration to build the default configuration

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-21 Thread Andreas Gies
Hi all, just to finish up the thread, I have fixed this by adding a @RequiresDependencyResolution(test) to the mojo calling the dependency plugin. Thanks and best regards Andreas Am 10/21/10 3:10 AM, schrieb Andreas Gies: Hello, a last update for today. I have compared a debug session of

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-20 Thread Andreas Gies
Hello, I am still banging my head on this problem, though I got a bit farther. I found a link via Google pointing to the maven site plugin and there to the DefaultMavenReportExecutor. I have tried to mimick the behavior in my special case and for testing I want to invoke the maven dependency

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-20 Thread Andreas Gies
Hello, I forgot to mention that the output from the scala plugin is embedded in the build.log produced by the mavan invoker plugin. Best regards Andreas Am 10/20/10 8:22 PM, schrieb Andreas Gies: Hello, I am still banging my head on this problem, though I got a bit farther. I found a

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-20 Thread Andreas Gies
Hello, another update on this. From studying the source code I was under the impression that mojoDescriptor.getConfiguration would give me the default configuration, but it is mojoDescriptor.getMojoConfiguration. A debug session has shown, that the dependency plugin actually executes, but

Re: Invoking a plugin programmatically using maven 3 and scala

2010-10-20 Thread Andreas Gies
Hello, a last update for today. I have compared a debug session of mvn dependency:resolve with what happens in my code. It seems, that when calling the plugin from the command line, at the end of the day a class named org.apache.maven.lifecycle.internal.MojoExecutor kind of controlls he

Invoking a plugin programmatically using maven 3 and scala

2010-10-13 Thread Andreas Gies
Hello Maveners , mainly for self learning purposes I am trying to build some plugins for Maven 3 using the Scala language. One of the things I had going before (Maven 2 Java based) is to invoke another plugin programmatically. Now I am trying to invoke the dependency plugin, namely the