Dynamically Link To Latest 'jar-with-dependencies' From Maven Central - maven

I'm trying to use the Maven central API to provide dynamic download links for the latest versions of an artifact. While this works for a normal jar, I cannot seem to get it to link to the 'jar-with-dependencies' version of the artifact.
Using the com.ning:nagios artifact, the latest can be downloaded at
http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.ning&a=nagios&v=LATEST
I had assumed that I could use the l query param (based on the linked API) to specify the 'jar-with-dependencies' classifier but the link only downloads the normal jar.
http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.ning&a=nagios&v=LATEST&l=jar-with-dependencies
Is there any way to link to this version of the artifact?

It turns out the classifier parameter is 'c' for the redirecting download service, not 'l' as used in the Solr API (in that API 'c' is for 'classname') - so this will work:
https://search.maven.org/remote_content?g=com.ning&a=nagios&v=LATEST&c=jar-with-dependencies
(note, updated after Sonatype put BASIC auth on the old url - we use this new official download url on maven.org instead now)
It downloads the 1.2MB jar that includes dependencies (not the regular jar) - currently the latest version is nagios-0.0.2-jar-with-dependencies.jar.

Related

How to search for a dependency in nexus repository manager via API?

I have all the repository being listed in the nexus. I want an API which I can can use to search for a specific dependency in that nexus. For ex- If i want 'ojdbc' dependency then I should just provide the 'ojdbc' and the api should search within nexus and returns me the list of dependency which contains info like groupId, artifactId and version (and multiple if there are multiple matches).
Also, can i modify the same query to filter using user provided groupId, artifactId and version?
I came to know about the REST api offered by Nexus which can be used to search an asset and even fetch that asset.
Please go through - https://help.sonatype.com/repomanager3/rest-and-integration-api
Searching an asset or component - https://help.sonatype.com/repomanager3/rest-and-integration-api/search-api

Spring Jars to download

I am using below link for downloading spring jars.
http://repo.spring.io/release/org/springframework/spring/4.1.4.RELEASE/
I am confused with so many links.
Which link should i use to download the jar?
I am using a Windows machine and create a project directly through New Java Project.
Please refer this url http://repo.spring.io/release/org/springframework/spring/ and Choose the which version Spring Jars you want.
Choose the spring-framework-X.X.X.RELEASE-dist.zip
You should be using this link to download spring jars. Other links in there are for checksum or documentation.
Important points to understand in all the spring related repo is that it contains 3 zip files .
spring-framework-{version}-dist.zip : contains all the spring
related jars.
spring-framework-{verison}-docs.zip : contains all the standard documents in HTML format for spring and related java api documents. It is similar to Oracle API Documentation.
**Note : Inside all the folders you will find and index.html file. U can consume it typing the folder path till index.html in web browser.
spring-framework-{version}-schema.zip*: contains all the spring modules based standard xsd for xml based spring development.
I hit the same issue and I followed Brian Clozel advice above.
Create a new Maven project in eclipse.
Edit the pom.xml and add the Spring dependencies as follows -
org.springframework
spring-core
5.0.6.RELEASE
When you build the project in eclipse,it hits the maven repo and downloads the requisite spring jars for you. The indirect dependencies should also be downloaded automatically.
Hope this helps.
Step 1) Place this URL in browser
https://repo.spring.io/ui/native/release/org/springframework/spring/
Step 2) Scroll down & select latest version. Example : 5.3.9/
Step 3) Click on the file similar to "spring-5.3.9-dist.zip" to download
Step 4) Hence JAR files of latest spring is downloaded in zip format.

Grails support for new Maven Central

I was trying to pick up dependencies from the maven central repo and it looks like the URL to download the same has recently moved from repo1.maven.org to search.maven.org with a different format and as such Grails 2.2.2 isn't able to resolve it.
Do we know if this has been updated in the newer grails versions and if not is there a suggested elegant work around for this short of downloading the jars to the lib folder and renaming them?
Thanks
The URL hasn't changed, e.g. see http://repo1.maven.org/maven2/org/springframework/security/oauth/spring-security-oauth2/1.0.5.RELEASE/
What did change (months ago) is that their web-based search moved to search.maven.org. But if the URL changed or if you want another custom repo, you could easily add it to your BuildConfig.groovy using mavenRepo "http://download.java.net/maven/2/" substituting the correct URL
Note that grailsCentral() is a front-end for other repos, in addition to having a few jars there for real. Most of the resources there are passthroughs to Maven Central or other repos. It should be first in your repo list so it's accessed first, and then if something isn't there it can fall back to one of the other defined repos.

How to get artifact from maven repository without maven?

First, I am not a maven user. I need this library: https://github.com/ansell/JenaSesame but only the source code is available. The readme shows this information:
Repository
http://openjena.org/repo-dev
Group: org.openjena
Artifact: jena-sesame
But when I browse to that location I get a 404. How can I grab that artifact from that repository? I'm willing to install maven if I have to to get it; I just need the compiled library jars.
I have already searched the maven central repository at http://search.maven.org , and it is not there.
Any publicly-accessible repository should be viewable in a browser, and as such you should be able to download any JAR file contained within. The URL you've listed, openjena.org/repo-dev [1], looks more like a development repository. There are plenty of repositories around the world that are internal repositories, so this looks like one that hasn't been set up for public consumption.
It looks like they have binary releases available for download here: http://www.apache.org/dist/jena/ Have you looked there for what you're after?
[1]: Now a spam domain - visit https://jena.apache.org/ instead.

adding artefacts in Archiva not through its interface

How can I insert artefact in archiva not through its web interface.
It is possible to upload artifacts using maven.
Please refer to the Archiva Users Guide, Section Deploying to Repository for the details.
The following methods are available:
upload via the user interface (I presume this is the one you refer to as the web interface)
connect via any WebDAV client at http://localhost:8080/archiva/repository/repo-name (adjust according to your configuration)
use HTTP PUT with basic authentication to the same location as the WebDAV URL (this is the method that other tools like Maven, Ivy, etc. would use)
drop the file into the correct place in the file system and wait for Archiva's scanner to pick up the changed artefact
As Torsten's answer indicates, uploading using Maven's deploy phase or deploy:deploy-file goals (or equivalent from another build tool) is likely what you want since it will take care of constructing the correct path for the artefact and pushing any associated metadata, assuming you are using Archiva as a Maven artefact repository.
You have an upload screen tru the web ui.
See http://www.youtube.com/watch?v=LSXe26inf0Y

Resources