# Disabling the \`releaseversions\` parameter in the baseline plugin still does not allow snapshots?

**URL:** <https://bnd.discourse.group/t/disabling-the-releaseversions-parameter-in-the-baseline-plugin-still-does-not-allow-snapshots/428>\
**Category:** GENERAL\
**Created:** [March 14, 2024, 11:04am UTC](https://bnd.discourse.group/t/disabling-the-releaseversions-parameter-in-the-baseline-plugin-still-does-not-allow-snapshots/428 "2024-03-14T11:04:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rec](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/rec/32/155_2.png) [@rec](https://bnd.discourse.group/u/rec)\
**Post date:** [March 14, 2024, 11:04am UTC](https://bnd.discourse.group/t/disabling-the-releaseversions-parameter-in-the-baseline-plugin-still-does-not-allow-snapshots/428/1 "2024-03-14T11:04:32Z")

</div>

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:

```auto
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:

```auto
<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:

```auto
[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

```

---

<div class="post-metadata">

**Author:** ![glimmerveen](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/glimmerveen/32/47_2.png) [@glimmerveen](https://bnd.discourse.group/u/glimmerveen)\
**Post date:** [March 17, 2024, 3:58pm UTC](https://bnd.discourse.group/t/disabling-the-releaseversions-parameter-in-the-baseline-plugin-still-does-not-allow-snapshots/428/2 "2024-03-17T15:58:43Z")

</div>

Looking at the [documentation](https://github.com/bndtools/bnd/tree/7.0.0/maven-plugins/bnd-baseline-maven-plugin#configuration-properties), the `releaseversions` option is described as follows:

> When searching a version range for the baseline, only consider release versions. That is, don’t consider `alpha`, `beta`, `milestone`, or `rc` versions. `snapshot` versions are never considered when searching for the baseline.

---

<div class="post-metadata">

**Author:** ![rec](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/rec/32/155_2.png) [@rec](https://bnd.discourse.group/u/rec)\
**Post date:** [March 25, 2024, 8:41am UTC](https://bnd.discourse.group/t/disabling-the-releaseversions-parameter-in-the-baseline-plugin-still-does-not-allow-snapshots/428/3 "2024-03-25T08:41:46Z")

</div>

I see. It is a bit unfortunate though because I think it would be quite useful to be able to baseline e.g. a main branch against a maintenance branch without having to release that maintenances branch first.
