Skip to content

wildfly-jar:dev & wildfly-jar:dev-watch don't use reactor results in multimodule maven project #281

@dashorst

Description

@dashorst

Our project is split in several modules and:

pom.xml
modulea/
    pom.xml
moduleb/
    pom.xml
war/
    pom.xml

Module B depends on Module A, and war depends on module B.

When I want to run mvn wildfly-jar:dev-watch -pl :war -am the build fails with the error that modulea can't be found in the local repository. But that should not be happening, as the code exists in the Maven reactor and resolve locally (not in ~/.m2/repository).

mvn package does work as advertised, but mvn wildfly-jar:dev fails:

[INFO] Example Parent ............................ SUCCESS [  0.362 s]
[INFO] Modula A ......................... SUCCESS [  0.080 s]
[INFO] Module B .............................. FAILURE [  0.204 s]
[INFO] WAR .................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.209 s
[INFO] Finished at: 2021-10-28T15:15:06+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project moduleb: Could not resolve dependencies for project com.example:moduleb:jar:0-SNAPSHOT: com.example:modulea:jar:0-SNAPSHOT was not found in https://repo.example.com/artifactory/maven/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of example-repo has elapsed or updates are forced -> [Help 1]

An old article with relevant information regarding reactor local resolving of build-time dependencies can be found here: https://vzurczak.wordpress.com/2016/01/08/finding-dependencies-artifacts-in-your-maven-plug-in/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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