I'm using the maven ci friendly style to set the pom version from a property. Before I get into the details of what's happening, let me tell you how my pom and project is structured.
Project structure
base-project-pom
|_ reactor-parent
|_ service
|_ service-tests
base-project-pom has a plugin called maven-enforcer-plugin which executes during validate phase.
In reactor-parent pom (pom packaging), I'm setting up version using following code -
<groupid>...</groupid>
<artifactid>...</artifactid>
<version>${revision}</version>
<properties>
<revision>0.0.1-SNAPSHOT</revision>
</properties>
I'm using same ${revision}
tag in two leaf projects i.e., service and service-test.
The problem is maven-enforcer plugin is unable to determine ${revision}
tag.
This is the error message (dropped confidential part such as url) -
Failure to find ....service:reactor-parent:pom:${revision} in http://... was cached in the local repository
com.example.service:reactor-parent:pom:${revision}
In order to get rid of this problem, I've tried following different solutions -
1. Using maven-flatten plugin -
I've tried using this plugin to flatten the pom. It didn't work. It seems to me that the issue could be related to the phase during which these two plugins (flatten and enforcer) are executed.
2. Executing enforcer during different phase
Flatten is executed during process-resources phase while enforcer is executed during validate phase. I've tried executing enforcer during verify phase and install phase. It didn't work.
3. Revision property tag in the leaf projects.
I've tried setting up property tag for revision in the leaf project. That hasn't worked either.
Any pointers or direction is appreciated.
Updated (29-May-2018) - As of today, I'm seeing that this is known bug in maven-enforcer plugin.