The easiest way is to rename project2's jar file to project2-1.0-SNAPSHOT.jar 
and copy it to <user home 
dir>/.m2/repository/com.mydomain/project2/1.0-SNAPSHOT/

I'm not that familier with maven 2 myself, but i believe you also have to 
change the scope to provided for both dependency entries (the project1 entry in 
project2's pom.xml and the project2 entry in project1's pom.xml).  Otherwise, 
it will detect the cyclic dependency and fail.  

Of course, you may want to try defining the parent pom.xml first.  Maven *may* 
be smart enough to figure out what you need from that (I don't know, i've never 
tried).  

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 23, 2005 3:15 PM
To: users@maven.apache.org
Subject: [M2] Cyclical Dependencies


I am very new to maven and have decided to start off with Maven 2.

I have two projects and both projects depend upon each other to compile... 
 

Directory Structure

C:\tmp\project1
        pom.xml
        src\main\java\com... ClassA.java, ClassB.java
C:\tmp\project2
        pom.xml
        src\main\java\com... ClassC.java, ClassD.java

Class A uses ClassD
Class B uses ClassC

I do not yet have a master pom.xml defined yet that contains the module 
definitions... I was trying to get the individual projects to compile 
first before I create the master pom.xml file.
    <modules>
        <module>project1</module>
        <module>project2</module>
    </modules>

When defining the pom.xml file for each project I use the snapshot for the 
dependency and since I can't get either project to compile, I can't 
generate the snapshots..

project1's pom.xml file contains
<dependency>
        <groupId>com.mydomain</groupId>
        <artifactId>project2</artifactId>
        <version>1.0-SNAPSHOT</version>
</dependency>

project2's pom.xml file contains
<dependency>
        <groupId>com.mydomain</groupId>
        <artifactId>project1</artifactId>
        <version>1.0-SNAPSHOT</version>
</dependency>

How can I get a project to compile when the dependant snapshot can't be 
generated because of cyclical dependencies?

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



----------------------------------------------------------------------
The information contained in this transmission is intended only for
the personal and confidential use of the designated recipients named
herein.  If the reader of this transmission is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
transmission in error, and that any review, dissemination,
distribution, or copying of this transmission is strictly prohibited.
If you have received this communication in error, please notify the
sender and return and delete the original transmission immediately.
Thank you.


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

Reply via email to