There's a way to list(no download) what the latest version published of an artifact?
If possible using a command or utility, I'm using Maven and Artifactory.
Thanks
I always just google the artifact name/id and "maven" to get to the artifact's page on whatever repo is hosting the artifact. From there I can see dependencies and the exact stanza I need for each of the available versions.
A tool or utility would have to be told which repo to search - a more complex invocation and less information than what google gives you.
The best thing i could suggest is to use http://search.maven.org which is the search engine for Maven Central.
Apart from that the search enginge has a REST-API which can simply be used.
Related
currently I´m working on converting a java project from ant to maven and one step to accomplish this is to find matching artifacts (via SHA1 checksum) in the nexus repository manager, see step 4 here: https://dzone.com/articles/ant-to-maven-conversion-the-painless-method
first I got all the SHA1 signatures of all jar files where I don´t know the specific version (since it´s not my own java project).
then I tried several times to use the following link to search for the artifacts by using the SHA1 checksum as my search query:
https://repository.sonatype.org/
but somehow I get no matching artifacts, no matter what I search.
can anybody help here please?
what am I doing wrong? maybe sonatype repo is not working properly any longer?
or is there any other method to search artifacts via checksum?
Search on https://search.maven.org/, which is the "official" Maven repository.
I need a tool that will help to find all artifacts that reference another artifact.
When I rebuild an artifact, I need to update/rebuild all artifacts that were using the old version. But I work in a big organisation, and nobody knows really where the artifact is spread in the organisation, so nobody is ever completely sure that everybody use the latest versions.
What I need would be a tool - maybe an artifactory plugin or feature, or a maven plugin doing a lookup in the repository - that indexes all the known poms, and is able to make a listing of all artifacts that have the updated artifact in their dependencies, either directly and transitively. Thus a list of artifacts I would need to rebuild. Quite the opposite of dependency:tree.
Filtering that list by repository, groupId, packaging, etc. is a nice to have. But I can live without.
Any idea?
You can use the Artifactory Query Language with the REST API to do that. For example, if you want to find all builds that use "MySuperAwesomeDependency-1.0.2" your AQL statement would be something like:
//Find builds that use a dependency that is a snapshot
builds.find({"module.dependency.item.name":{"$match":"MySuperAwesomeDependency-1.0.2*"}})
The key in the above statement would be the module.dependency.item.name, which allows you to search for dependencies by name, assuming you store the dependencies in Artifactory.
i have following requirement.
i need to download the latest version of artifact from custom nexus repository rather than snapshot repository.
please suggest
Thanks.
To get the latest version of any artifact, just omit the <version> tag from the dependency. This way maven will always fetch the latest version of this artifact from the remote repo.
Warning: Keep in mind that this is not the preferred way to handle dependencies nor it is the proper flow of dependency management. By keeping the version number open ended, there is a very high probability that your project may fetch a particular version of any library that is now not backward compatible and may break your functionality in the project. It is, therefore, always recommended to specify a particular version number of all artifacts that are required for any application and when updating any library version, one should properly test it.
EDIT
For maven3 you can use the facility of an open ended version tag. Something like this
<version>[1.12.4,)</version>
Take a look into this page for further details about version ranges
According to this issue: https://issues.apache.org/jira/browse/MNG-3092 snapshots cannot be excluded (at least until this is fixed).
I searched a lot in apache documentation and ibiblio.org and I could not find a decent straight answer.
My questions:
When I download a jar using maven dependency (setup in pom), how can I be sure that the file does not change on the remote repository? for example, if I'm using log4j version 1.2.3, downloaded from ibiblio.org (or any other repo for that matter), how can I be sure I'm getting the exact same jar each time?
Does maven delete jars from the local repository? let's assume I'm not clearing the repository at all, will it fill up eventually? or does maven have some kind of mechanism to clear old jars?
In Maven conventions a released version like log4j 1.2.3 will never be changed. It will be left in your locale repository until you manually delete it. It can't be changed by anyone except for the admins on maven central, but i suppose they don't do such a stupid thing.
Furthermore the download by default is done from maven central (repo1.maven.org/maven2 instead of ibiblio).
One of the "tricks" in Maven is download an artifact (released) only once...that improved your build performance in contradiction to the SNAPSHOT dependencies.
You could configure your own repository, and point all your project poms at that. It's easy to configure your poms to use a different (private) repository, but I've never set one up myself. Doesn't seem too hard, other than managing it to keep all the needed artifacts available.
How do I know what version of a Maven plugin to use?
For example, where on the horrible Maven website can I find a list of versions of the compiler plugin?
http://maven.apache.org/plugins/maven-compiler-plugin/
Here is what I do
Go to http://mvnrepository.com
Search for maven-compiler-plugin
You should find the first one is the one you need. http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin
Find the one with the latest version and use that one
The above works because maven repo also has the latest plugins. Hope this helps.
Presumably, you're looking for the issue tracker, which shows issues, versions, changelogs, etc. On just about any of the "horrible" Maven plugin pages, you'll find a link to the issue tracker on the left side under "Project Information".