Maybe you could try using the assembly plugin to assemble your final
package...  and use the assembly descriptor to specify which items should be
included in it?  This should allow you to remove the pluginArtifact
dependency in your applicationArtifact pom.  Just a thought...


Patrick

On 1/11/07, Andrew Franklin <[EMAIL PROTECTED]> 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]


Reply via email to