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 plugin, namely
the unpack dependencies goal.

It seems to work if I provide all the missing paramters (like project etc.) into
the configuration as expressions as follows

    val config : Xpp3Dom = Xpp3DomUtils.mergeXpp3Dom(
       buildConfiguration(
         Map(
          "outputDirectory" -> "test",
          "project" -> "${project}",
          "local" -> "${localRepository}",
          "reactorProjects" -> "${reactorProjects}" ,
          "remoteRepos" -> "${project.remoteArtifactRepositories}"
         )
       ),
      convert(md)
    )

That approach doesn't give me any Exceptions. I would have expected that all parameters except the non-default output directory would be resolved as the dependency plugin gives default expressions for them.


However, this approach removes the parameter exceptions from before, but calling it doesn't unpack the dependencies (nothing happens really).

I have tried to use the

  LifecycleExecutor.executeForkedExecutions
  BuildPluginManager.executeMojo

and even tried to call execute on the configured Mojo (which I probably shouldn't do ?)

I have attached a sample build output and also the code of my scala based mojo.

Apart from studying the source code of the API and some sample plugins, is there documentation how the
new plugin API is supposed to work ?

Am I trying to do something out of the ordinary here ? (I know I could configure the dependency plugin in the pom but as this is *such* an essential step in the final mojo I don't want to give the user the option of leaving it
out ... and I wanted to learn some more maven internals).

Has anyone an example of initializing and calling a mojo from within a mojo using the new API ? - Java is fine as
well, I can adopt it to scala as a learning exercise.

I think I might be missing something in terms of hooking up or registering the project with the dependency plugin
though the build output indicates that the project is referenced correctly.


Any hints would be really appreciated; if I am hitting the wrong list, please let me know.

Thanks in advance
Andreas

Am 10/13/10 9:27 AM, schrieb 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 unpack-dependencies goal and am running
into a rather cryptic error message:

[ERROR] Failed to execute goal com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT:echo (default-cli) on project test-plugin: The parameters 'proje ct', 'local', 'remoteRepos', 'reactorProjects' for goal org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies are missing or invali
d -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT:echo (default-cl i) on project test-plugin: The parameters 'project', 'local', 'remoteRepos', 'reactorProjects' for goal org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies are missing or invalid at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:157) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:88) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:80) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:87) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:315)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:445)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:168)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.PluginParameterException: The parameters 'project', 'local', 'remoteRepos', 'reactorProjects' for goal org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies are missing or invalid at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:514) at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:467) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:96)
        at de.woq.maven.plugins.TestMojo.execute(TestMojo.scala:109)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        ... 19 more

It seems that the current project is not passed correctly to the plugin. I have noticed that the API for invoking plugins has slightly changed, but was unable to get more information.
Any hints where to dig deeper would be greatly appreciated.

For completeness here is the code of my plugin so far .... (As I said its a learning exercise :))

/*
 * Copyright (C) 2010, Way of Quality
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package de.woq.maven.plugins

import org.apache.maven.plugin._
import descriptor.MojoDescriptor
import org.scala_tools.maven.mojo.annotations._
import org.apache.maven.project.MavenProject
import org.apache.maven.execution.MavenSession
import org.apache.maven.model.Plugin

import scala.collection.JavaConversions._
import org.codehaus.plexus.component.annotations.Requirement
import org.codehaus.plexus.util.xml.Xpp3Dom

@goal("echo")
@phase("process-sources")
@requiresProject
class TestMojo extends AbstractMojo {

  @readOnly @parameter @expression("${project}")
  var project : MavenProject = _

  @readOnly @parameter @expression("${session}")
  var session : MavenSession = _

  @Requirement
  var pluginManager: BuildPluginManager = _

private def getBuildPlugin(groupId: String, artifactId: String, version: Option[String]) = {

List.fromIterator(project.getBuildPlugins.iterator).asInstanceOf[List[Plugin]]
      .filter(
p => (p.getGroupId.equals(groupId)) && (p.getArtifactId.equals(artifactId) && (version == None || p.getVersion.equals(version)))
      )
  }

  def resolvePluginManager = {
session.getContainer.lookup("org.apache.maven.plugin.BuildPluginManager").asInstanceOf[BuildPluginManager]
  }

  def buildConfiguration(params: Map[String, String]): Xpp3Dom = {
    var config = new Xpp3Dom("configuration")

    for{
      key <- params.keys
      value = params.get(key)
    } {
      var child = new Xpp3Dom(key)
      child.setValue(
        params.get(key) match {
          case Some(v) => v
          case None => ""
        }
      )
      config.addChild(child)
    }

    println(config.toUnescapedString)
    config
  }

  override def execute = {

val plugins = getBuildPlugin("org.apache.maven.plugins", "maven-dependency-plugin", None) assert(plugins.length == 1, "Found " + plugins.length + " plugins for dependdency resolution, expected 1")

    val dep: Plugin = plugins.head

    getLog.info("==============================")

// needed as component injection seems to be broken in scala plugins ...
    pluginManager = resolvePluginManager

    assert(project != null)
    assert(session != null)
    assert(pluginManager != null)

var config : Xpp3Dom = buildConfiguration(Map("outputDirectory" -> "test"))

    var md : MojoDescriptor = pluginManager.getMojoDescriptor(
dep, "unpack-dependencies", project.getRemotePluginRepositories, session.getRepositorySession
    )

    var execution : MojoExecution = new MojoExecution(md, config)

    assert(md != null)

pluginManager.executeMojo(session, execution) // <==== fails here ....

    getLog.info("==============================")
  }
}


Thanks and best regards
Andreas


[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building [Sonic Maven Support -- plugin-sandbox] 8.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ plugin-sandbox ---
[INFO] Deleting 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/target
[INFO] 
[INFO] --- maven-scala-plugin:2.14.1:add-source (scala-compile) @ 
plugin-sandbox ---
[INFO] Add Source directory: 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/main/scala
[INFO] Add Test Source directory: 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/test/scala
[INFO] 
[INFO] --- maven-plugin-plugin:2.6:descriptor (default-descriptor) @ 
plugin-sandbox ---
[INFO] Using 'UTF-8' encoding to read mojo metadata.
[INFO] Applying mojo extractor for language: java
[INFO] Mojo extractor for language: java found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: scala
[INFO] Mojo extractor for language: scala found 1 mojo descriptors.
[INFO] Applying mojo extractor for language: bsh
[INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ 
plugin-sandbox ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ 
plugin-sandbox ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-scala-plugin:2.14.1:compile (scala-compile) @ plugin-sandbox 
---
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/main/java:-1:
 info: compiling
[INFO] Compiling 2 source files to 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/target/classes
 at 1287600212773
[WARNING] warning: there were deprecation warnings; re-run with -deprecation 
for details
[WARNING] one warning found
[INFO] prepare-compile in 0 s
[INFO] compile in 9 s
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ 
plugin-sandbox ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ 
plugin-sandbox ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.5:test (default-test) @ plugin-sandbox ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ plugin-sandbox ---
[INFO] Building jar: 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/target/plugin-sandbox-8.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-plugin-plugin:2.6:addPluginArtifactMetadata 
(default-addPluginArtifactMetadata) @ plugin-sandbox ---
[INFO] 
[INFO] --- maven-invoker-plugin:1.5:install (simple-scala) @ plugin-sandbox ---
[INFO] Installing /Users/andreasgies/projects/Model-Driven-Deployment/pom.xml 
to 
/Users/andreasgies/.m2/repository/com/progress/maven/plugins/sonic-maven-support/8.0-SNAPSHOT/sonic-maven-support-8.0-SNAPSHOT.pom
[INFO] Installing 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/pom.xml to 
/Users/andreasgies/.m2/repository/com/progress/maven/plugins/plugin-sandbox/8.0-SNAPSHOT/plugin-sandbox-8.0-SNAPSHOT.pom
[INFO] Installing 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/target/plugin-sandbox-8.0-SNAPSHOT.jar
 to 
/Users/andreasgies/.m2/repository/com/progress/maven/plugins/plugin-sandbox/8.0-SNAPSHOT/plugin-sandbox-8.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-invoker-plugin:1.5:run (simple-scala) @ plugin-sandbox ---
[WARNING] Filtering of parent/child POMs is not supported without cloning the 
projects
[INFO] Building: pom.xml
[INFO] Apache Maven 3.0 (r1022111; 2010-10-13 19:18:38+0200)
[INFO] Java version: 1.6.0_20
[INFO] Java home: 
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
[INFO] Default locale: en_US, platform encoding: MacRoman
[INFO] OS name: "mac os x" version: "10.6.4" arch: "x86_64" Family: "mac"
[INFO] [INFO] Error stacktraces are turned on.
[INFO] [DEBUG] Reading user settings from /Users/andreasgies/.m2/settings.xml
[INFO] [DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[INFO] [DEBUG] Using local repository at /Users/andreasgies/.m2/repository
[INFO] [INFO] Scanning for projects...
[INFO] [DEBUG] Extension realms for project 
de.woq.maven.plugins:test-plugin:jar:8.0-SNAPSHOT: (none)
[INFO] [DEBUG] Looking up lifecyle mappings for packaging jar from 
ClassRealm[plexus.core, parent: null]
[INFO] [DEBUG] Skipped remote update check for 
com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT/maven-metadata.xml, 
locally built metadata up-to-date.
[INFO] [DEBUG] === REACTOR BUILD PLAN 
================================================
[INFO] [DEBUG] Project: de.woq.maven.plugins:test-plugin:jar:8.0-SNAPSHOT
[INFO] [DEBUG] Tasks:   [clean, 
com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT:echo]
[INFO] [DEBUG] Style:   Regular
[INFO] [DEBUG] 
=======================================================================
[INFO] [INFO]                                                                   
      
[INFO] [INFO] 
------------------------------------------------------------------------
[INFO] [INFO] Building test-plugin 8.0-SNAPSHOT
[INFO] [INFO] 
------------------------------------------------------------------------
[INFO] [DEBUG] Lifecycle default -> [validate, initialize, generate-sources, 
process-sources, generate-resources, process-resources, compile, 
process-classes, generate-test-sources, process-test-sources, 
generate-test-resources, process-test-resources, test-compile, 
process-test-classes, test, prepare-package, package, pre-integration-test, 
integration-test, post-integration-test, verify, install, deploy]
[INFO] [DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[INFO] [DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[INFO] [DEBUG] Lifecycle default -> [validate, initialize, generate-sources, 
process-sources, generate-resources, process-resources, compile, 
process-classes, generate-test-sources, process-test-sources, 
generate-test-resources, process-test-resources, test-compile, 
process-test-classes, test, prepare-package, package, pre-integration-test, 
integration-test, post-integration-test, verify, install, deploy]
[INFO] [DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[INFO] [DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[INFO] [DEBUG] Lifecycle default -> [validate, initialize, generate-sources, 
process-sources, generate-resources, process-resources, compile, 
process-classes, generate-test-sources, process-test-sources, 
generate-test-resources, process-test-resources, test-compile, 
process-test-classes, test, prepare-package, package, pre-integration-test, 
integration-test, post-integration-test, verify, install, deploy]
[INFO] [DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[INFO] [DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[INFO] [DEBUG] Lifecycle default -> [validate, initialize, generate-sources, 
process-sources, generate-resources, process-resources, compile, 
process-classes, generate-test-sources, process-test-sources, 
generate-test-resources, process-test-resources, test-compile, 
process-test-classes, test, prepare-package, package, pre-integration-test, 
integration-test, post-integration-test, verify, install, deploy]
[INFO] [DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[INFO] [DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[INFO] [DEBUG] === PROJECT BUILD PLAN 
================================================
[INFO] [DEBUG] Project:       de.woq.maven.plugins:test-plugin:8.0-SNAPSHOT
[INFO] [DEBUG] Dependencies (collect): []
[INFO] [DEBUG] Dependencies (resolve): []
[INFO] [DEBUG] 
-----------------------------------------------------------------------
[INFO] [DEBUG] Goal:          
org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean)
[INFO] [DEBUG] Style:         Regular
[INFO] [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
[INFO] <configuration>
[INFO]   <directory default-value="${project.build.directory}"/>
[INFO]   <excludeDefaultDirectories 
default-value="false">${clean.excludeDefaultDirectories}</excludeDefaultDirectories>
[INFO]   <failOnError 
default-value="true">${maven.clean.failOnError}</failOnError>
[INFO]   <followSymLinks 
default-value="false">${clean.followSymLinks}</followSymLinks>
[INFO]   <outputDirectory default-value="${project.build.outputDirectory}"/>
[INFO]   <reportDirectory default-value="${project.reporting.outputDirectory}"/>
[INFO]   <skip default-value="false">${clean.skip}</skip>
[INFO]   <testOutputDirectory 
default-value="${project.build.testOutputDirectory}"/>
[INFO]   <verbose>${clean.verbose}</verbose>
[INFO] </configuration>
[INFO] [DEBUG] --- init fork of de.woq.maven.plugins:test-plugin:8.0-SNAPSHOT 
for com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT:echo (default-cli) 
---
[INFO] [DEBUG] Dependencies (collect): []
[INFO] [DEBUG] Dependencies (resolve): []
[INFO] [DEBUG] --- exit fork of de.woq.maven.plugins:test-plugin:8.0-SNAPSHOT 
for com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT:echo (default-cli) 
---
[INFO] [DEBUG] 
-----------------------------------------------------------------------
[INFO] [DEBUG] Goal:          
com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT:echo (default-cli)
[INFO] [DEBUG] Style:         Regular
[INFO] [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
[INFO] <configuration>
[INFO]   <project>${project}</project>
[INFO]   <session>${session}</session>
[INFO] </configuration>
[INFO] [DEBUG] 
=======================================================================
[INFO] [INFO] 
[INFO] [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ test-plugin 
---
[INFO] [DEBUG] org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1:
[INFO] [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[INFO] [DEBUG]    org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
[INFO] [DEBUG] Created new class realm 
plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
[INFO] [DEBUG] Created new class realm maven.api
[INFO] [DEBUG] Populating class realm 
plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
[INFO] [DEBUG]   Included: org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
[INFO] [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.5
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
[INFO] [DEBUG] Configuring mojo 
org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean from plugin realm 
ClassRealm[plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1, parent: 
ClassRealm[maven.api, parent: null]]
[INFO] [DEBUG] Configuring mojo 
'org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean' with basic 
configurator -->
[INFO] [DEBUG]   (f) directory = 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/target
[INFO] [DEBUG]   (f) excludeDefaultDirectories = false
[INFO] [DEBUG]   (f) failOnError = true
[INFO] [DEBUG]   (f) followSymLinks = false
[INFO] [DEBUG]   (f) outputDirectory = 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/target/classes
[INFO] [DEBUG]   (f) reportDirectory = 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/target/site
[INFO] [DEBUG]   (f) skip = false
[INFO] [DEBUG]   (f) testOutputDirectory = 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/target/test-classes
[INFO] [DEBUG] -- end configuration --
[INFO] [DEBUG] Skipping non-existing directory 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/target
[INFO] [DEBUG] Skipping non-existing directory 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/target/classes
[INFO] [DEBUG] Skipping non-existing directory 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/target/test-classes
[INFO] [DEBUG] Skipping non-existing directory 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/target/site
[INFO] [INFO] 
[INFO] [INFO] >>> plugin-sandbox:8.0-SNAPSHOT:echo (default-cli) @ test-plugin 
>>>
[INFO] [INFO] 
[INFO] [INFO] <<< plugin-sandbox:8.0-SNAPSHOT:echo (default-cli) @ test-plugin 
<<<
[INFO] [INFO] 
[INFO] [INFO] --- plugin-sandbox:8.0-SNAPSHOT:echo (default-cli) @ test-plugin 
---
[INFO] [DEBUG] Skipped remote update check for 
com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT/maven-metadata.xml, 
locally built metadata up-to-date.
[INFO] [DEBUG] Skipped remote update check for 
com.progress.maven.plugins:sonic-maven-support:8.0-SNAPSHOT/maven-metadata.xml, 
locally built metadata up-to-date.
[INFO] [DEBUG] Skipped remote update check for 
org.scala-tools:scala-mojo-support:0.3-SNAPSHOT/maven-metadata.xml, locally 
built metadata up-to-date.
[INFO] [DEBUG] Skipped remote update check for 
org.scala-tools:scala-mojo-support:0.3-SNAPSHOT/maven-metadata.xml, locally 
built metadata up-to-date.
[INFO] [DEBUG] Skipped remote update check for 
com.progress.maven.plugins:scala-dependencies:8.0-SNAPSHOT/maven-metadata.xml, 
locally built metadata up-to-date.
[INFO] [DEBUG] com.progress.maven.plugins:plugin-sandbox:jar:8.0-SNAPSHOT:
[INFO] [DEBUG]    org.scala-tools:scala-mojo-support:jar:0.3-SNAPSHOT:compile
[INFO] [DEBUG]       org.apache.maven:maven-core:jar:3.0:compile
[INFO] [DEBUG]          org.apache.maven:maven-model:jar:3.0:compile
[INFO] [DEBUG]          org.apache.maven:maven-settings:jar:3.0:compile
[INFO] [DEBUG]          org.apache.maven:maven-settings-builder:jar:3.0:compile
[INFO] [DEBUG]          
org.apache.maven:maven-repository-metadata:jar:3.0:compile
[INFO] [DEBUG]          org.apache.maven:maven-artifact:jar:3.0:compile
[INFO] [DEBUG]          org.apache.maven:maven-model-builder:jar:3.0:compile
[INFO] [DEBUG]          org.apache.maven:maven-aether-provider:jar:3.0:runtime
[INFO] [DEBUG]          org.sonatype.aether:aether-impl:jar:1.7:compile
[INFO] [DEBUG]             org.sonatype.aether:aether-spi:jar:1.7:compile
[INFO] [DEBUG]          org.sonatype.aether:aether-api:jar:1.7:compile
[INFO] [DEBUG]          org.sonatype.aether:aether-util:jar:1.7:compile
[INFO] [DEBUG]          org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
[INFO] [DEBUG]             org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
[INFO] [DEBUG]                
org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
[INFO] [DEBUG]          
org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
[INFO] [DEBUG]          org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
[INFO] [DEBUG]          
org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[INFO] [DEBUG]          
org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[INFO] [DEBUG]             org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[INFO] [DEBUG]       org.apache.maven:maven-plugin-api:jar:3.0:compile
[INFO] [DEBUG]       
org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:2.5.1:compile
[INFO] [DEBUG]          
org.apache.maven.reporting:maven-reporting-api:jar:2.0.6:compile
[INFO] [DEBUG]             
org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7:compile
[INFO] [DEBUG]          
org.apache.maven:maven-plugin-descriptor:jar:2.0.6:compile
[INFO] [DEBUG]          
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[INFO] [DEBUG]             classworlds:classworlds:jar:1.1-alpha-2:compile
[INFO] [DEBUG]          jtidy:jtidy:jar:4aug2000r7-dev:compile
[INFO] [DEBUG]       org.sonatype.spice:spice-inject-plexus:jar:1.3.4.1:compile
[INFO] [DEBUG]          org.sonatype.spice:spice-inject-bean:jar:1.3.4:compile
[INFO] [DEBUG]             
org.sonatype.spice.inject:guice-patches:jar:noaop:2.1.6:compile
[INFO] [DEBUG]       jline:jline:jar:0.9.94:compile
[INFO] [DEBUG]          junit:junit:jar:3.8.1:compile
[INFO] [DEBUG]       org.scala-lang:scala-library:jar:2.8.0:compile
[INFO] [DEBUG]       org.scala-lang:scala-compiler:jar:2.8.0:compile
[INFO] [DEBUG]    
com.progress.maven.plugins:scala-dependencies:pom:8.0-SNAPSHOT:compile
[INFO] [DEBUG]    org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
[INFO] [DEBUG] Created new class realm 
plugin>com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT
[INFO] [DEBUG] Populating class realm 
plugin>com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT
[INFO] [DEBUG]   Included: 
com.progress.maven.plugins:plugin-sandbox:jar:8.0-SNAPSHOT
[INFO] [DEBUG]   Included: org.scala-tools:scala-mojo-support:jar:0.3-SNAPSHOT
[INFO] [DEBUG]   Included: org.sonatype.aether:aether-util:jar:1.7
[INFO] [DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
[INFO] [DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
[INFO] [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.14
[INFO] [DEBUG]   Included: 
org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[INFO] [DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
[INFO] [DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[INFO] [DEBUG]   Included: 
org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:2.5.1
[INFO] [DEBUG]   Included: 
org.apache.maven.reporting:maven-reporting-api:jar:2.0.6
[INFO] [DEBUG]   Included: org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7
[INFO] [DEBUG]   Included: jtidy:jtidy:jar:4aug2000r7-dev
[INFO] [DEBUG]   Included: org.sonatype.spice:spice-inject-bean:jar:1.3.4
[INFO] [DEBUG]   Included: 
org.sonatype.spice.inject:guice-patches:jar:noaop:2.1.6
[INFO] [DEBUG]   Included: jline:jline:jar:0.9.94
[INFO] [DEBUG]   Included: junit:junit:jar:3.8.1
[INFO] [DEBUG]   Included: org.scala-lang:scala-library:jar:2.8.0
[INFO] [DEBUG]   Included: org.scala-lang:scala-compiler:jar:2.8.0
[INFO] [DEBUG]   Included: 
com.progress.maven.plugins:scala-dependencies:pom:8.0-SNAPSHOT
[INFO] [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.5
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-core:jar:3.0
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-model:jar:3.0
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-settings:jar:3.0
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-settings-builder:jar:3.0
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:3.0
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:3.0
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-model-builder:jar:3.0
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-aether-provider:jar:3.0
[INFO] [DEBUG]   Excluded: org.sonatype.aether:aether-impl:jar:1.7
[INFO] [DEBUG]   Excluded: org.sonatype.aether:aether-spi:jar:1.7
[INFO] [DEBUG]   Excluded: org.sonatype.aether:aether-api:jar:1.7
[INFO] [DEBUG]   Excluded: org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2
[INFO] [DEBUG]   Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.2.3
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:3.0
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.6
[INFO] [DEBUG]   Excluded: 
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[INFO] [DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
[INFO] [DEBUG]   Excluded: org.sonatype.spice:spice-inject-plexus:jar:1.3.4.1
[INFO] [DEBUG] Configuring mojo 
com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT:echo from plugin realm 
ClassRealm[plugin>com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT, 
parent: ClassRealm[maven.api, parent: null]]
[INFO] [DEBUG] Configuring mojo 
'com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT:echo' with scala 
configurator -->
[INFO] Processing Configuration for child elements
[INFO] Processing child [project]
[INFO] [DEBUG]   (s) project = MavenProject: 
de.woq.maven.plugins:test-plugin:8.0-SNAPSHOT @ 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/interpolated-pom.xml
[INFO] Processing child [session]
[INFO] [DEBUG]   (s) session = org.apache.maven.execution.mavensess...@323f265b
[INFO] [DEBUG] -- end configuration --
[INFO] [INFO] ==============================
[INFO] [DEBUG] Component Descriptor: role: 'org.apache.maven.plugin.Mojo', 
implementation: 'org.apache.maven.plugin.dependency.UnpackDependenciesMojo', 
role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.resolvers.GoOfflineMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:go-offline'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.CopyDependenciesMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:copy-dependencies'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.AnalyzeDepMgt', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:analyze-dep-mgt'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.ListMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:list'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.PurgeLocalRepositoryMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:purge-local-repository'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.HelpMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:help'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.GetMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:get'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.BuildClasspathMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:build-classpath'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.resolvers.ResolveDependencySourcesMojo', 
role hint: 'org.apache.maven.plugins:maven-dependency-plugin:2.1:sources'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.AnalyzeReportMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:analyze-report'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.AnalyzeMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:analyze'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.TreeMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:tree'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.fromConfiguration.UnpackMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.resolvers.ResolveDependenciesMojo', role 
hint: 'org.apache.maven.plugins:maven-dependency-plugin:2.1:resolve'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:copy'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.AnalyzeOnlyMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:analyze-only'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.dependency.resolvers.ResolvePluginsMojo', role hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:resolve-plugins'
[INFO] ---
[INFO] [INFO] org.apache.maven.plugin.descriptor.MojoDescriptor [role: 
'org.apache.maven.plugin.Mojo', hint: 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies', 
realm: null]
[INFO] [INFO] <?xml version="1.0" encoding="UTF-8"?>
[INFO] <configuration>
[INFO]   <project>${project}</project>
[INFO]   <outputDirectory>test</outputDirectory>
[INFO]   <remoteRepos>${project.remoteArtifactRepositories}</remoteRepos>
[INFO]   <reactorProjects>${reactorProjects}</reactorProjects>
[INFO]   <local>${localRepository}</local>
[INFO] </configuration>
[INFO] [DEBUG] org.apache.maven.plugins:maven-dependency-plugin:jar:2.1:
[INFO] [DEBUG]    org.apache.maven:maven-artifact:jar:2.0.9:compile
[INFO] [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.9:compile
[INFO] [DEBUG]    org.apache.maven:maven-project:jar:2.0.9:compile
[INFO] [DEBUG]       org.apache.maven:maven-settings:jar:2.0.9:compile
[INFO] [DEBUG]       org.apache.maven:maven-profile:jar:2.0.9:compile
[INFO] [DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0.9:compile
[INFO] [DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.9:compile
[INFO] [DEBUG]    org.apache.maven:maven-model:jar:2.0.9:compile
[INFO] [DEBUG]    org.apache.maven:maven-core:jar:2.0.9:compile
[INFO] [DEBUG]       
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:compile
[INFO] [DEBUG]       
org.apache.maven:maven-repository-metadata:jar:2.0.9:compile
[INFO] [DEBUG]       org.apache.maven:maven-error-diagnostics:jar:2.0.9:compile
[INFO] [DEBUG]       commons-cli:commons-cli:jar:1.0:compile
[INFO] [DEBUG]       org.apache.maven:maven-plugin-descriptor:jar:2.0.9:compile
[INFO] [DEBUG]       
org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
[INFO] [DEBUG]       org.apache.maven:maven-monitor:jar:2.0.9:compile
[INFO] [DEBUG]       classworlds:classworlds:jar:1.1:compile
[INFO] [DEBUG]    org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-9:compile
[INFO] [DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.4.6:compile
[INFO] [DEBUG]    org.apache.maven.shared:file-management:jar:1.1:compile
[INFO] [DEBUG]       org.apache.maven.shared:maven-shared-io:jar:1.0:compile
[INFO] [DEBUG]          
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6:compile
[INFO] [DEBUG]    
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[INFO] [DEBUG]       junit:junit:jar:3.8.1:compile
[INFO] [DEBUG]    
org.apache.maven.shared:maven-dependency-analyzer:jar:1.1:compile
[INFO] [DEBUG]       asm:asm:jar:3.0:compile
[INFO] [DEBUG]    org.apache.maven.shared:maven-dependency-tree:jar:1.2:compile
[INFO] [DEBUG]    
org.apache.maven.shared:maven-common-artifact-filters:jar:1.0:compile
[INFO] [DEBUG]       
org.apache.maven.shared:maven-plugin-testing-harness:jar:1.1:compile
[INFO] [DEBUG]    org.codehaus.plexus:plexus-io:jar:1.0-alpha-1:compile
[INFO] [DEBUG]    
org.apache.maven.reporting:maven-reporting-api:jar:2.0.6:compile
[INFO] [DEBUG]       
org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7:compile
[INFO] [DEBUG]    
org.apache.maven.reporting:maven-reporting-impl:jar:2.0.4:compile
[INFO] [DEBUG]       commons-validator:commons-validator:jar:1.2.0:compile
[INFO] [DEBUG]          commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] [DEBUG]          commons-digester:commons-digester:jar:1.6:compile
[INFO] [DEBUG]             
commons-collections:commons-collections:jar:2.1:compile
[INFO] [DEBUG]          commons-logging:commons-logging:jar:1.0.4:compile
[INFO] [DEBUG]          xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] [DEBUG]       org.apache.maven.doxia:doxia-core:jar:1.0-alpha-7:compile
[INFO] [DEBUG]       oro:oro:jar:2.0.7:compile
[INFO] [DEBUG]       
org.apache.maven.doxia:doxia-site-renderer:jar:1.0-alpha-7:compile
[INFO] [DEBUG]          org.codehaus.plexus:plexus-i18n:jar:1.0-beta-6:compile
[INFO] [DEBUG]          org.codehaus.plexus:plexus-velocity:jar:1.1.2:compile
[INFO] [DEBUG]             plexus:plexus-utils:jar:1.0.2:compile
[INFO] [DEBUG]             commons-logging:commons-logging-api:jar:1.0.4:compile
[INFO] [DEBUG]             velocity:velocity:jar:1.4:compile
[INFO] [DEBUG]                velocity:velocity-dep:jar:1.4:runtime
[INFO] [DEBUG]          
org.apache.maven.doxia:doxia-decoration-model:jar:1.0-alpha-7:compile
[INFO] [DEBUG] Created new class realm 
plugin>org.apache.maven.plugins:maven-dependency-plugin:2.1
[INFO] [DEBUG] Populating class realm 
plugin>org.apache.maven.plugins:maven-dependency-plugin:2.1
[INFO] [DEBUG]   Included: 
org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
[INFO] [DEBUG]   Included: commons-cli:commons-cli:jar:1.0
[INFO] [DEBUG]   Included: 
org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
[INFO] [DEBUG]   Included: org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-9
[INFO] [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.4.6
[INFO] [DEBUG]   Included: org.apache.maven.shared:file-management:jar:1.1
[INFO] [DEBUG]   Included: org.apache.maven.shared:maven-shared-io:jar:1.0
[INFO] [DEBUG]   Included: junit:junit:jar:3.8.1
[INFO] [DEBUG]   Included: 
org.apache.maven.shared:maven-dependency-analyzer:jar:1.1
[INFO] [DEBUG]   Included: asm:asm:jar:3.0
[INFO] [DEBUG]   Included: org.apache.maven.shared:maven-dependency-tree:jar:1.2
[INFO] [DEBUG]   Included: 
org.apache.maven.shared:maven-common-artifact-filters:jar:1.0
[INFO] [DEBUG]   Included: 
org.apache.maven.shared:maven-plugin-testing-harness:jar:1.1
[INFO] [DEBUG]   Included: org.codehaus.plexus:plexus-io:jar:1.0-alpha-1
[INFO] [DEBUG]   Included: 
org.apache.maven.reporting:maven-reporting-api:jar:2.0.6
[INFO] [DEBUG]   Included: org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7
[INFO] [DEBUG]   Included: 
org.apache.maven.reporting:maven-reporting-impl:jar:2.0.4
[INFO] [DEBUG]   Included: commons-validator:commons-validator:jar:1.2.0
[INFO] [DEBUG]   Included: commons-beanutils:commons-beanutils:jar:1.7.0
[INFO] [DEBUG]   Included: commons-digester:commons-digester:jar:1.6
[INFO] [DEBUG]   Included: commons-collections:commons-collections:jar:2.1
[INFO] [DEBUG]   Included: commons-logging:commons-logging:jar:1.0.4
[INFO] [DEBUG]   Included: xml-apis:xml-apis:jar:1.0.b2
[INFO] [DEBUG]   Included: org.apache.maven.doxia:doxia-core:jar:1.0-alpha-7
[INFO] [DEBUG]   Included: oro:oro:jar:2.0.7
[INFO] [DEBUG]   Included: 
org.apache.maven.doxia:doxia-site-renderer:jar:1.0-alpha-7
[INFO] [DEBUG]   Included: org.codehaus.plexus:plexus-i18n:jar:1.0-beta-6
[INFO] [DEBUG]   Included: org.codehaus.plexus:plexus-velocity:jar:1.1.2
[INFO] [DEBUG]   Included: plexus:plexus-utils:jar:1.0.2
[INFO] [DEBUG]   Included: commons-logging:commons-logging-api:jar:1.0.4
[INFO] [DEBUG]   Included: velocity:velocity:jar:1.4
[INFO] [DEBUG]   Included: velocity:velocity-dep:jar:1.4
[INFO] [DEBUG]   Included: 
org.apache.maven.doxia:doxia-decoration-model:jar:1.0-alpha-7
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-core:jar:2.0.9
[INFO] [DEBUG]   Excluded: 
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.9
[INFO] [DEBUG]   Excluded: org.apache.maven:maven-monitor:jar:2.0.9
[INFO] [DEBUG]   Excluded: classworlds:classworlds:jar:1.1
[INFO] [DEBUG]   Excluded: 
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6
[INFO] [DEBUG]   Excluded: 
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[INFO] [DEBUG] Configuring mojo 
org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies from 
plugin realm 
ClassRealm[plugin>org.apache.maven.plugins:maven-dependency-plugin:2.1, parent: 
ClassRealm[plugin>com.progress.maven.plugins:plugin-sandbox:8.0-SNAPSHOT, 
parent: ClassRealm[maven.api, parent: null]]]
[INFO] [DEBUG] Configuring mojo 
'org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies' with 
basic configurator -->
[INFO] [DEBUG]   (f) project = MavenProject: 
de.woq.maven.plugins:test-plugin:8.0-SNAPSHOT @ 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/interpolated-pom.xml
[INFO] [DEBUG]   (s) outputDirectory = 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/test
[INFO] [DEBUG]   (s) remoteRepos = [       id: internal-mirror
[INFO]       url: 
https://www.soa-knowledge.org/nexus/content/groups/internal-mirror
[INFO]    layout: default
[INFO] snapshots: [enabled => true, update => daily]
[INFO]  releases: [enabled => true, update => daily]
[INFO] ]
[INFO] [DEBUG]   (f) reactorProjects = [MavenProject: 
de.woq.maven.plugins:test-plugin:8.0-SNAPSHOT @ 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/src/it/simple/interpolated-pom.xml]
[INFO] [DEBUG]   (s) local =        id: local
[INFO]       url: file:///Users/andreasgies/.m2/repository/
[INFO]    layout: none
[INFO] 
[INFO] [DEBUG] -- end configuration --
[INFO] [DEBUG] org.apache.maven.plugin.dependency.unpackdependenciesm...@dd0feea
[INFO] [INFO] 1
[INFO] [INFO] ==============================
[INFO] [INFO] 
------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] 
------------------------------------------------------------------------
[INFO] [INFO] Total time: 2.020s
[INFO] [INFO] Finished at: Wed Oct 20 20:43:47 CEST 2010
[INFO] [INFO] Final Memory: 7M/81M
[INFO] [INFO] 
------------------------------------------------------------------------
[INFO] ..SUCCESS (3.6 s)
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO]   Passed: 1, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ 
plugin-sandbox ---
[INFO] Installing 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/target/plugin-sandbox-8.0-SNAPSHOT.jar
 to 
/Users/andreasgies/.m2/repository/com/progress/maven/plugins/plugin-sandbox/8.0-SNAPSHOT/plugin-sandbox-8.0-SNAPSHOT.jar
[INFO] Installing 
/Users/andreasgies/projects/Model-Driven-Deployment/plugin-sandbox/pom.xml to 
/Users/andreasgies/.m2/repository/com/progress/maven/plugins/plugin-sandbox/8.0-SNAPSHOT/plugin-sandbox-8.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.980s
[INFO] Finished at: Wed Oct 20 20:43:47 CEST 2010
[INFO] Final Memory: 41M/86M
[INFO] ------------------------------------------------------------------------
/*
 * Copyright (C) 2010, Way of Quality
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package de.woq.maven.plugins

import _root_.org.apache.maven.plugin._
import descriptor.MojoDescriptor
import org.scala_tools.maven.mojo.annotations._
import _root_.org.apache.maven.project.MavenProject
import _root_.org.apache.maven.execution.MavenSession
import _root_.org.apache.maven.model.Plugin
import _root_.org.apache.maven.lifecycle.LifecycleExecutor
import _root_.org.codehaus.plexus.component.annotations.Requirement
import org.codehaus.plexus.configuration.PlexusConfiguration
import org.codehaus.plexus.util.xml.{Xpp3DomUtils, Xpp3Dom};

import scala.collection.JavaConversions._
@goal("echo")
@phase("process-sources")
@requiresProject
class TestMojo extends AbstractMojo {

  @readOnly @parameter @expression("${project}")
  var project : MavenProject = _

  @readOnly @parameter @expression("${session}")
  var session : MavenSession = _

  private def getBuildPlugin(groupId: String, artifactId: String, version: 
Option[String]) =
    
List.fromIterator(project.getBuildPlugins.iterator).asInstanceOf[List[Plugin]]
      .filter(
         p => (p.getGroupId.equals(groupId)) && 
(p.getArtifactId.equals(artifactId) && (version == None || 
p.getVersion.equals(version)))
      )

  private def resolveComponent[T](t: Class[T]) : T = 
session.getContainer.lookup(t.getName).asInstanceOf[T]

  def buildConfiguration(params: Map[String, String]): Xpp3Dom = {
    var config = new Xpp3Dom("configuration")

    for{
      key <- params.keys
      value = params.get(key)
    } {
      var child = new Xpp3Dom(key)
      child.setValue(
        params.get(key) match {
          case Some(v) => v
          case None => ""
        }
      )
      config.addChild(child)
    }
    config
  }

  override def execute = {

    // Needed as component resolution in scala mojo support seems to be broken
    val buildPluginManager = resolveComponent(classOf[BuildPluginManager])
    val lifeCycleExecutor = resolveComponent(classOf[LifecycleExecutor])
    val pluginManager = resolveComponent(classOf[MavenPluginManager])

    getLog.info("==============================")

    val plugins = getBuildPlugin("org.apache.maven.plugins", 
"maven-dependency-plugin", None)
    assert(plugins.length == 1, "Found " + plugins.length + " plugins for 
dependdency resolution, expected 1")
    val dep: Plugin = plugins.head
    val depDesc = pluginManager.getPluginDescriptor(dep, 
project.getRemotePluginRepositories, session.getRepositorySession)

    assert(project != null)
    assert(session != null)
    assert(pluginManager != null)
    assert(lifeCycleExecutor != null)
    assert(buildPluginManager != null)

    getLog.debug(depDesc.toString)

    val md : MojoDescriptor = depDesc.getMojo("unpack-dependencies")
    getLog.info(md.toString)

    val config : Xpp3Dom = Xpp3DomUtils.mergeXpp3Dom(
       buildConfiguration(
         Map(
          "outputDirectory" -> "test",
          "project" -> "${project}",
          "local" -> "${localRepository}",
          "reactorProjects" -> "${reactorProjects}" ,
          "remoteRepos" -> "${project.remoteArtifactRepositories}"
         )
       ),
      convert(md)
    )

    getLog.info(config.toUnescapedString)

    val execution = new MojoExecution(md, "unpack-dependencies")
    execution.setConfiguration(config)

    pluginManager.setupPluginRealm(depDesc, session, 
Thread.currentThread.getContextClassLoader, null, null)
    val mojo = pluginManager.getConfiguredMojo(classOf[Mojo], session, 
execution)

    getLog.debug(mojo.toString)
    getLog.info(project.getDependencies.size.toString)
    
    lifeCycleExecutor.calculateForkedExecutions(execution, session)

    if (!execution.getForkedExecutions.isEmpty) {
      getLog.info("Executing forked Executions")
      lifeCycleExecutor.executeForkedExecutions(execution, session)
    }

    getLog.info("==============================")
  }

  private def convert(mojoDescriptor: MojoDescriptor) : Xpp3Dom =
    if (mojoDescriptor != null) convert(mojoDescriptor.getConfiguration)
    else new Xpp3Dom("configuration")

  private def convert(config : PlexusConfiguration) : Xpp3Dom =

    if (config == null) null
    else {
      var result = new Xpp3Dom(config.getName)
      result.setValue(config.getValue(null))
      for(attrib <- config.getAttributeNames)
        result.setAttribute(attrib, config.getAttribute(attrib))
      for(child <- config.getChildren)
        result.addChild(convert(child))
      
      result
    }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to