Home:ALL Converter>Maven runtime scope and cyclic dependency

Maven runtime scope and cyclic dependency

Ask Time:2012-07-04T16:38:56         Author:user1500951

Json Formatter

I have two module A and B. Actualy B is plugin to A.
B depends on A in compile time. A NOT depend on B. On A runtime I want to add B to classpath, so in A's pom.xml I add the following dependency

pom.xml

    <dependency>
        <groupId>my_group</groupId>
        <artifactId>my_Plugin</artifactId>
        <version>${project.version}</version>
        <scope>runtime</scope>
    </dependency> 

Maven process fail with cyclic dependency error

[ERROR] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='A'}' and 'Vertex{label='B'}' introduces to cycle in the graph B-->A-->B -> [Help 1]

[ERROR]

Why runtime dependency impact compile time ?

Author:user1500951,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/11325424/maven-runtime-scope-and-cyclic-dependency
yy