Skip to content

[v9.7.0] Missing transitive dependencies in multi-module project when modules are excluded and resolved version is 0.0.0-SNAPSHOT #292

@wacker

Description

@wacker

Version: 9.7.0

Given a multi-module Maven project maven-versioning-test with parent and two modules a and b where b depends on a.

An initial git tag v0.0.0 is set on master and there are some changes in a branch, so this ref matches:

<ref type="branch">
  <describeTagPattern><![CDATA[^v(?<name>[0-9]+\.[0-9]+\.[0-9]+)$]]></describeTagPattern>
  <version>${describe.tag.name}-SNAPSHOT</version>
</ref>

and -- as expected -- results in version = 0.0.0-SNAPSHOT.

Now trying to compile the project without module a (so it should be read from the local repository).

mvn compile --projects '!a'

causes missing transitive dependencies:

[INFO] maven-versioning-test:a
[WARNING] The POM for maven-versioning-test:a:jar:0.0.0-SNAPSHOT is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

Adding -X reveals more detail:

[INFO] maven-versioning-test:a
[DEBUG] set parent version to 0.0.0-SNAPSHOT (maven-versioning-test:parent:0.0.0-SNAPSHOT)
[DEBUG] generate /home/user/.m2/repository/maven-versioning-test/a/0.0.0-SNAPSHOT/.git-versioned-pom.xml
[WARNING] The POM for maven-versioning-test:a:jar:0.0.0-SNAPSHOT is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model
[FATAL] Non-readable POM /home/user/.m2/repository/maven-versioning-test/a/0.0.0-SNAPSHOT/a-0.0.0-SNAPSHOT.pom: /home/user/.m2/repository/maven-versioning-test/a/0.0.0-SNAPSHOT/pom.xml @ 

There should be no attempt to read pom.xml from or create .git-versioned-pom.xml inside the local repository.

This behavior could not be observed in the previous version 9.6.6 and therefore is probably related to

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions