You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "rob g (JIRA)" <ji...@codehaus.org> on 2008/07/08 02:27:26 UTC

[jira] Commented: (MSOURCES-32) Usage dependency-plugin with source-plugin causes BUILD ERROR

    [ http://jira.codehaus.org/browse/MSOURCES-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=140991#action_140991 ] 

rob g commented on MSOURCES-32:
-------------------------------

I ran into this same problem when working with the cobertura plugin as well and I believe I've traced the problem back to the DefaultLifecycleExecutor and the DefaultPluginManager.  The error appears to be triggered when executing a mojo which forks the project lifecycle (which is true for both the maven-source-plugin and the cobertura-maven-plugin) *and* another build plugin has been configured to _not_ be inherited (as is the case with the dependency:copy mojo in the attached sample project).  The role of the "inherited" attribute in triggering the error can be seen by commenting out the declaration in the sample pom, which will enable the build to pass.

What I think is happening is that when MojoExecutions are created by the DefaultLifecycleExecutor, the execution configuration is not populated.  In addition, when the MavenProject is cloned to be the "executionProject" for the forked lifecycle, only those plugins which have inherited == true are copied over to the clone by ModelUtils.mergePluginLists().  Thus by the time that the DefaultPluginManager is confirming that the mojo is properly configured, you have an execution object which was constructed from the original project without any configuration elements and it is being evaluated in the scope of a cloned project which doesn't include the plugin definition.



> Usage dependency-plugin with source-plugin causes BUILD ERROR
> -------------------------------------------------------------
>
>                 Key: MSOURCES-32
>                 URL: http://jira.codehaus.org/browse/MSOURCES-32
>             Project: Maven 2.x Source Plugin
>          Issue Type: Bug
>         Environment: Maven version: 2.0.8, Java version: 1.5.0_12, OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Valeriy Gavrilovets
>         Attachments: log.txt, MSOURCES-32.zip
>
>
> I use dependecy-plugin to copy some jars into the project. I attach it to initialize phase. If i do so, the source-plugin gets silly. 
> [INFO] [jar:jar]
> [INFO] Building jar: c:\share\sample-project\ISSUE\target\ISSUE-0.0.1-SNAPSHOT.jar
> [INFO] Preparing source:jar
> [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] One or more required plugin parameters are invalid/missing for 'dependency:copy'
> [0] Inside the definition for plugin 'maven-dependency-plugin' specify the following:
> <configuration>
>   ...
>   <artifactItems>VALUE</artifactItems>
> </configuration>.
> I get silly too. =(

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira