如何永久删除Intellij Maven项目中的模块? [英] How to remove Modules from a Intellij Maven Project permanently?

查看:3854
本文介绍了如何永久删除Intellij Maven项目中的模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正致力于在IntelliJIdea 12.1.6 Ultimate中开展更大规模的Maven项目。我大约5个月以来一直在使用IntelliJIdea。

I am currently working on a larger scale Maven-based project in IntelliJIdea 12.1.6 Ultimate. I have been working with IntelliJIdea since about 5 months.

包含的模块依赖于另一个模块。直到最近,依赖模块的源也是我项目的一部分。由于我从项目中删除了依赖模块,每当我尝试编译没有maven的源代码时,我都会遇到编译错误。

An included module has dependencies on another module. The dependent module's source was also part of my project until recently. Since I removed the dependent module from my project, I get compile errors whenever I am trying to compile the source without maven.

Intellij中删除的模块的pom.xml似乎放在Settings-> Maven-> Ignored Files上。我似乎无法从那里删除它,只检查或取消选中它。由于IntelliJ会将其保留在Ignored Files下,因此无法再次包含该模块。

The pom.xml of removed modules in Intellij seem to be placed onto the Settings->Maven->Ignored Files. I cant seem to remove it from there, only check or uncheck it. It's not possible to include the module again since IntelliJ will say its still under Ignored Files.

2种方式允许我再次编译:从Ignored files取消选中pom,这将是在我的项目中再次包含该模块。或者删除依赖模块的源,因此我的项目将从maven存储库加载依赖模块。但每当我从svn更新我的项目时,依赖模块的源都会被恢复(我不知道为什么会发生这种情况,因为它不属于我的项目)并且周期重新开始。

2 ways allow me to compile again: Uncheck the pom from Ignored files, which will include the module again in my project. Or delete the source of the dependent module, so my project will load the dependent module from the maven repository. But whenever I update my project from svn, the source of the dependent module is restored (I don't know why this even happens since its not part my project) and the cycle begins anew.

我用谷歌搜索了一段时间,因为它真的很烦人。几个被排除的模块成了问题。我可以从头开始重建intellij项目,但由于进行了很多IntelliJ设置(与问题无关),我宁愿解决这个问题。

I googled this for a while since it gets really annoying. It became a problem with several excluded modules. I could rebuild the intellij-project from scratch but since a lot of IntelliJ settings were made (not related to the problem) I would rather solve this.

任何帮助表示赞赏,我想我必须遗漏一些东西

Any help is appreciated, I guess I must be missing something

推荐答案

一位对maven有更深入了解的同事告诉我答案:

A collegue who has more in-depth knowledge of maven told me the answer:

诀窍不是从intellij项目中删除源模块,而是从maven中删除它(在intellij的maven项目选项卡中)。然后Intellij会要求从intellij项目中移除源模块,它最终消失了。

The trick is not to remove the source module from the intellij project but to remove it from maven (in the maven projects tab in intellij). Intellij will ask then to remove the source module also from the intellij project and its finally gone.

右键单击maven项目 - >删除项目

Right click on the maven project -> remove projects

不会猜到这会产生这样的差异。

Would not have guessed this makes such a difference.

这篇关于如何永久删除Intellij Maven项目中的模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆