Skip to content

create-from-project + -Darchetype.preserveCData + multi-module + dependency is broken #983

@lalmeras

Description

@lalmeras

Affected version

3.4.1

Bug description

When a multi-module project is used with create-from-project with preserveCData, dependencies between modules are broken.

For the following hierarchy :

  • A
    • B
    • C -> B

The built archetype replace B dependency in C module with a A dependency.

From my investigation, bug originates from FilesetArchetypeCreator#createModulePoms, when artifactId/parentArtifactId properties are saved then restored while processing modules. parentArtifactId is restored with the currently processed artifactId instead of previous parentArtifactId (i.e. when B is processed, parentArtifactId is restored to B value instead of A).

The bug triggers only when preserveCData is used, surely because pom model is used instead of parentArtifactId when preserveCData is false.

I prepare a PR with an integration test and a fix proposal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions