user5620472
user5620472

Reputation: 2882

Error when I tried create new maven module in IntellijIDE 15

I tried add new module to project in IntellijIDE 15 and I have error

Failed to create a Maven project
'C:/gitProjects/mayProj/pom.xml' already exists in VFS

And in my project create file moduleName.iml but in IDE not shows module folder and in project structure this module is shows.

Upvotes: 26

Views: 22421

Answers (4)

malvern dongeni
malvern dongeni

Reputation: 681

The problem is Intellij will be failing to create module folder for your module, so you need to specify your content-root path and module-file-location.

just copy and paste your module name to content-root and module-file-location

module-name = learn-example
content-root = xxxx/zubs/learn-example
module-file-location = xxxx/zubs/learn-example

Upvotes: 0

Đoàn Huy
Đoàn Huy

Reputation: 1

Error when I tried create new maven module in IntellijIDE on MacBook

enter image description here

Upvotes: -1

jordanpg
jordanpg

Reputation: 6516

When adding the module to an existing module that already has a POM, it is necessary to manually specify that the new module will be in a different directory. This is counter-intuitive, but I think the "Add Module" dialog was not built with maven specifically in mind.

What this means is when you are adding a module to an existing module with a POM, for example, an aggregator project, on the second page of the dialog, you need to manually copy and paste the "Module Name" onto the end of the "Content root" and "Module file locations".

enter image description here

Upvotes: 58

When you create the module manually in the context root in module file location, you must define the module name.

eg. C:\Users\Desktop\Desktop\release\1.2.1-SNAPSHOT\payment\xxx-xxx-xxx

Upvotes: 0

Related Questions