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

Show multiple newer versions for each artifact #1043

Open
maffe opened this issue Jan 30, 2024 · 0 comments
Open

Show multiple newer versions for each artifact #1043

maffe opened this issue Jan 30, 2024 · 0 comments

Comments

@maffe
Copy link

maffe commented Jan 30, 2024

Sometimes I cannot upgrade to a new major version of a dependency yet. It would be useful to have the plugin report the newest version on each version level (major/minor/patch). For example, if I include io.dropwizard:dropwizard-client:1.0.3, display-dependency-updates currently outputs

[INFO] The following dependencies in Dependencies have newer versions:
[INFO]   io.dropwizard:dropwizard-client ....................... 1.0.3 -> 4.0.6

and it should display instead:

[INFO] The following dependencies in Dependencies have newer versions:
[INFO]   io.dropwizard:dropwizard-client ......... 1.0.3 -> 1.0.9, 1.3.9, 4.0.6

(5.0.0-alpha.1 is excluded by an ignoreVersion, see my configuration below.)

With this information I can easily decide to upgrade to the latest patch, minor or major version. It is not required to list more than these three versions since it can be assumed that 2.x.y and 3.x.y versions also exist. I could simply include 2.0.0 and would see 2.0.9 and 2.1.9 in the next run.

Another case is when there is no minor or patch update. If I include jakarta.xml.bind:jakarta.xml.bind-api:3.0.1, the output currently is:

[INFO] The following dependencies in Dependencies have newer versions:
[INFO]   jakarta.xml.bind:jakarta.xml.bind-api ................. 3.0.1 -> 4.0.1

In this case the output would be the same as before, but knowing about this feature I could assume there is no 3.0.2 or 3.1.0. Or maybe the output could be modified to something like

[INFO] The following dependencies in Dependencies have newer versions:
[INFO]   jakarta.xml.bind:jakarta.xml.bind-api .......... 3.0.1 -> 3.0.1, 4.0.1

or

[INFO] The following dependencies in Dependencies have newer versions:
[INFO]   jakarta.xml.bind:jakarta.xml.bind-api ........ 3.0.1 -> [3.0.1], 4.0.1

My plugin configuration looks like this:

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>versions-maven-plugin</artifactId>
	<version>2.16.0</version>
	<executions>
		<execution>
			<phase>verify</phase>
			<goals>
				<goal>display-parent-updates</goal>
				<goal>display-plugin-updates</goal>
				<goal>display-property-updates</goal>
				<goal>display-dependency-updates</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<ruleSet>
			<ignoreVersions>
				<ignoreVersion>
					<type>regex</type>
					<version>(?i).*[.-](?:Alpha|Beta|M|RC)[.-]?[0-9]+</version>
				</ignoreVersion>
			</ignoreVersions>
		</ruleSet>
		<processDependencyManagementTransitive>false</processDependencyManagementTransitive>
	</configuration>
</plugin>
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