aether

Downloading artifacts from remote maven repo programmatically

我怕爱的太早我们不能终老 提交于 2019-12-14 02:22:56
问题 I am using Aether utility library to manage deppendencies. When I try to download the transitive dependencies for a maven artifact I get a java.io.IOException: Invalid Content-Range header for partial download error. I am using almost the same code from the aether example here https://github.com/eclipse/aether-demo/blob/master/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java /** * Resolves the transitive (compile) dependencies of an artifact. *

Maven Eclipse-Aether: getLicence() method

孤者浪人 提交于 2019-12-13 05:14:27
问题 I'm developing a maven-plugin to check dependencies' licenses, similar to this one, but I can't found any API for that... what I would like to have is something like String licence = artifact.getLicence(); mrice on that license-check plugin just try to find the .pom file of that artifact, read it, and try to find the <license></license> . Do you know how can I do this? 回答1: You need to use org.apache.maven.model.License . (See api docs for details). Something like this: try { Reader reader =

aether-demo does not compile because of renaming of packages

我的梦境 提交于 2019-12-13 04:51:20
问题 I need to compile and execute the "aether-demo". I didn't find a release of the "aether-demo", so I am using the snapshot as follows: git clone git://git.eclipse.org/gitroot/aether/aether-core.git cd aether-core mvn clean install git clone git://git.eclipse.org/gitroot/aether/aether-demo.git cd aether-demo/ cd aether-demo-snippets/ mvn clean install but it fails with: [ERROR] /private/tmp/aether-demo/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual

How to externalise Maven credentials in Grails 2.4

ⅰ亾dé卋堺 提交于 2019-12-12 07:35:19
问题 I'm trying to migrate from using Ivy to using the Aether resolver in a Grails 2.4 project. The issue I am having is in relation to externalising the credentials. Info related to this can be found in the Grails manual here: http://grails.org/doc/latest/guide/conf.html#dependencyRepositories There doesn't seem to be a documented way to externalise the credentials for using Maven the way you could with Ivy. With Ivy I could place something like this into my .grails/settings.groovy file: grails

How do I find out an artifact's URI?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 01:28:13
问题 How do I use the Aether library to look up an artifact's URI? 回答1: just to complete the correct answer. you can create an artifact like this Artifact artifact = new DefaultArtifact("com.google.guava", "guava", "jar", "18.0"); 回答2: According to http://dev.eclipse.org/mhonarc/lists/aether-users/msg00127.html, you can do the following: Artifact artifact = new DefaultArtifact("com.google.guava", "guava", "jar", "18.0"); MavenDefaultLayout defaultLayout = new MavenDefaultLayout(); RemoteRepository

How do I find out the last-modified time of a Maven artifact?

限于喜欢 提交于 2019-12-08 09:50:24
问题 Each artifact uploaded to Maven Central has a last modified time associated with it. You can see an example of this by drilling into an artifact's details on search.maven.org. How do I retrieve an artifact's last modified time using Aether? I am retrieving this information purely for human consumption (i.e. "How long ago did this project make a release? Is it being actively maintained?"). 回答1: One way to retrieve this information (though not officially supported) is to construct the Artifact

How to retrieve the LATEST (also SNAPSHOT) version of a maven artifact using aether API? [duplicate]

久未见 提交于 2019-12-07 11:40:41
问题 This question already has answers here : How can you find the latest version of a maven artifact from Java using aether? (2 answers) Closed 3 years ago . I'm using eclipse.aether (version 1.0.0.v20140518) to programmatically fetch some maven artifacts from my repository. To do this I am using the following code: Artifact artifact = new DefaultArtifact( artifactName ); ArtifactRequest artifactRequest = new ArtifactRequest().setArtifact( artifact ); repositorySystem.resolveArtifact(session,

How to get local repository location from Maven 3.0 plugin?

痴心易碎 提交于 2019-12-06 23:55:22
问题 How to get local repository location (URI) from within Maven 3.x plugin? 回答1: Use Aether as described in this blog post. /** * The current repository/network configuration of Maven. * * @parameter default-value="${repositorySystemSession}" * @readonly */ private RepositorySystemSession repoSession; now get the local Repo through RepositorySystemSession.getLocalRepository(): LocalRepository localRepo = repoSession.getLocalRepository(); LocalRepository has a getBasedir() method, which is

How to use Aether (eclipse) in Maven Plugins using API 3.1.1?

橙三吉。 提交于 2019-12-06 04:07:10
I am developing a new Maven plugin using API v3.1.1 because I need to upgrade to Maven 3.1.1, and need the Aether way of dealing with artifact repositories, among other things retrieving the complete list of artifact versions. I am using Eclipse Aether (0.9.0.M4), NOT Sonatype Aether. I have already read through http://wiki.eclipse.org/Aether and tried the demos http://git.eclipse.org/c/aether/aether-demo.git/tree/ , but I have not been able to understand why the following within a subclass of AbstractMojo doesn't work. Both RepositorySystem repoSystem , RepositorySystemSession repoSession ,

How to retrieve the LATEST (also SNAPSHOT) version of a maven artifact using aether API? [duplicate]

偶尔善良 提交于 2019-12-05 16:56:37
This question already has an answer here: How can you find the latest version of a maven artifact from Java using aether? 2 answers I'm using eclipse.aether (version 1.0.0.v20140518) to programmatically fetch some maven artifacts from my repository. To do this I am using the following code: Artifact artifact = new DefaultArtifact( artifactName ); ArtifactRequest artifactRequest = new ArtifactRequest().setArtifact( artifact ); repositorySystem.resolveArtifact(session, artifactRequest); where artifactName is a String in the format "groupId:artifactId:version". When version is a fixed version