Andreas Schildbach <andreas <at> schildbach.de> writes:

> Yes, Reactor should take care of that if you run "mvn install" in your 
> root project directory (containing the "outermost" pom.xml).

Yes, but I'd like to build m2 separately.

> As an alternative, it should also be possible to run "mvn install" 
> separately on m1 and then m2, because Maven searches for parent poms on 
> the filesystem rather than resolve them from the local repository.

I tried this but it didn't work. It is definitely looking for the
parent pom in the local repository:

$ mvn install
[INFO] Scanning for projects...
[INFO] -------------------------------------------------------
[INFO] Building Module 2 for Test Project
[INFO]    task-segment: [install]
[INFO] -------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
Downloading: http://repo1.maven.org/maven2/org/foo/prj/1.0/prj-1.0.pom
[WARNING] Unable to get resource from repository central 
(http://repo1.maven.org/maven2)
[INFO] -------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] -------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.foo
ArtifactId: prj
Version: 1.0

Reason: Unable to download the artifact from any repository

  org.foo:prj:pom:1.0

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

The m2 pom.xml is:

<project>
        <parent>
                <groupId>org.foo</groupId>
                <artifactId>prj</artifactId>
                <version>1.0</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>
        <artifactId>m2</artifactId>
        <packaging>jar</packaging>
        <version>1.0</version>
        <name>Module 2 for Test Project</name>
        <dependencies>
                <dependency>
                        <groupId>org.foo</groupId>
                        <artifactId>m1</artifactId>
                        <version>1.0</version>
                </dependency>
        </dependencies>
</project>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to