Fully removing Maven from project

Answered

We have migrated our project (containing 10 modules) from Maven to Gradle. (And I have to say: Woo Hoo!)  However, the .iml files for the modules still contain the following attribute in the root "module" element:

org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true"


Can this attribute be removed, safely?

There does not appear to be disturbances in the force because of its presence, but if it doesn't need to be there...

5 comments

You have to remove all maven project on Maven Tool Window. See screenshot. IDEA will offer to remove assoсiated modules, you have to select "No".



Attachment(s):
a.png
0

I tried removing all the modules as stated above. But still can see main pom file and eclipse file (as this project was initially created from eclipse) under project view.

how to fix this view?

0

@Dhruv Bansal what result do you expect to see? IDE shows pom.xml file in Project tool window because it is located under the module content root. As seen on Maven projects tool window you do not have any Maven modules configured in IDE. 

Do you want to migrate project to Gradle? Please re-create project via import project from external model action, selecting in import wizard dialog corresponding build system (Maven/Gradle/SBT) you want to use in project or if you do not want to use any build systems, just select from existing sources in import wizard.

0

@Andrey Dernov I expect when I remove any module from Project. It should be completely removed. In case of Multi maven project, if I remove parent project, I expect everything should be empty now in Project tab as it is in Maven Project tabs. The problem I see here is, if I want to use the same project and import some other module, then this pom.xml from the previous module stays here and I don't have any way to remove it. Please clarify, I am missing some basics here.

0

> I expect everything should be empty now in Project tab as it is in Maven Project tabs

Maven project tab is displayed on the right side of the screenshot and is empty, as it should. On the left you see the files content of the folder which is set up as a project content root.

>The problem I see here is, if I want to use the same project and import some other module, then this pom.xml from the previous module stays here and I don't have any way to remove it.

To remove it you must either

- select different content root directory for the existing module

- or remove this module completely in File | Project Structure | Modules. Then add new module via File | New... | Module... / Module from existing sources... action.

0

Please sign in to leave a comment.