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.
Related
Key Authentication plugin is not available for GeoServer 2.15.2. I need to use this plugin and I would like to get an insight on how to use Maven to do so.
I wonder if I should download the GeoServer#2.15.2 codebase from the GitHub repository and start from that point or if I should download the war file and deploy it and start from this point. I have never used Maven before, and I would like to know if I should run the command to build the plugin authkey from a specific directory in the project directory tree.
I decided migrating geoserver to the stable version and it was the best solution.
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.
I am searching for a Maven plug-in that would help me download project artifacts. For example, I've a remote location, with the following directory structure:
Directory-A
Directory-B
artifact1.jar
artifact2.jar
Directory-C
artifact3.jar
artifact4.jar
All I want to do is when I specify Directory-A/Directory-B, it creates the structure locally and downloads all the artifacts from the remote location to the local structure.
Is that possible in Maven? The closest that I got is via maven-download-plugin, as suggested in this SO answer. However, this plugin lets me download individual artifacts (or as far as I understood from the usage documentation).
Thoughts, ideas? Any help would be really appreciated.
I'm new to Maven, but the big picture is that I need to download (in command line) the POM file of a certain artifact which is in a remote maven repository (Artifactory) using just it's artifact name and making it dynamically (by giving only the repository root path and the name of the artifact, so I can change it's location inside the repository and still download it).
My first question is: is that possible, or I have to detail the whole artifact path, groupId, artifactId and version?
Second point:
I managed to download the artifact using this maven command but it only gets the .jar, not the POM file:
mvn dependency:get -DrepoUrl=MY_REPO_LOC
-Dartifact=MY_ARTIFACT_LOC:MY_ARTIFACT_NAME:ARTIFACT_VERSION
Any idea on how can I do that?
First, you don't need maven for that. You choose a binary repository, which can give you the solution directly. Here's how:
Since you don't know the location of the artifact (I'd assume in terms of repository name? Because all the rest is pretty much locked by Maven and you do know all the path if you know the GAVC) and you don't want to list the groupId and version, you have to search and be prepared to receive multiple results, on which you'll have to imply some logic to determine which one you need.
Here's how you search in Artifactory from command line: http://wiki.jfrog.org/confluence/display/RTF/Artifactory%27s+REST+API#Artifactory%27sRESTAPI-SEARCHES
I'd recommend GAVC Search, since you know the artifactId.
If it's only the version which is unknown, and you just want to get the latest version, you can just use the latest artifact retrieval call or latest version search.
I am using Artifactory to support an enterprise multi-module project. Often, we change the names of modules and the associated dependencies in POM files are not updated to use the new module name. Because SNAPSHOT dependencies are not automatically cleaned up on a regular interval, these old module references can stay there for months. I discovered a few when I migrated Artifactory to another server and the old module dependencies resulted in build errors. I am building these SNAPSHOT artifacts nightly using Jenkins so I would like some way to automate cleaning up the SNAPSHOT artifacts.
Does Artifactory (or another artifact server such as Nexus) support a concept where if a SNAPSHOT artifact is older than X days, the artifact is deleted? Is there another way to automate artifact server cleanup to accomplish what I want to do? The only thing I can think of is to create a cron job to clear out libs-snapshot-local on a regular interval before the nightly build starts. Has someone already built this capability?
As far as I know, Artifactory doesn't have an automated way to delete modules that are older than a certain value. At my shop we've written a Groovy client that uses Artifactory's REST API to do exactly this.
Note that, if your artifacts are shared libraries, you need to be careful that nothing depends on them before you delete them. Our script takes this into account, too.
If you're interested in following up, post a comment and I'll see if it's OK to share our script with you.
Another solution might be a user plugin. You can write a simple Groovy script that will run in Artifactory itself (as opposite to remote invocation by REST Gareth proposed) on a scheduled basis, searching for artifacts not downloaded for a long time and deleting them.
I've made a Ruby script to delete artifacts which aren't download for X days. The way it works just like what JBaruch mentioned in his answer.
It isn't a plugin. It works with Artifactory Open Source. Plugin is only supported by Artifactory Pro.
The source code: https://gist.github.com/aleung/5203736