Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Dependencies
-
Labels:None
-
Complexity:Intermediate
-
Testcase included:yes
-
Number of attachments :
Description
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)
I should also 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>
Activity
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | Reviewed [ 13555 ] |
| Status | Open [ 1 ] | Closed [ 6 ] |
| Assignee | Brett Porter [ brettporter ] | |
| Resolution | Won't Fix [ 2 ] | |
| Fix Version/s | Reviewed Pending Version Assignment [ 13555 ] |