Search code examples
javamavenintellij-idea

Intellij Error:Cannot build Artifact 'XXX:war exploded' because it is included into a circular dependency


The project was working well before, but suddenly can not update war file in "target" directory.When I want to "Build Artifacts", error shows: Error:Cannot build Artifact 'XXX:war exploded' because it is included into a circular dependency

What is the wrong with this?

the artifacts :

enter image description here enter image description here


Solution

  • The solution is to remove "MavenDemo:war" artifact and "MavenDemo:war exploded" artifact from the project, and rebuild the project、rebuild artifacts. set the deployment artifact from MavenDemo:war to MaterialManager:war.

    I think the problem of this project is that the "MavenDemo:war" artifact and "MavenDemo:war exploded" artifact are repeated. So the solution is to remove them from the project.

    1:

    1

    2:

    2

    3

    3:

    4

    4:

    5

    And then, Everytime after I make some update in my code, I can click "Run" Button to deploy the updated project to Tomcat successfully.

    Hope it can help somebody else ~