apache / apache/maven-archetype

[ARCHETYPE-552] Erroneous Inheritance Cycle Generated By Archetype Plugin

Open
#770 1 comment 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
148
Forks
181
Avg merge
1d 20h
Merged PRs (30d)
8

Description

**[Scott MacDonald](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=scanguskhan)** opened **[ARCHETYPE-552](https://issues.apache.org/jira/browse/ARCHETYPE-552?redirect=false)** and commented

When developing a multi module archetype with a root level aggregator pom which inherits from a sibling parent within the project,  the archetype generated project will incorrectly add the aggregator pom as a parent in the sibling parent pom file, causing an inheritance cycle in the generated project.

Attached is a zip file containing a minimal archetype project that demonstrates the behavior.

After running mvn install,   you can inspect target/test-classes/projects/it-basic/project/example-project/example-project-parent/pom.xml  and see that the generated project incorrectly adds the top-level aggregate pom  as a parent in the parent pom causing an inheritance cycle, even though such a parent designation is  not specified in the archetype resources.

 

The exact element that is incorrectly added to target/test-classes/projects/it-basic/project/example-project/example-project-parent/pom.xml is below..

    \
    \example-project-aggregator\
    \com.foo\
    \0.0.0\
  \

 

After the failure, removing the  incorrect parent pom element from the  target/test-classes/projects/it-basic/project/example-project/example-project-parent/pom.xml results in a working  maven project. 

 

 

---

**Affects:** 3.0.1

**Attachments:**
- [maven-archetype-parent-cycle-bug.zip](https://issues.apache.org/jira/secure/attachment/12933086/maven-archetype-parent-cycle-bug.zip) (_97.79 kB_)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.