1

my project has dependencies on some framework jars:

<groupId>my-compamy</groupId>     
<artifactId>my-project</artifactId>         
<version>1.0</version>    
<dependency> 
    <groupId>my-company</groupId> 
    <artifactId>child-jar1</artifactId> 
    <version>2.0</version>
</dependency> 

recently the framework team changed their packaging, in the repository, they put a parent pom (used to be separated child jars) like this:

<properties> 
    <reivison>2.0</revision> 
</properties>

<groupId>my-company</groupId>
<artifactId>framework-parent</artifactId>
<packaging>pom</packaging>
<version>${revision}</version>

<modules>
    <module>child-jar1</module>
</modules> 

in the child-jar1 pom:

<parent>
    <artifactId>framework-parent</artifactId>
    <groupId>my-company</groupId>
    <version>${revision}</version>  <!-- can find the value! -->
</parent> 

<artifactId>child-jar1</artifactId>
<packaging>jar</packaging>

When I build my-project, I got error message like:

... Failed to collect dependencies at my-company:child-jar1:jar:2.0.

... cuased by: could not find framework-parent:pom ${revision}

and the child-jars are not downloaded.

it looks that it is the placeholder in the child pom caused the problem: my-project could not resolve the placeholder value in the dependent(chiild-jar1)'s pom. tried multiple approaches to resolve the referenced value from my-project side but nothing worked. Can this be resolved from my-project side without altering any dependency framework's setting? Please help.

June2nd
  • 11
  • 2
  • Possible duplicate of https://stackoverflow.com/questions/10582054/maven-project-version-inheritance-do-i-have-to-specify-the-parent-version – amseager Mar 19 '19 at 19:45
  • Tell them they are doing some mistakes cause if their are really placeholders in the pom they have really messed up things. I strongly recommend them to read: https://maven.apache.org/maven-ci-friendly.html – khmarbaise Mar 21 '19 at 10:08

1 Answers1

0

There is a way to replace the palceholder with concrete value: add flatten-maven-plugin in the framework parent pom file build section (first to run) - this does not impact the framework's functionality but has to be done in the framework side. I gave this suggestion to the framework owner and they took it. It works.

Thanks to all comment providers!

June2nd
  • 11
  • 2