You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by simim <ep...@arcor.de> on 2008/03/04 13:19:22 UTC
detected reference cycle, but there is no cycle conflict
maven build aborted with the following message:
Diagnosis: The projects in the reactor contain a cyclic reference ...
and yes, there is a cycle in the specified dependencies, like:
A -> B -> A
but A needs B only for the compilation (because a class from A
extends a class from B) and B needs A only for the runtime
(because B calls an object of the extended class per reflection).
i specified the dependency in B as <scope>runtime</scope>
and in A, B is referenced per default with the option
<scope>compile</scope>.
so, there is no cycle conflict.
any ideas?
thanks, simim
--
View this message in context: http://www.nabble.com/detected-reference-cycle%2C-but-there-is-no-cycle-conflict-tp15825973s177p15825973.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: detected reference cycle, but there is no cycle conflict
Posted by Stephen Connolly <st...@gmail.com>.
AFAIK The scope does not matter as far as maven is concerned.
This is a pom.xml cycle
i.e. Maven does not know what order to examine the pom.xml files.
The pom for A depends on the pom for B
The pom for B depends on the pom for A
In order to build the complete list of dependencies of A, it needs to know
what dependencies of B will be added transitively
If you "force" the issue, then the maven-release-plugin will never be able
to build a release on it's own.
-Stephen
On Tue, Mar 4, 2008 at 1:04 PM, simim <ep...@arcor.de> wrote:
>
>
> Jan Torben Heuer-3 wrote:
> >
> > Try to completely eliminate the "cyclic" reference by using an interface
> > in
> > A, so that you don't need to specifiy a dependency from B to A
> >
> >
> > Jan
> >
>
> thanks, but i think thats not a smooth solution in my case. at compilation
> time there
> is definitively not cycle, because B doesn`t need A in any way, at
> compilation.
> but maven abort the compilation with the message above.
>
> so, i see no problem at the design. i cannot understand why maven detects
> there
> an psoudo-cycle. maybe the relevant scope-option are not considered.
>
> maybe there is a possibility to set a "cycle-order" in maven? with that i
> could set
> reference A -> B before reference B -> A. maybe i can realize an order
> with a common parent pom-file for A and B? perhaps that the wrong way?
>
> other ideas? thanks!
>
> --
> View this message in context:
> http://www.nabble.com/detected-reference-cycle%2C-but-there-is-no-cycle-conflict-tp15825973s177p15826737.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: detected reference cycle, but there is no cycle conflict
Posted by "simon.kitching@chello.at" <si...@chello.at>.
simim schrieb:
> Jan Torben Heuer-3 wrote:
>
>> Try to completely eliminate the "cyclic" reference by using an interface
>> in
>> A, so that you don't need to specifiy a dependency from B to A
>>
>>
>> Jan
>>
>>
>
> thanks, but i think thats not a smooth solution in my case. at compilation
> time there
> is definitively not cycle, because B doesn`t need A in any way, at
> compilation.
> but maven abort the compilation with the message above.
>
> so, i see no problem at the design. i cannot understand why maven detects
> there
> an psoudo-cycle. maybe the relevant scope-option are not considered.
>
> maybe there is a possibility to set a "cycle-order" in maven? with that i
> could set
> reference A -> B before reference B -> A. maybe i can realize an order
> with a common parent pom-file for A and B? perhaps that the wrong way?
>
> other ideas? thanks!
>
No, there is no solution to this with maven except the one that Jan gave.
Maven downloads all dependencies, even the runtime-scoped ones, during
building. So B needs A before it can build, but A needs B before it can
build.
Note that there are maven plugins that run apps, eg the exec, jetty or
cargo plugins. These will need the runtime-scoped jars available. And
maven doesn't look ahead to determine whether the current pom configures
plugins that will need runtime-scoped dependencies. It can't anyway, as
something like the maven-antrun-plugin might need the runtime deps
depending on what is inside some external file it cannot parse.
Regards, Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: detected reference cycle, but there is no cycle conflict
Posted by simim <ep...@arcor.de>.
Jan Torben Heuer-3 wrote:
>
> Try to completely eliminate the "cyclic" reference by using an interface
> in
> A, so that you don't need to specifiy a dependency from B to A
>
>
> Jan
>
thanks, but i think thats not a smooth solution in my case. at compilation
time there
is definitively not cycle, because B doesn`t need A in any way, at
compilation.
but maven abort the compilation with the message above.
so, i see no problem at the design. i cannot understand why maven detects
there
an psoudo-cycle. maybe the relevant scope-option are not considered.
maybe there is a possibility to set a "cycle-order" in maven? with that i
could set
reference A -> B before reference B -> A. maybe i can realize an order
with a common parent pom-file for A and B? perhaps that the wrong way?
other ideas? thanks!
--
View this message in context: http://www.nabble.com/detected-reference-cycle%2C-but-there-is-no-cycle-conflict-tp15825973s177p15826737.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: detected reference cycle, but there is no cycle conflict
Posted by Jan Torben Heuer <jt...@mail2003.dnsalias.org>.
simim wrote:
> but A needs B only for the compilation (because a class from A
> extends a class from B) and B needs A only for the runtime
> (because B calls an object of the extended class per reflection).
> i specified the dependency in B as <scope>runtime</scope>
> and in A, B is referenced per default with the option
> <scope>compile</scope>.
Try to completely eliminate the "cyclic" reference by using an interface in
A, so that you don't need to specifiy a dependency from B to A
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org