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.
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.
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 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.
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
Right-click the module that you want to delete, and select Delete. Alternatively, you can select the module in the project view, and press Delete . A dialog box appears, confirming the deletion.
Before removing a dependency, make sure that it is not used in other modules in the project. To do so, select the necessary dependency and press Alt+F7 . You can also use the Find Usages option of the context menu. or press Alt+Delete .
A collegue who has more in-depth knowledge of maven told me the answer:
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.
Right click on the maven project -> remove projects
Would not have guessed this makes such a difference.
Do any of these two points work for you:
pom.xml
-> Maven -> ReimportPS. Idea is excellent in maintaining the project structure in accordance with Maven project. Once you make a change to your pom, you need to reload the project. Idea can also automatically detect changes made to your pom.xml
and apply them to project. To enable this, press Ctrl+Shift+A, type 'maven auto', choose "Importing", checkbox "Import Maven project automatically";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With