Skip to content

[MWAR-448] packaging dependencies fails with "mvn install" but not "mvn package" #515

@jira-importer

Description

@jira-importer

Kari J. Niemi opened MWAR-448 and commented

I think we discovered a minor odd difference with war-packaging between "mvn package" or "mvn install". We would expect that only difference between the two is that the latter also installs the produced stuff in the local maven repository.

 

We are packaging a few jars to a war. We have a parent pom with some modules, and that is defined as a dependency in the pom.xml that produces a war-package. Like this:

my-war-thingie:pom.xml (packaging:war)

  • dependency: some-parent

some-parent:pom.xml (packaging:pom)

  • module1 (packaging:jar)
  • module2 (packaging:jar)

Earlier we had a different structure and everything was just fine: we did not the have the child-modules but the parent-pom produced the jar. When we changed the structure to the one described above: our CI was still OK, some developers building OK as well -but some developers had failing maven builds because of missing "some-parent.jar".

 

It was bit of devastating hunt, but finally we discovered that "mvn package" was building OK, but "mvn install" looks for "some-parent.jar".

We don't actually mind if the above scenario would fail in both cases, or if it was successful - we would just expect that it works the same way for both. If this is intended behaviour, it would be nice to have it documented.

FWIW: in our case, we anyway wanted to define direct dependencies from the war-packaging to the child-modules. So actually, we are OK wih our builds already. But the difference caused so may doubts about our builds reproducibility - and also, it seems like a bug - so I wanted to be good citizen and report the problem.

Edit: further note from our troubleshooting sessions: we don't have the "type" for the dependency at all in my-war-thingie:pom.xml. Yesterday, we did experiment setting the type as "pom" -and as a consequence,  both "mvn package" and "mvn install" were successful. The default as we know, should/would be "jar". Maybe the missing dependency type is for some odd reason resolved differently for "maven package" and "maven install"?


Affects: 3.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:minorMinor loss of function, or other problem where easy workaround is present

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions