We have projects that are built one after another in the build server. They probably could become a multi-module project in the future, but at the moment there is no capacity for restructuring the repositories, projects etc. and introducing new parent POMs.
We tried to use a structure like
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.something</groupId>
<artifactId>project1</artifactId>
<version>9.0.2-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>de.something</groupId>
<artifactId>project2</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Unfortunately, the maven release plugin (more specifically, the release:prepare
goal) fails on this because it considers the dependency to be a SNAPSHOT dependency.
Is there any way (besides rebuilding everything as multi-module) to tell the maven release plugin that this is not the case?
Something like
${project.version}
is ok, don't worry"The "solution" is as follows:
<dep.version>${project.version}</dep.version>
in the POM and use it instead of ${project.version}
.${dep.version}
before the build to the next release version (and commit).${dep.version}
back to ${project.version}
.