Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the actual version of the Maven project for evaluating the skip parameter #418

Open
bvo42 opened this issue Jul 11, 2024 · 0 comments
Open

Comments

@bvo42
Copy link

bvo42 commented Jul 11, 2024

... and not the version set by the "projectVersion" configuration parameter.

Use Case

We don't want a project in the dependency track for every snapshot version of a Maven project, but only one that reflects the latest development status.

Solution approach

For this I configured the Mojo as follows:

<plugin>
	<groupId>io.github.pmckeown</groupId>
	<artifactId>dependency-track-maven-plugin</artifactId>
	<executions>
		<execution>
			<id>upload-snapshot-bom</id>
			<inherited>false</inherited>
			<phase>deploy</phase>
			<goals>
				<goal>upload-bom</goal>
			</goals>
			<configuration>
				<skip>releases</skip>
				<!-- We only want one project in Dependency Track that reflects the latest development status. -->
				<projectVersion>development</projectVersion>
			</configuration>
		</execution>
		<execution>
			<id>upload-release-bom</id>
			<inherited>false</inherited>
			<phase>deploy</phase>
			<goals>
				<goal>upload-bom</goal>
			</goals>
			<configuration>
				<skip>snapshots</skip>
			</configuration>
		</execution>
	</executions>
</plugin>

Problem

For the execution upload-snapshot-bom the Mojo uses the string development to check if the project is a snapshot or a release version. Since development corresponds to the format of a release version, the plugin is prevented from running because skip=releases is set :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant