Sorry, I should mention the circular dependency comes about because I have a parent pom to these 2 projects which defines them each as modules...

ie.

<artifactId>parentProject</artifactId>
<modules>
<module>applicationArtifact</module>
<module>pluginArtifact</module>
</modules>

Andrew.




Andrew Franklin wrote:
I've got a situation where Maven is telling me I have a circular dependency that should be resolved.

Let's say I've got applicationArtifact which provides an interface which I want to consume at compile time in an artifact called pluginArtifact. When applicationArtifact is ready to be packaged, I want to include pluginArtifact in the libs as a runtime dependency.

ie.

<artifactId>applicationArtifact</artifactId>
<dependencies>
  <dependency>
    <artifactId>pluginArtifact</artifactId>
    <scope>runtime</scope>
  </dependency>
</dependencies>

<artifactId>pluginArtifact</artifactId>
<dependencies>
  <dependency>
    <artifactId>applicationArtifact</artifactId>
<scope>compile</scope> <!-- such that we can use the common interface -->
  </dependency>
</dependencies>


Maven won't compile the above as it cites a circular dependency. This should work because of the following valid order:

1) compile applicationArtifact (ignore pluginArtifact because it's scoped at Runtime) 2) compile pluginArtifact (include a compile time reference to applicationArtifact)
3) package applicationArtifact (which drags in pluginArtifact)


How should I solve this issue?

Andrew

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





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

Reply via email to