You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Manisha Sur <ma...@gmail.com> on 2006/02/15 10:33:38 UTC

A cycle was detected while running the maven multiproject:clean goal

Hi,

I get the 'A cycle was detected' error for the multiproject:goal
-Dgoal=3Dclean .
The master project.xml contains dependencies on its subprojects, is this the
reason its giving this error.
when i comment the dependencies part of the master project.xml , everything
works fine.
how to tackle this problem . I am using maven 1.1 beta2 . i also have a copy
of maven 1.0.2


--
Warm Regards
Manisha Sur

Re: A cycle was detected while running the maven multiproject:clean goal

Posted by Arnaud HERITIER <ah...@gmail.com>.
It's not recommanded to use the same project for your multiproject
entry and to store the parent settings.

Generally, what it is recommended to do is :

modules
|-modules-parent
| \-project.xml => All your common settings for your modules
|-module-A
| \-project.xml => Extends modules-parent
|-module-B
| \-project.xml => Extends modules-parent and uses module-A for example
\-project.xml => Multiproject settings (very light). Don't extends
modules-parent


Arnaud

On 2/16/06, Manisha Sur <ma...@gmail.com> wrote:
> Hi ,
>
> let me take an example ,
>
> i have a 'modules' maven directory containing project.xml with the contents:
> <project>
> .......
>  <dependencies>
>    <dependency>
>      <groupId>com.sun.j2ee.blueprints</groupId>
>      <artifactId>petstore-war</artifactId>
>      <version>${pom.currentVersion}</version>
>      <type>war</type>
>      <properties>
>        <ear.bundle>true</ear.bundle>
>        <ear.appxml.war.context-root>/petstore</ear.appxml.war.context-root>
>      </properties>
>    </dependency>
>    <build>
>    .......
>    </build>
> .......
> </project>
>
> the project.properties :
> maven.multiproject.includes=**/project.xml
> maven.multiproject.excludes=project.xml
>
>
> i have a subproject 'petstore-web' under the modules directory  containing
> project.xml with the contents:
>
> <project>
>  <extend>../project.xml</extend>
>  <name>Petstore WAR</name>
>  <artifactId>petstore-war</artifactId>
>  <package>com.sun.j2ee.blueprints.petstore</package>
>  <shortDescription>Petstore WAR</shortDescription>
>  <description>Petstore WAR</description>
>  <dependencies>
>    <dependency>
>      <groupId>com.sun.j2ee.blueprints</groupId>
>      <artifactId>util-tracer</artifactId>
>      <version>${pom.currentVersion}</version>
>      <properties>
>        <war.bundle>true</war.bundle>
>      </properties>
>    </dependency>
>    ........
>  </dependencies>
>  <build>
>  ......
>  </build>
>  </project>
>
>
> Now ... From modules when i run 'multiproject:clean' , it gives the same
> error of cycle.
> but if i run clean from the petstore-web directory , i get no such error
> .....
> The Multiproject:clean must be calling clean on each subproject ... so if i
> run explicitly from the subproject ... it runs smoothly i.e. it deletes the
> target directory within the subproject.
> What causes the error ?
>
>
> On 2/16/06, Manisha Sur <ma...@gmail.com> wrote:
> >
> >  How does it effect the clean goal ? it only means to clean the target
> > directory.
> >
> > On 2/15/06, Arnaud HERITIER <aheritier@gmail.com > wrote:
> > >
> > > Yes, if each subproject extends the master you have a cycle because
> > > aech subproject declares itself as a dependency.
> > > It's better to define your dependencies in each subproject.
> > >
> > > Arnaud
> > >
> > > On 2/15/06, Manisha Sur < manisha.sur@gmail.com> wrote:
> > > > Hi,
> > > >
> > > > I get the 'A cycle was detected' error for the multiproject:goal
> > > > -Dgoal=3Dclean .
> > > > The master project.xml contains dependencies on its subprojects, is
> > > this the
> > > > reason its giving this error.
> > > > when i comment the dependencies part of the master project.xml ,
> > > everything
> > > > works fine.
> > > > how to tackle this problem . I am using maven 1.1 beta2 . i also have
> > > a copy
> > > > of maven 1.0.2
> > > >
> > > >
> > > > --
> > > > Warm Regards
> > > > Manisha Sur
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > Warm Regards
> > Manisha Sur
>
>
>
>
> --
> Warm Regards
> Manisha Sur
>
>

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


Re: A cycle was detected while running the maven multiproject:clean goal

Posted by Manisha Sur <ma...@gmail.com>.
Hi ,

let me take an example ,

i have a 'modules' maven directory containing project.xml with the contents:
<project>
.......
 <dependencies>
    <dependency>
      <groupId>com.sun.j2ee.blueprints</groupId>
      <artifactId>petstore-war</artifactId>
      <version>${pom.currentVersion}</version>
      <type>war</type>
      <properties>
        <ear.bundle>true</ear.bundle>
        <ear.appxml.war.context-root>/petstore</ear.appxml.war.context-root>
      </properties>
    </dependency>
    <build>
    .......
    </build>
.......
</project>

the project.properties :
maven.multiproject.includes=**/project.xml
maven.multiproject.excludes=project.xml


i have a subproject 'petstore-web' under the modules directory  containing
project.xml with the contents:

<project>
  <extend>../project.xml</extend>
  <name>Petstore WAR</name>
  <artifactId>petstore-war</artifactId>
  <package>com.sun.j2ee.blueprints.petstore</package>
  <shortDescription>Petstore WAR</shortDescription>
  <description>Petstore WAR</description>
  <dependencies>
    <dependency>
      <groupId>com.sun.j2ee.blueprints</groupId>
      <artifactId>util-tracer</artifactId>
      <version>${pom.currentVersion}</version>
      <properties>
        <war.bundle>true</war.bundle>
      </properties>
    </dependency>
    ........
  </dependencies>
  <build>
  ......
  </build>
  </project>


Now ... From modules when i run 'multiproject:clean' , it gives the same
error of cycle.
but if i run clean from the petstore-web directory , i get no such error
.....
The Multiproject:clean must be calling clean on each subproject ... so if i
run explicitly from the subproject ... it runs smoothly i.e. it deletes the
target directory within the subproject.
What causes the error ?


On 2/16/06, Manisha Sur <ma...@gmail.com> wrote:
>
>  How does it effect the clean goal ? it only means to clean the target
> directory.
>
> On 2/15/06, Arnaud HERITIER <aheritier@gmail.com > wrote:
> >
> > Yes, if each subproject extends the master you have a cycle because
> > aech subproject declares itself as a dependency.
> > It's better to define your dependencies in each subproject.
> >
> > Arnaud
> >
> > On 2/15/06, Manisha Sur < manisha.sur@gmail.com> wrote:
> > > Hi,
> > >
> > > I get the 'A cycle was detected' error for the multiproject:goal
> > > -Dgoal=3Dclean .
> > > The master project.xml contains dependencies on its subprojects, is
> > this the
> > > reason its giving this error.
> > > when i comment the dependencies part of the master project.xml ,
> > everything
> > > works fine.
> > > how to tackle this problem . I am using maven 1.1 beta2 . i also have
> > a copy
> > > of maven 1.0.2
> > >
> > >
> > > --
> > > Warm Regards
> > > Manisha Sur
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Warm Regards
> Manisha Sur




--
Warm Regards
Manisha Sur

Re: A cycle was detected while running the maven multiproject:clean goal

Posted by Arnaud HERITIER <ah...@gmail.com>.
Contrary to m2, maven 1 resolves de dependencies for any goal (clean
included :-( )

Arnaud

On 2/16/06, Manisha Sur <ma...@gmail.com> wrote:
>  How does it effect the clean goal ? it only means to clean the target
> directory.
>
> On 2/15/06, Arnaud HERITIER <ah...@gmail.com> wrote:
> >
> > Yes, if each subproject extends the master you have a cycle because
> > aech subproject declares itself as a dependency.
> > It's better to define your dependencies in each subproject.
> >
> > Arnaud
> >
> > On 2/15/06, Manisha Sur <ma...@gmail.com> wrote:
> > > Hi,
> > >
> > > I get the 'A cycle was detected' error for the multiproject:goal
> > > -Dgoal=3Dclean .
> > > The master project.xml contains dependencies on its subprojects, is this
> > the
> > > reason its giving this error.
> > > when i comment the dependencies part of the master project.xml ,
> > everything
> > > works fine.
> > > how to tackle this problem . I am using maven 1.1 beta2 . i also have a
> > copy
> > > of maven 1.0.2
> > >
> > >
> > > --
> > > Warm Regards
> > > Manisha Sur
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Warm Regards
> Manisha Sur
>
>

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


Re: A cycle was detected while running the maven multiproject:clean goal

Posted by Manisha Sur <ma...@gmail.com>.
 How does it effect the clean goal ? it only means to clean the target
directory.

On 2/15/06, Arnaud HERITIER <ah...@gmail.com> wrote:
>
> Yes, if each subproject extends the master you have a cycle because
> aech subproject declares itself as a dependency.
> It's better to define your dependencies in each subproject.
>
> Arnaud
>
> On 2/15/06, Manisha Sur <ma...@gmail.com> wrote:
> > Hi,
> >
> > I get the 'A cycle was detected' error for the multiproject:goal
> > -Dgoal=3Dclean .
> > The master project.xml contains dependencies on its subprojects, is this
> the
> > reason its giving this error.
> > when i comment the dependencies part of the master project.xml ,
> everything
> > works fine.
> > how to tackle this problem . I am using maven 1.1 beta2 . i also have a
> copy
> > of maven 1.0.2
> >
> >
> > --
> > Warm Regards
> > Manisha Sur
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
Warm Regards
Manisha Sur

Re: A cycle was detected while running the maven multiproject:clean goal

Posted by Arnaud HERITIER <ah...@gmail.com>.
Yes, if each subproject extends the master you have a cycle because
aech subproject declares itself as a dependency.
It's better to define your dependencies in each subproject.

Arnaud

On 2/15/06, Manisha Sur <ma...@gmail.com> wrote:
> Hi,
>
> I get the 'A cycle was detected' error for the multiproject:goal
> -Dgoal=3Dclean .
> The master project.xml contains dependencies on its subprojects, is this the
> reason its giving this error.
> when i comment the dependencies part of the master project.xml , everything
> works fine.
> how to tackle this problem . I am using maven 1.1 beta2 . i also have a copy
> of maven 1.0.2
>
>
> --
> Warm Regards
> Manisha Sur
>
>

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


RE: A cycle was detected while running the maven multiproject:clean goal

Posted by Scott Ryan <sc...@theryansplace.com>.
Yes that means that every project depends on the every other project and the
system cannot figure out which to build first and maintain the proper
relationships.  We have seen that behavior with 1.1-beta2 and it is the
correct behavior.  This is similar to a circular dependency when building
java projects.  You just need one project that can be built first that does
not have a relationship to a project that points back to itself.

Scott Ryan
Chief Technology Officer
Soaring Eagle L.L.C.
scott@theryansplace.com
www.soaringeagleco.com
(303) 263-3044

-----Original Message-----
From: Manisha Sur [mailto:manisha.sur@gmail.com]
Sent: Wednesday, February 15, 2006 2:34 AM
To: users@maven.apache.org
Subject: A cycle was detected while running the maven multiproject:clean
goal


Hi,

I get the 'A cycle was detected' error for the multiproject:goal
-Dgoal=3Dclean .
The master project.xml contains dependencies on its subprojects, is this the
reason its giving this error.
when i comment the dependencies part of the master project.xml , everything
works fine.
how to tackle this problem . I am using maven 1.1 beta2 . i also have a copy
of maven 1.0.2


--
Warm Regards
Manisha Sur



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