[
http://jira.codehaus.org/browse/MNG-3283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_126054
]
Daniel Uribe commented on MNG-3283:
-----------------------------------
Any new developments on this issue? It doesn't seem to be same issue as
MNG-2277, and it is still not working on 2.0.8.
In the comments for that issue, Brian said that this is normal behavior. I
would have to agree with Alfie that if a plugin is bound to a lower phase than
the one specified in the @requiresDependencyResolution, it doesn't seem to make
sense that it would try to resolve dependencies for a higher phase which hasn't
even been executed.
Elaborating on top of the example outlined by Alfie, if the project having the
dependency uses the antrun plugin for the generate-sources phase, it specifies
a @requiresDependencyResolution of test, which is definitely higher than the
generate-resources used by the eclipse plugin. Since running the eclipse plugin
will only execute phases below generate-resources, it will never reach the
stage of creating the package (jar, war, etc) for the project that it has a
dependency for, hence failing.
Wouldn't it make sense to consider that when a plug-in is explicitly bound to a
phase, to use that for dependency resolution?
> Plugins that require dependency resolution in early phases cause dependency
> resolution issue
> --------------------------------------------------------------------------------------------
>
> Key: MNG-3283
> URL: http://jira.codehaus.org/browse/MNG-3283
> Project: Maven 2
> Issue Type: Bug
> Components: Dependencies, Plugins and Lifecycle, Reactor and
> workspace
> Affects Versions: 2.0.7
> Reporter: Alfie Kirkpatrick
> Assignee: Brian Fox
> Attachments: maven-dependency-bug.zip
>
>
> What we're seeing is that some multi-project configurations succeed on
> 'mvn package' but fail on 'mvn generate-sources'. They are failing when
> one project in the reactor references another project in the reactor
> which is not installed in the local repo. It seems that the referenced
> project has not quite "made it" into the reactor this early in the phase
> lifecycle. But it does work correctly if you target a later phase at the
> outset which is really confusing.
> The problem only occurs when a plugin binds itself to the
> generate-sources phase and has @requiresDependencyResolution, presumably
> because this is what triggers resolution of the referenced dependency
> too early in the lifecycle, and hence the error.
> We are seeing this problem when trying to run 'mvn eclipse:eclipse'
> because this only executes the generate-sources phase by default and we
> have other mojos which genuinely do generate source, such as java2wsdl.
> A workaround we're using is to run 'mvn process-classes eclipse:eclipse'.
> Attached is a really simple project that exhibits this problem.
--
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