13

When I would like to re-create a maven project with a name had been but have been deleted already, I receive the following error message:

Failed to create maven project: '.../pom.xml' already exists in VFS

Oliver Kocsis
  • 633
  • 1
  • 6
  • 12

4 Answers4

20

See Cleaning System Cache page.

  1. Open any project in IntelliJ IDEA
  2. Select "File > Invalidate Caches / Restart ..."
  3. Click on "Invalidate and Restart"

WARNING

Cleaning out the system caches, keep in mind that:

It results in clearing the local history.

To avoid losing data, check in the changes to your version control system before invalidating caches. Causes a complete rebuild of all the projects ever run in the current version of IntelliJ IDEA.

Community
  • 1
  • 1
Oliver Kocsis
  • 633
  • 1
  • 6
  • 12
4

@Oliver Kocsis note that when you're creating a new maven module, one of the wizard's screen is the below:

IntelliJ module wizard

As shown, the wizard fill the module path like C:\PersonalProjects\cabrunco-repo instead of C:\PersonalProjects\cabrunco-repo\pets.

So, you just need to add \yourModuleName to Content root.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • This answer solved my problem. Somehow, it's not very clear that you have to add the module name to the content root path....And I didn't see it. – Crenguta S Dec 18 '18 at 12:07
0

POM.xml failed to create already exists.

  1. go to your eclipse workspace path in ur pc. mine is c:/users/eclipseworkspace
  2. open
  3. double click on .project
  4. delete it.

definitely it works

again go to eclipse create a new one you will definitely get it.

zmag
  • 7,825
  • 12
  • 32
  • 42
0

I was facing the same issue and this is how i resolved it:

  1. Go to your eclipse workspace folder
  2. Find the previously created maven projects
  3. Now DELETE those projects
  4. Come back to eclipse and REFRESH it by clicking on file
  5. Now start creating new Maven project
  6. It will create successfully
git_gud
  • 649
  • 1
  • 11
  • 27