Maven submodule Parent pom with archetype

Answered

I am creating a maven project with multi maven modules as the following using one of my archetypes

GrandParent

          |-----> Parent //i want the parent here to be an external maven module

                       |-------> submodule

i want the Parent project to have its parent a pom that is not in my current project, so in my archetype i define the pom.xml of the parent project with this parent

<parent>

<groupId>com.xxx</group>
<artifactId>xxxx-artifact</artifactId>

<version>1.0</verison>

</parent>

when i create the project from the archetype with intellij it replaces the parent from archetype with a parent referencing the Grand parent project

Why dont intellij respect the archetype and why it has to replace the parent configuration with its own assumption?

0
3 comments

https://youtrack.jetbrains.com/issue/IDEA-46404 could be related. If it's not, please file a new bug at https://youtrack.jetbrains.com/issues/IDEA with a small sample project attached. Also include the exact steps to reproduce it.

0

Hello,

I found this post and have an additional question.

Is there a way that IntelliJ does not replace the parent in the pom.xml after being generated by a maven archetype?

Background of this question is that I would like to the "new" CI friendly properties of maven 3.5.0 and above. So I would like to create a parent like this:

<parent>
<groupId>my.group</groupId>
<artifactId>parent</artifactId>
<version>${revision}</version>
</parent>

So I would like to set the version to ${revision} instead of a concrete version. The ${revision} is then inherited from the parent pom.xml.

Generating such a pom.xml works without problems when invoking the project generation from the command line with "mvn archetype:generate". However if I create a module using IntelliJ, it replaces the parent tag.

0

Please sign in to leave a comment.