Ok, so I thought the purpose of the releaseversions
parameter int the bnd-maven-baseline-plugin
was to allow it to use only release versions (instead of allowing both, release and snapshot versions).
However, when I look at the code of the plugin, it appears that snapshot versions are always skipped, even if the releaseversions
parameter is disabled:
for (ListIterator<Version> li = found.listIterator(found.size()); li.hasPrevious();) {
String highest = li.previous()
.toString();
if (toFind.setVersion(highest)
.isSnapshot()) {
continue;
}
if (onlyreleaseversions) {
MavenVersion mavenVersion = MavenVersion.parseMavenString(highest);
if (mavenVersion.compareTo(mavenVersion.toReleaseVersion()) < 0) {
logger.debug("Version {} not considered since it is not a release version", highest);
continue; // not a release version
}
}
base.setVersion(highest);
break;
}
What is the purpose of the releaseversions
parameter if not to allow using snapshots when set to false?!
Specifically, I want to baseline against a particular SNAPSHOT version like:
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-baseline-maven-plugin</artifactId>
<version>${bnd-version}</version>
<configuration>
<base>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>6.5.1-SNAPSHOT</version>
</base>
<continueOnError>false</continueOnError>
<failOnMissing>false</failOnMissing>
<fullReport>false</fullReport>
<releaseversions>false</releaseversions>
</configuration>
<executions>
<execution>
<id>baseline</id>
<goals>
<goal>baseline</goal>
</goals>
</execution>
</executions>
</plugin>
It even tells me in the debug output that the version is found, but then it is ignored:
[DEBUG] Baselining against foo:bar:jar:6.5.1-SNAPSHOT, fail on missing: false
[INFO] Determining the baseline version for foo:bar:jar:6.5.1-SNAPSHOT using repositories [...]
[DEBUG] Found versions [6.5.1-SNAPSHOT]
[INFO] The baseline version was found to be null