Alexander
Alexander

Reputation: 793

How to figure out parent's pom version?

I have a Maven project with child pom which specifies parent's pom version as a range like

<version>[1.0.0,1.1.0)</version>

How do I figure out which version of parent pom is actually used?

mvn dependency:tree will give the versions of dependencies, but not of the parent.

mvn help:effective-pom will give the whole resulting pom without revealing the version.

Upvotes: 2

Views: 2677

Answers (1)

Naman
Naman

Reputation: 31868

What the version ranges means is very clearly sampled in the apache documents for Version Range Specification and I am considering that is something we are aware of from Resolve Ranges Plugin whose Description reads :

Attempts to resolve dependency version ranges to the specific version being used in the build. For example a version range of "[1.0, 1.2)" would be resolved to the specific version currently in use "1.1".

'Currently in use..' here refers to the latest version of the artifact in the given range available in the repositories they are deployed and fetched from.

  • For dependencies, specifying range also ensures that while downloading the dependencies from the repositories maven would download all those specified in the range, but use the latest available for the current build.
    Just to confirm this on an IDE, you can navigate to the Implementation of the artifact and it shall take you to the effective pom that is being used in the project.
  • For parent, specifying range doesn't require their artifact downloads but I believe even with current implementation(3.3.9) Maven is not able to resolve the parent properly. It wouldn't take me to the implementation of the parent if I specify the range for the same. This bug here is for the same under progress as well.

Upvotes: 2

Related Questions