You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/03/06 23:21:28 UTC

[jira] Commented: (MPMULTIPROJECT-11) multiproject:artifact builds do not use local project artifacts for dependencies

The following comment has been added to this issue:

     Author: John Fallows
    Created: Sat, 6 Mar 2004 5:19 PM
       Body:
The multiproject plugin uses the reactor internally, which can provide access to all the subprojects, but only after the reactor has completed.

Perhaps we could first use the reactor with a no-op goal to obtain a reference to all the subprojects, then use that information during a second reactor execution for the multiproject goal's normal use, and set the jar overrides, as you suggest.
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/secure/ViewIssue.jspa?key=MPMULTIPROJECT-11&page=comments#action_17331

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/secure/ViewIssue.jspa?key=MPMULTIPROJECT-11

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPMULTIPROJECT-11
    Summary: multiproject:artifact builds do not use local project artifacts for dependencies
       Type: Bug

     Status: Reopened
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-multiproject-plugin

   Assignee: 
   Reporter: John Fallows

    Created: Fri, 5 Sep 2003 7:51 PM
    Updated: Sat, 6 Mar 2004 5:19 PM
Environment: WinXP

Description:
Suppose I have a "multiproject" with 3 subprojects, called "api", "ri" and "tck", each with a current version of "1.0-b1-SNAPSHOT".

The dependencies are setup as follows:
  ri-1.0-b1-SNAPSHOT  -> api-1.0-b1-SNAPSHOT
  tck-1.0-b1-SNAPSHOT -> api-1.0-b1-SNAPSHOT

When I use multiproject plugin to build, the dependencies are not picked up as expected.

> maven multiproject:artifact

Starting the reactor...
Our processing order:
api
ri
tck

+----------------------------------------
| Executing multiproject:artifact-callback api
| Memory: 4M/6M
+----------------------------------------
...
    [echo] Running jar:jar for api
...

+----------------------------------------
| Executing multiproject:artifact-callback Oracle EL RI
| Memory: 7M/9M
+----------------------------------------

BUILD FAILED
File...... [maven.repo.local]/plugins/maven-multiproject-plugin-1.0/
Element... maven:reactor
Line...... 191
Column.... 9
The build cannot continue because of the following unsatisfied dependency:

api-1.0-b1-SNAPSHOT.jar

This is happening because the api artifact is not present in the local maven repository and cannot therefore be resolved by the ri project.

It would be much more convenient if this multiproject:artifact goal worked without needing to install artifacts into the local repository.

The reactor has already figured out the build order based on the dependency chain, so it is already quite clear which project dependencies are satisfied by other projects being built during the same multiproject:artifact execution.

These specific dependencies could be overridden by multiproject during a subproject build, and instead point to the local target area of the corresponding peer project.

So, for example, the ri subproject ${pom} processed by multiproject:artifact-callback could be modified to point to "${basedir}/../api/target/api-1.0-SNAPSHOT.jar" for the api dependency, instead of pointing at the local maven repository.

This would have 3 distinct advantages.

1. multiproject:artifact builds would succeed when the local maven repository does not contain the peer subproject dependencies.

2. multiproject:artifact builds would succeed when the local maven repository contains stale peer subproject dependencies previously downloaded from the remote maven repository.

3. multiproject:artifact builds would succeed even for peer subproject SNAPSHOT dependencies which would otherwise be overwritten in the local maven repository when the stale api SNAPSHOT jar is re-downloaded from the remote maven repository, during the build of the ri subproject.

Note.  This strategy would also allow multiproject:install to work for 1.0-b1-SNAPSHOT version, without forcing an offline build.  Requiring the build to be offline in this case is inconvenient because other dependencies cannot be downloaded on demand to the local maven repository.








---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org