java Intellij 错误:无法构建工件“XXX:战争爆炸”,因为它包含在循环依赖项中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42335718/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Intellij Error:Cannot build Artifact 'XXX:war exploded' because it is included into a circular dependency
提问by learner
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
该项目之前运行良好,但突然无法更新“目标”目录中的war文件。当我想“构建工件”时,错误显示:
Error:Cannot build Artifact 'XXX:war exploded' because it is included into a circular dependency
What is the wrong with this?
这有什么问题?
the artifacts :
文物:
回答by learner
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.
解决方法是从项目中移除“MavenDemo:war”工件和“MavenDemo:war purged”工件,并重新构建项目、重建工件。将部署工件从 MavenDemo:war 设置为 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.
我认为这个项目的问题是“MavenDemo:war”神器和“MavenDemo:war爆炸”神器重复了。所以解决方案是将它们从项目中删除。
1:
1:
2:
2:
3:
3:
4:
4:
And then, Everytime after I make some update in my code, I can click "Run" Button to deploy the updated project to Tomcat successfully.
然后,每次在我的代码中进行一些更新后,我都可以单击“运行”按钮将更新后的项目成功部署到 Tomcat。
Hope it can help somebody else ~
希望能帮到别人~
回答by Юра Чорнота
If you are using Gradle you can
如果您使用的是 Gradle,您可以
- You can delete your artifacts in Project Structure.
- Then change Groupor Versionin build file then build gradle and voilia you got new artifacts which you can use in your web-app.
- Actually, if you don't want to change its group or version you can do the same job with rename it back.
- 您可以在项目结构中删除您的工件。
- 然后在构建文件中更改组或版本,然后构建 gradle 和瞧,您将获得可以在您的网络应用程序中使用的新工件。
- 实际上,如果您不想更改其组或版本,您可以通过重命名来完成相同的工作。