Including all versions installed to ~/.m2, and deployed to maven or an artifact repository like artifactory.
For example, if I type something like this make believe command:
mvn ver:show-all -DartifactId=myProject -DallowSnapshots=true
I hope to see some output listing available versions:
myProject ->
0.9
1.0.1
1.1-branchA-SNAPSHOT
1.1-branchB-SNAPSHOT
1.1-branchC-SNAPSHOT
Is there a maven plugin which does this today?
Last modified: 17 March 2022. An artifact is an assembly of your project assets that you put together to test, deploy, or distribute your software solution or its part.
The first place that Maven looks for artifacts is in the local repository, which is the local cache where Maven stores all of the artifacts it has downloaded or found elsewhere. The default location of the local repository is the . m2/repository/ directory under the user's home directory.
What you can do is look at Maven Repository Metadata Model. It's basically and XML file that you can download and parse. For example, to know all the versions of Google Guice available in Maven Central download repository metadata, available at https://repo1.maven.org/maven2/com/google/inject/guice/maven-metadata.xml and look at its content:
<metadata>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<versioning>
<latest>4.2.2</latest>
<release>4.2.2</release>
<versions>
<version>1.0</version>
<version>2.0</version>
<version>2.0-no_aop</version>
<version>3.0-rc2</version>
<version>3.0-rc3</version>
<version>3.0</version>
<version>4.0-beta</version>
<version>4.0-beta4</version>
<version>4.0-beta5</version>
<version>4.0</version>
<version>4.1.0</version>
<version>4.2.0</version>
<version>4.2.1</version>
<version>4.2.2</version>
</versions>
<lastUpdated>20181029173633</lastUpdated>
</versioning>
</metadata>
You'll see all the versions!
Though, it's not a 100% complete solution:
maven-metadata.xml
. E.g. if you're using JitPack or repos hosted on S3.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With