1

Does dependency:tree understand ${revision}?

I have a multi-module project X:

<groupId>org.X</groupId>
<artifactId>X-parent</artifactId>

<version>${revision}</version>
<properties>
    <revision>8.0.0-SNAPSHOT</revision>
</properties>

<modules>
    <module>X-A</module>
    :

It is installed to my local .m2 (and only there).

I have a project Y which depends on X-A, revision 8.0.0-SNAPSHOT

Project Y's pom also includes:

  <repositories>
        <repository>
          <id>rescarta</id>
          <url>http://software.rescarta.org/nexus/content/groups/public/</url>
        </repository>
    </repositories> 

When I run mvn dependency:tree on project Y, it complains:

$ mvn -U dependency:tree
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/3.0.1/maven-dependency-plugin-3.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/3.0.1/maven-dependency-plugin-3.0.1.pom (14 kB at 7.0 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/3.0.1/maven-dependency-plugin-3.0.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/3.0.1/maven-dependency-plugin-3.0.1.jar (164 kB at 186 kB/s)
[INFO] 
[INFO] -------------------< com.y:Y >-------------------
[INFO] Building Y 8.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from rescarta: http://software.rescarta.org/nexus/content/groups/public/org/x/X-A/8.0.0-SNAPSHOT/maven-metadata.xml
Downloading from rescarta: http://software.rescarta.org/nexus/content/groups/public/org/x/X-parent/$%7Brevision%7D/X-parent-$%7Brevision%7D.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/x/X-parent/$%7Brevision%7D/X-parent-$%7Brevision%7D.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.681 s
[INFO] Finished at: 2019-04-08T06:45:53+10:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Y: Could not resolve dependencies for project com.y:Y:jar:8.0.0-SNAPSHOT: Failed to collect dependencies at org.x:X-A:jar:8.0.0-SNAPSHOT: Failed to read artifact descriptor for org.x:X-A:jar:8.0.0-SNAPSHOT: Could not find artifact org.x:X-parent:pom:${revision} in rescarta (http://software.rescarta.org/nexus/content/groups/public/) -> [Help 1]

Notice it is trying to download org.x:X-parent:pom:${revision}, not org.x:X-parent:pom:8.0.0-SNAPSHOT

Does dependency:tree not know how to resolve ${revision}?

JasonPlutext
  • 15,352
  • 4
  • 44
  • 84

1 Answers1

1

The flatten-maven-plugin as explained at https://stackoverflow.com/a/52173650/1031689 seems to be an effective workaround.

JasonPlutext
  • 15,352
  • 4
  • 44
  • 84