You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2016/05/07 13:24:26 UTC
[01/36] maven-aether git commit: Bug 358765 - Initial contribution
continued - aether-demo
Repository: maven-aether
Updated Branches:
refs/heads/demo [created] 322fa5564
Bug 358765 - Initial contribution continued - aether-demo
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/2b0ef628
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/2b0ef628
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/2b0ef628
Branch: refs/heads/demo
Commit: 2b0ef6289553103b678a24c4e9c17f17f528ced8
Parents:
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Wed Oct 26 10:13:50 2011 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Wed Oct 26 10:13:50 2011 +0200
----------------------------------------------------------------------
.gitignore | 8 +
aether-demo-maven-plugin/pom.xml | 121 ++++++++++++++
.../src/it/resolve-artifact/pom.xml | 43 +++++
aether-demo-maven-plugin/src/it/settings.xml | 47 ++++++
.../aether/demo/maven/ResolveArtifactMojo.java | 97 +++++++++++
aether-demo-snippets/demo.jar | Bin 0 -> 345 bytes
aether-demo-snippets/pom.xml | 117 +++++++++++++
.../org/eclipse/aether/demo/AllAetherDemos.java | 32 ++++
.../eclipse/aether/demo/DeployArtifacts.java | 57 +++++++
.../aether/demo/FindAvailableVersions.java | 57 +++++++
.../eclipse/aether/demo/FindNewestVersion.java | 56 +++++++
.../eclipse/aether/demo/GetDependencyTree.java | 54 ++++++
.../aether/demo/GetDirectDependencies.java | 56 +++++++
.../eclipse/aether/demo/InstallArtifacts.java | 52 ++++++
.../eclipse/aether/demo/ResolveArtifact.java | 54 ++++++
.../demo/ResolveTransitiveDependencies.java | 67 ++++++++
.../org/eclipse/aether/demo/aether/Aether.java | 120 ++++++++++++++
.../eclipse/aether/demo/aether/AetherDemo.java | 67 ++++++++
.../aether/demo/aether/AetherResult.java | 45 +++++
.../manual/ManualRepositorySystemFactory.java | 41 +++++
.../aether/demo/manual/ManualWagonProvider.java | 39 +++++
.../plexus/PlexusRepositorySystemFactory.java | 38 +++++
.../org/eclipse/aether/demo/util/Booter.java | 53 ++++++
.../demo/util/ConsoleDependencyGraphDumper.java | 59 +++++++
.../demo/util/ConsoleRepositoryListener.java | 123 ++++++++++++++
.../demo/util/ConsoleTransferListener.java | 164 +++++++++++++++++++
pom.xml | 128 +++++++++++++++
27 files changed, 1795 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0e36d40
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+target/
+.project
+.classpath
+.settings/
+.idea
+*.iml
+*.ipr
+*.iws
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/pom.xml b/aether-demo-maven-plugin/pom.xml
new file mode 100644
index 0000000..f947c29
--- /dev/null
+++ b/aether-demo-maven-plugin/pom.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright (c) 2010, 2011 Sonatype, Inc.
+ ~ All rights reserved. This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License v1.0
+ ~ which accompanies this distribution, and is available at
+ ~ http://www.eclipse.org/legal/epl-v10.html
+ ~
+ ~ Contributors:
+ ~ Sonatype, Inc. - initial API and implementation
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-demos</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>aether-demo-maven-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+
+ <name>Aether Demo Maven Plugin</name>
+ <description>
+ A simple Maven plugin using Aether.
+ </description>
+ <inceptionYear>2010</inceptionYear>
+
+ <prerequisites>
+ <maven>3.0.4</maven>
+ </prerequisites>
+
+ <properties>
+ <mavenVersion>3.0</mavenVersion>
+ <aetherVersion>0.9.0-SNAPSHOT</aetherVersion>
+ <forgeReleaseUrl>https://repository.sonatype.org/service/local/staging/deploy/maven2</forgeReleaseUrl>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>${mavenVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-inject-plexus</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ <version>${aetherVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-util</artifactId>
+ <version>${aetherVersion}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>run-its</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>1.5</version>
+ <configuration>
+ <debug>false</debug>
+ <projectsDirectory>src/it</projectsDirectory>
+ <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ <preBuildHookScript>setup</preBuildHookScript>
+ <postBuildHookScript>verify</postBuildHookScript>
+ <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+ <settingsFile>src/it/settings.xml</settingsFile>
+ <goals>
+ <goal>clean</goal>
+ <goal>validate</goal>
+ </goals>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-maven-plugin/src/it/resolve-artifact/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/src/it/resolve-artifact/pom.xml b/aether-demo-maven-plugin/src/it/resolve-artifact/pom.xml
new file mode 100644
index 0000000..41e6721
--- /dev/null
+++ b/aether-demo-maven-plugin/src/it/resolve-artifact/pom.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright (c) 2010, 2011 Sonatype, Inc.
+ ~ All rights reserved. This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License v1.0
+ ~ which accompanies this distribution, and is available at
+ ~ http://www.eclipse.org/legal/epl-v10.html
+ ~
+ ~ Contributors:
+ ~ Sonatype, Inc. - initial API and implementation
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.aether.demo.its.ra</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>@project.artifactId@</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <id>test</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>resolve-artifact</goal>
+ </goals>
+ <configuration>
+ <artifactCoords>junit:junit:3.8.2</artifactCoords>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-maven-plugin/src/it/settings.xml
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/src/it/settings.xml b/aether-demo-maven-plugin/src/it/settings.xml
new file mode 100644
index 0000000..7150c15
--- /dev/null
+++ b/aether-demo-maven-plugin/src/it/settings.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright (c) 2010, 2011 Sonatype, Inc.
+ ~ All rights reserved. This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License v1.0
+ ~ which accompanies this distribution, and is available at
+ ~ http://www.eclipse.org/legal/epl-v10.html
+ ~
+ ~ Contributors:
+ ~ Sonatype, Inc. - initial API and implementation
+-->
+
+<settings>
+ <profiles>
+ <profile>
+ <id>it-repo</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+</settings>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/demo/maven/ResolveArtifactMojo.java
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/demo/maven/ResolveArtifactMojo.java b/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/demo/maven/ResolveArtifactMojo.java
new file mode 100644
index 0000000..c613381
--- /dev/null
+++ b/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/demo/maven/ResolveArtifactMojo.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.maven;
+
+import java.util.List;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResolutionException;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+
+/**
+ * @goal resolve-artifact
+ */
+public class ResolveArtifactMojo
+ extends AbstractMojo
+{
+
+ /**
+ * The entry point to Aether, i.e. the component doing all the work.
+ *
+ * @component
+ */
+ private RepositorySystem repoSystem;
+
+ /**
+ * The current repository/network configuration of Maven.
+ *
+ * @parameter default-value="${repositorySystemSession}"
+ * @readonly
+ */
+ private RepositorySystemSession repoSession;
+
+ /**
+ * The project's remote repositories to use for the resolution.
+ *
+ * @parameter default-value="${project.remoteProjectRepositories}"
+ * @readonly
+ */
+ private List<RemoteRepository> remoteRepos;
+
+ /**
+ * The {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>} of the artifact to resolve.
+ *
+ * @parameter expression="${aether.artifactCoords}"
+ */
+ private String artifactCoords;
+
+ public void execute()
+ throws MojoExecutionException, MojoFailureException
+ {
+ Artifact artifact;
+ try
+ {
+ artifact = new DefaultArtifact( artifactCoords );
+ }
+ catch ( IllegalArgumentException e )
+ {
+ throw new MojoFailureException( e.getMessage(), e );
+ }
+
+ ArtifactRequest request = new ArtifactRequest();
+ request.setArtifact( artifact );
+ request.setRepositories( remoteRepos );
+
+ getLog().info( "Resolving artifact " + artifact + " from " + remoteRepos );
+
+ ArtifactResult result;
+ try
+ {
+ result = repoSystem.resolveArtifact( repoSession, request );
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+
+ getLog().info( "Resolved artifact " + artifact + " to " + result.getArtifact().getFile() + " from "
+ + result.getRepository() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/demo.jar
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/demo.jar b/aether-demo-snippets/demo.jar
new file mode 100644
index 0000000..5fcb2f7
Binary files /dev/null and b/aether-demo-snippets/demo.jar differ
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
new file mode 100644
index 0000000..9eeb35e
--- /dev/null
+++ b/aether-demo-snippets/pom.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright (c) 2010, 2011 Sonatype, Inc.
+ ~ All rights reserved. This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License v1.0
+ ~ which accompanies this distribution, and is available at
+ ~ http://www.eclipse.org/legal/epl-v10.html
+ ~
+ ~ Contributors:
+ ~ Sonatype, Inc. - initial API and implementation
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-demos</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>aether-demo-snippets</artifactId>
+
+ <name>Aether Demo Snippets</name>
+ <description>
+ A module to demonstrate the usage of Aether by means of various runnable code snippets.
+ </description>
+
+ <properties>
+ <aetherVersion>0.9.0-SNAPSHOT</aetherVersion>
+ <mavenVersion>3.0.3</mavenVersion>
+ <wagonVersion>1.0</wagonVersion>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ <version>${aetherVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-spi</artifactId>
+ <version>${aetherVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-util</artifactId>
+ <version>${aetherVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-impl</artifactId>
+ <version>${aetherVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-connector-file</artifactId>
+ <version>${aetherVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-connector-wagon</artifactId>
+ <version>${aetherVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-aether-provider</artifactId>
+ <version>${mavenVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-util</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-provider-api</artifactId>
+ <version>${wagonVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http-lightweight</artifactId>
+ <version>${wagonVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http-shared</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>2.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-inject-plexus</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/AllAetherDemos.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/AllAetherDemos.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/AllAetherDemos.java
new file mode 100644
index 0000000..e9c06af
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/AllAetherDemos.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo;
+
+/**
+ * Runs all demos at once.
+ */
+public class AllAetherDemos
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ FindAvailableVersions.main( args );
+ FindNewestVersion.main( args );
+ GetDirectDependencies.main( args );
+ GetDependencyTree.main( args );
+ ResolveArtifact.main( args );
+ ResolveTransitiveDependencies.main( args );
+ InstallArtifacts.main( args );
+ DeployArtifacts.main( args );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/DeployArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/DeployArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/DeployArtifacts.java
new file mode 100644
index 0000000..a700eff
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/DeployArtifacts.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo;
+
+import java.io.File;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.demo.util.Booter;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.artifact.SubArtifact;
+
+
+/**
+ * Deploys a JAR and its POM to a remote repository.
+ */
+public class DeployArtifacts
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( DeployArtifacts.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.demo", "", "jar", "0.1-SNAPSHOT" );
+ jarArtifact = jarArtifact.setFile( new File( "org.eclipse.aether.demo.jar" ) );
+
+ Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
+ pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
+
+ RemoteRepository distRepo =
+ new RemoteRepository( "org.eclipse.aether.demo", "default", new File( "target/dist-repo" ).toURI().toString() );
+
+ DeployRequest deployRequest = new DeployRequest();
+ deployRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact );
+ deployRequest.setRepository( distRepo );
+
+ system.deploy( session, deployRequest );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindAvailableVersions.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindAvailableVersions.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindAvailableVersions.java
new file mode 100644
index 0000000..b827864
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindAvailableVersions.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo;
+
+import java.util.List;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.demo.util.Booter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.VersionRangeRequest;
+import org.eclipse.aether.resolution.VersionRangeResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.version.Version;
+
+
+/**
+ * Determines all available versions of an artifact.
+ */
+public class FindAvailableVersions
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( FindAvailableVersions.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:[0,)" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ VersionRangeRequest rangeRequest = new VersionRangeRequest();
+ rangeRequest.setArtifact( artifact );
+ rangeRequest.addRepository( repo );
+
+ VersionRangeResult rangeResult = system.resolveVersionRange( session, rangeRequest );
+
+ List<Version> versions = rangeResult.getVersions();
+
+ System.out.println( "Available versions " + versions );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindNewestVersion.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindNewestVersion.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindNewestVersion.java
new file mode 100644
index 0000000..4ca2fa0
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindNewestVersion.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.demo.util.Booter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.VersionRangeRequest;
+import org.eclipse.aether.resolution.VersionRangeResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.version.Version;
+
+
+/**
+ * Determines the newest version of an artifact.
+ */
+public class FindNewestVersion
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( FindNewestVersion.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:[0,)" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ VersionRangeRequest rangeRequest = new VersionRangeRequest();
+ rangeRequest.setArtifact( artifact );
+ rangeRequest.addRepository( repo );
+
+ VersionRangeResult rangeResult = system.resolveVersionRange( session, rangeRequest );
+
+ Version newestVersion = rangeResult.getHighestVersion();
+
+ System.out.println( "Newest version " + newestVersion + " from repository "
+ + rangeResult.getRepository( newestVersion ) );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDependencyTree.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDependencyTree.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDependencyTree.java
new file mode 100644
index 0000000..9468395
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDependencyTree.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.collection.CollectResult;
+import org.eclipse.aether.demo.util.Booter;
+import org.eclipse.aether.demo.util.ConsoleDependencyGraphDumper;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+
+
+/**
+ * Collects the transitive dependencies of an artifact.
+ */
+public class GetDependencyTree
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( GetDependencyTree.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.apache.maven:maven-aether-provider:3.0.2" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ CollectRequest collectRequest = new CollectRequest();
+ collectRequest.setRoot( new Dependency( artifact, "" ) );
+ collectRequest.addRepository( repo );
+
+ CollectResult collectResult = system.collectDependencies( session, collectRequest );
+
+ collectResult.getRoot().accept( new ConsoleDependencyGraphDumper() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDirectDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDirectDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDirectDependencies.java
new file mode 100644
index 0000000..44f9e63
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDirectDependencies.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.demo.util.Booter;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
+import org.eclipse.aether.resolution.ArtifactDescriptorResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+
+
+/**
+ * Determines the direct dependencies of an artifact as declared in its artifact descriptor (POM).
+ */
+public class GetDirectDependencies
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( GetDirectDependencies.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-impl:1.13" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
+ descriptorRequest.setArtifact( artifact );
+ descriptorRequest.addRepository( repo );
+
+ ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor( session, descriptorRequest );
+
+ for ( Dependency dependency : descriptorResult.getDependencies() )
+ {
+ System.out.println( dependency );
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/InstallArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/InstallArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/InstallArtifacts.java
new file mode 100644
index 0000000..75db100
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/InstallArtifacts.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo;
+
+import java.io.File;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.demo.util.Booter;
+import org.eclipse.aether.installation.InstallRequest;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.artifact.SubArtifact;
+
+
+/**
+ * Installs a JAR and its POM to the local repository.
+ */
+public class InstallArtifacts
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( InstallArtifacts.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.demo", "", "jar", "0.1-SNAPSHOT" );
+ jarArtifact = jarArtifact.setFile( new File( "org.eclipse.aether.demo.jar" ) );
+
+ Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
+ pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
+
+ InstallRequest installRequest = new InstallRequest();
+ installRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact );
+
+ system.install( session, installRequest );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveArtifact.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveArtifact.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveArtifact.java
new file mode 100644
index 0000000..766b6ac
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveArtifact.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.demo.util.Booter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+
+
+/**
+ * Resolves a single artifact.
+ */
+public class ResolveArtifact
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( ResolveArtifact.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:1.13" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ ArtifactRequest artifactRequest = new ArtifactRequest();
+ artifactRequest.setArtifact( artifact );
+ artifactRequest.addRepository( repo );
+
+ ArtifactResult artifactResult = system.resolveArtifact( session, artifactRequest );
+
+ artifact = artifactResult.getArtifact();
+
+ System.out.println( artifact + " resolved to " + artifact.getFile() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveTransitiveDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveTransitiveDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveTransitiveDependencies.java
new file mode 100644
index 0000000..dd3f6ce
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveTransitiveDependencies.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo;
+
+import java.util.List;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.demo.util.Booter;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.resolution.DependencyRequest;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.artifact.JavaScopes;
+import org.eclipse.aether.util.filter.DependencyFilterUtils;
+
+
+/**
+ * Resolves the transitive (compile) dependencies of an artifact.
+ */
+public class ResolveTransitiveDependencies
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( ResolveTransitiveDependencies.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-impl:1.13" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter( JavaScopes.COMPILE );
+
+ CollectRequest collectRequest = new CollectRequest();
+ collectRequest.setRoot( new Dependency( artifact, JavaScopes.COMPILE ) );
+ collectRequest.addRepository( repo );
+
+ DependencyRequest dependencyRequest = new DependencyRequest( collectRequest, classpathFlter );
+
+ List<ArtifactResult> artifactResults =
+ system.resolveDependencies( session, dependencyRequest ).getArtifactResults();
+
+ for ( ArtifactResult artifactResult : artifactResults )
+ {
+ System.out.println( artifactResult.getArtifact() + " resolved to " + artifactResult.getArtifact().getFile() );
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/Aether.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/Aether.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/Aether.java
new file mode 100644
index 0000000..274d41f
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/Aether.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.aether;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.demo.util.Booter;
+import org.eclipse.aether.demo.util.ConsoleDependencyGraphDumper;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.installation.InstallRequest;
+import org.eclipse.aether.installation.InstallationException;
+import org.eclipse.aether.repository.Authentication;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.DependencyRequest;
+import org.eclipse.aether.resolution.DependencyResolutionException;
+import org.eclipse.aether.util.DefaultRepositorySystemSession;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.graph.PreorderNodeListGenerator;
+
+
+public class Aether
+{
+ private String remoteRepository;
+
+ private RepositorySystem repositorySystem;
+
+ private LocalRepository localRepository;
+
+ public Aether( String remoteRepository, String localRepository )
+ {
+ this.remoteRepository = remoteRepository;
+ this.repositorySystem = Booter.newRepositorySystem();
+ this.localRepository = new LocalRepository( localRepository );
+ }
+
+ private RepositorySystemSession newSession()
+ {
+ DefaultRepositorySystemSession session = Booter.newRepositorySystemSession( repositorySystem );
+ session.setLocalRepositoryManager( repositorySystem.newLocalRepositoryManager( localRepository ) );
+ return session;
+ }
+
+ public AetherResult resolve( String groupId, String artifactId, String version )
+ throws DependencyResolutionException
+ {
+ RepositorySystemSession session = newSession();
+ Dependency dependency =
+ new Dependency( new DefaultArtifact( groupId, artifactId, "", "jar", version ), "runtime" );
+ RemoteRepository central = new RemoteRepository( "central", "default", remoteRepository );
+
+ CollectRequest collectRequest = new CollectRequest();
+ collectRequest.setRoot( dependency );
+ collectRequest.addRepository( central );
+
+ DependencyRequest dependencyRequest = new DependencyRequest();
+ dependencyRequest.setCollectRequest( collectRequest );
+
+ DependencyNode rootNode = repositorySystem.resolveDependencies( session, dependencyRequest ).getRoot();
+
+ StringBuilder dump = new StringBuilder();
+ displayTree( rootNode, dump );
+
+ PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
+ rootNode.accept( nlg );
+
+ return new AetherResult( rootNode, nlg.getFiles(), nlg.getClassPath() );
+ }
+
+ public void install( Artifact artifact, Artifact pom )
+ throws InstallationException
+ {
+ RepositorySystemSession session = newSession();
+
+ InstallRequest installRequest = new InstallRequest();
+ installRequest.addArtifact( artifact ).addArtifact( pom );
+
+ repositorySystem.install( session, installRequest );
+ }
+
+ public void deploy( Artifact artifact, Artifact pom, String remoteRepository )
+ throws DeploymentException
+ {
+ RepositorySystemSession session = newSession();
+
+ RemoteRepository nexus = new RemoteRepository( "nexus", "default", remoteRepository );
+ Authentication authentication = new Authentication( "admin", "admin123" );
+ nexus.setAuthentication( authentication );
+
+ DeployRequest deployRequest = new DeployRequest();
+ deployRequest.addArtifact( artifact ).addArtifact( pom );
+ deployRequest.setRepository( nexus );
+
+ repositorySystem.deploy( session, deployRequest );
+ }
+
+ private void displayTree( DependencyNode node, StringBuilder sb )
+ {
+ ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 );
+ node.accept( new ConsoleDependencyGraphDumper( new PrintStream( os ) ) );
+ sb.append( os.toString() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherDemo.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherDemo.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherDemo.java
new file mode 100644
index 0000000..8d21429
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherDemo.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.aether;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.installation.InstallationException;
+import org.eclipse.aether.resolution.DependencyResolutionException;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.artifact.SubArtifact;
+
+@SuppressWarnings( "unused" )
+public class AetherDemo
+{
+
+ public void resolve()
+ throws DependencyResolutionException
+ {
+ Aether aether = new Aether( "http://localhost:8081/nexus/content/groups/public", "/Users/jvanzyl/aether-repo" );
+
+ AetherResult result = aether.resolve( "com.mycompany.app", "super-app", "1.0" );
+
+ // Get the root of the resolved tree of artifacts
+ //
+ DependencyNode root = result.getRoot();
+
+ // Get the list of files for the artifacts resolved
+ //
+ List<File> artifacts = result.getResolvedFiles();
+
+ // Get the classpath of the artifacts resolved
+ //
+ String classpath = result.getResolvedClassPath();
+ }
+
+ public void installAndDeploy()
+ throws InstallationException, DeploymentException
+ {
+ Aether aether = new Aether( "http://localhost:8081/nexus/content/groups/public", "/Users/jvanzyl/aether-repo" );
+
+ Artifact artifact = new DefaultArtifact( "com.mycompany.super", "super-core", "jar", "0.1-SNAPSHOT" );
+ artifact = artifact.setFile( new File( "jar-from-whatever-process.jar" ) );
+ Artifact pom = new SubArtifact( artifact, null, "pom" );
+ pom = pom.setFile( new File( "pom-from-whatever-process.xml" ) );
+
+ // Install into the local repository specified
+ //
+ aether.install( artifact, pom );
+
+ // Deploy to a remote reposistory
+ //
+ aether.deploy( artifact, pom, "http://localhost:8081/nexus/content/repositories/snapshots/" );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherResult.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherResult.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherResult.java
new file mode 100644
index 0000000..cf2b449
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherResult.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.aether;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.aether.graph.DependencyNode;
+
+public class AetherResult
+{
+ private DependencyNode root;
+ private List<File> resolvedFiles;
+ private String resolvedClassPath;
+
+ public AetherResult( DependencyNode root, List<File> resolvedFiles, String resolvedClassPath )
+ {
+ this.root = root;
+ this.resolvedFiles = resolvedFiles;
+ this.resolvedClassPath = resolvedClassPath;
+ }
+
+ public DependencyNode getRoot()
+ {
+ return root;
+ }
+
+ public List<File> getResolvedFiles()
+ {
+ return resolvedFiles;
+ }
+
+ public String getResolvedClassPath()
+ {
+ return resolvedClassPath;
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualRepositorySystemFactory.java
new file mode 100644
index 0000000..11aa788
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualRepositorySystemFactory.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.manual;
+
+import org.apache.maven.repository.internal.DefaultServiceLocator;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.connector.file.FileRepositoryConnectorFactory;
+import org.eclipse.aether.connector.wagon.WagonProvider;
+import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
+import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
+
+/**
+ * A factory for repository system instances that employs Aether's built-in service locator infrastructure to wire up
+ * the system's components.
+ */
+public class ManualRepositorySystemFactory
+{
+
+ public static RepositorySystem newRepositorySystem()
+ {
+ /*
+ * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
+ * prepopulated DefaultServiceLocator, we only need to register the repository connector factories.
+ */
+ DefaultServiceLocator locator = new DefaultServiceLocator();
+ locator.addService( RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class );
+ locator.addService( RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class );
+ locator.setServices( WagonProvider.class, new ManualWagonProvider() );
+
+ return locator.getService( RepositorySystem.class );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
new file mode 100644
index 0000000..af75da0
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.manual;
+
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.providers.http.LightweightHttpWagon;
+import org.eclipse.aether.connector.wagon.WagonProvider;
+
+/**
+ * A simplistic provider for wagon instances when no Plexus-compatible IoC container is used.
+ */
+public class ManualWagonProvider
+ implements WagonProvider
+{
+
+ public Wagon lookup( String roleHint )
+ throws Exception
+ {
+ if ( "http".equals( roleHint ) )
+ {
+ return new LightweightHttpWagon();
+ }
+ return null;
+ }
+
+ public void release( Wagon wagon )
+ {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/plexus/PlexusRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/plexus/PlexusRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/plexus/PlexusRepositorySystemFactory.java
new file mode 100644
index 0000000..8d3f41e
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/plexus/PlexusRepositorySystemFactory.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.plexus;
+
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.eclipse.aether.RepositorySystem;
+
+/**
+ * A factory for repository system instances that employs Plexus to wire up the system's components.
+ */
+public class PlexusRepositorySystemFactory
+{
+
+ public static RepositorySystem newRepositorySystem()
+ {
+ /*
+ * Aether's components are equipped with plexus-specific metadata to enable discovery and wiring of components
+ * by a Plexus container so this is as easy as looking up the implementation.
+ */
+ try
+ {
+ return new DefaultPlexusContainer().lookup( RepositorySystem.class );
+ }
+ catch ( Exception e )
+ {
+ throw new IllegalStateException( "dependency injection failed", e );
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/Booter.java
new file mode 100644
index 0000000..8be5593
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/Booter.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.util;
+
+import org.apache.maven.repository.internal.MavenRepositorySystemSession;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.demo.manual.ManualRepositorySystemFactory;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.DefaultRepositorySystemSession;
+
+
+/**
+ * A helper to boot the repository system and a repository system session.
+ */
+public class Booter
+{
+
+ public static RepositorySystem newRepositorySystem()
+ {
+ return ManualRepositorySystemFactory.newRepositorySystem();
+ }
+
+ public static DefaultRepositorySystemSession newRepositorySystemSession( RepositorySystem system )
+ {
+ MavenRepositorySystemSession session = new MavenRepositorySystemSession();
+
+ LocalRepository localRepo = new LocalRepository( "target/local-repo" );
+ session.setLocalRepositoryManager( system.newLocalRepositoryManager( localRepo ) );
+
+ session.setTransferListener( new ConsoleTransferListener() );
+ session.setRepositoryListener( new ConsoleRepositoryListener() );
+
+ // uncomment to generate dirty trees
+ // session.setDependencyGraphTransformer( null );
+
+ return session;
+ }
+
+ public static RemoteRepository newCentralRepository()
+ {
+ return new RemoteRepository( "central", "default", "http://repo1.maven.org/maven2/" );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleDependencyGraphDumper.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleDependencyGraphDumper.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleDependencyGraphDumper.java
new file mode 100644
index 0000000..960eeda
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleDependencyGraphDumper.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.util;
+
+import java.io.PrintStream;
+
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.graph.DependencyVisitor;
+
+/**
+ * A dependency visitor that dumps the graph to the console.
+ */
+public class ConsoleDependencyGraphDumper
+ implements DependencyVisitor
+{
+
+ private PrintStream out;
+
+ private String currentIndent = "";
+
+ public ConsoleDependencyGraphDumper()
+ {
+ this( null );
+ }
+
+ public ConsoleDependencyGraphDumper( PrintStream out )
+ {
+ this.out = ( out != null ) ? out : System.out;
+ }
+
+ public boolean visitEnter( DependencyNode node )
+ {
+ out.println( currentIndent + node );
+ if ( currentIndent.length() <= 0 )
+ {
+ currentIndent = "+- ";
+ }
+ else
+ {
+ currentIndent = "| " + currentIndent;
+ }
+ return true;
+ }
+
+ public boolean visitLeave( DependencyNode node )
+ {
+ currentIndent = currentIndent.substring( 3, currentIndent.length() );
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleRepositoryListener.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleRepositoryListener.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleRepositoryListener.java
new file mode 100644
index 0000000..3bf0cb5
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleRepositoryListener.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.util;
+
+import java.io.PrintStream;
+
+import org.eclipse.aether.AbstractRepositoryListener;
+import org.eclipse.aether.RepositoryEvent;
+
+/**
+ * A simplistic repository listener that logs events to the console.
+ */
+public class ConsoleRepositoryListener
+ extends AbstractRepositoryListener
+{
+
+ private PrintStream out;
+
+ public ConsoleRepositoryListener()
+ {
+ this( null );
+ }
+
+ public ConsoleRepositoryListener( PrintStream out )
+ {
+ this.out = ( out != null ) ? out : System.out;
+ }
+
+ public void artifactDeployed( RepositoryEvent event )
+ {
+ out.println( "Deployed " + event.getArtifact() + " to " + event.getRepository() );
+ }
+
+ public void artifactDeploying( RepositoryEvent event )
+ {
+ out.println( "Deploying " + event.getArtifact() + " to " + event.getRepository() );
+ }
+
+ public void artifactDescriptorInvalid( RepositoryEvent event )
+ {
+ out.println( "Invalid artifact descriptor for " + event.getArtifact() + ": "
+ + event.getException().getMessage() );
+ }
+
+ public void artifactDescriptorMissing( RepositoryEvent event )
+ {
+ out.println( "Missing artifact descriptor for " + event.getArtifact() );
+ }
+
+ public void artifactInstalled( RepositoryEvent event )
+ {
+ out.println( "Installed " + event.getArtifact() + " to " + event.getFile() );
+ }
+
+ public void artifactInstalling( RepositoryEvent event )
+ {
+ out.println( "Installing " + event.getArtifact() + " to " + event.getFile() );
+ }
+
+ public void artifactResolved( RepositoryEvent event )
+ {
+ out.println( "Resolved artifact " + event.getArtifact() + " from " + event.getRepository() );
+ }
+
+ public void artifactDownloading( RepositoryEvent event )
+ {
+ out.println( "Downloading artifact " + event.getArtifact() + " from " + event.getRepository() );
+ }
+
+ public void artifactDownloaded( RepositoryEvent event )
+ {
+ out.println( "Downloaded artifact " + event.getArtifact() + " from " + event.getRepository() );
+ }
+
+ public void artifactResolving( RepositoryEvent event )
+ {
+ out.println( "Resolving artifact " + event.getArtifact() );
+ }
+
+ public void metadataDeployed( RepositoryEvent event )
+ {
+ out.println( "Deployed " + event.getMetadata() + " to " + event.getRepository() );
+ }
+
+ public void metadataDeploying( RepositoryEvent event )
+ {
+ out.println( "Deploying " + event.getMetadata() + " to " + event.getRepository() );
+ }
+
+ public void metadataInstalled( RepositoryEvent event )
+ {
+ out.println( "Installed " + event.getMetadata() + " to " + event.getFile() );
+ }
+
+ public void metadataInstalling( RepositoryEvent event )
+ {
+ out.println( "Installing " + event.getMetadata() + " to " + event.getFile() );
+ }
+
+ public void metadataInvalid( RepositoryEvent event )
+ {
+ out.println( "Invalid metadata " + event.getMetadata() );
+ }
+
+ public void metadataResolved( RepositoryEvent event )
+ {
+ out.println( "Resolved metadata " + event.getMetadata() + " from " + event.getRepository() );
+ }
+
+ public void metadataResolving( RepositoryEvent event )
+ {
+ out.println( "Resolving metadata " + event.getMetadata() + " from " + event.getRepository() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleTransferListener.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleTransferListener.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleTransferListener.java
new file mode 100644
index 0000000..04be132
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleTransferListener.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.demo.util;
+
+import java.io.PrintStream;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.eclipse.aether.transfer.AbstractTransferListener;
+import org.eclipse.aether.transfer.TransferEvent;
+import org.eclipse.aether.transfer.TransferResource;
+
+/**
+ * A simplistic transfer listener that logs uploads/downloads to the console.
+ */
+public class ConsoleTransferListener
+ extends AbstractTransferListener
+{
+
+ private PrintStream out;
+
+ private Map<TransferResource, Long> downloads = new ConcurrentHashMap<TransferResource, Long>();
+
+ private int lastLength;
+
+ public ConsoleTransferListener()
+ {
+ this( null );
+ }
+
+ public ConsoleTransferListener( PrintStream out )
+ {
+ this.out = ( out != null ) ? out : System.out;
+ }
+
+ @Override
+ public void transferInitiated( TransferEvent event )
+ {
+ String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
+
+ out.println( message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
+ }
+
+ @Override
+ public void transferProgressed( TransferEvent event )
+ {
+ TransferResource resource = event.getResource();
+ downloads.put( resource, Long.valueOf( event.getTransferredBytes() ) );
+
+ StringBuilder buffer = new StringBuilder( 64 );
+
+ for ( Map.Entry<TransferResource, Long> entry : downloads.entrySet() )
+ {
+ long total = entry.getKey().getContentLength();
+ long complete = entry.getValue().longValue();
+
+ buffer.append( getStatus( complete, total ) ).append( " " );
+ }
+
+ int pad = lastLength - buffer.length();
+ lastLength = buffer.length();
+ pad( buffer, pad );
+ buffer.append( '\r' );
+
+ out.print( buffer );
+ }
+
+ private String getStatus( long complete, long total )
+ {
+ if ( total >= 1024 )
+ {
+ return toKB( complete ) + "/" + toKB( total ) + " KB ";
+ }
+ else if ( total >= 0 )
+ {
+ return complete + "/" + total + " B ";
+ }
+ else if ( complete >= 1024 )
+ {
+ return toKB( complete ) + " KB ";
+ }
+ else
+ {
+ return complete + " B ";
+ }
+ }
+
+ private void pad( StringBuilder buffer, int spaces )
+ {
+ String block = " ";
+ while ( spaces > 0 )
+ {
+ int n = Math.min( spaces, block.length() );
+ buffer.append( block, 0, n );
+ spaces -= n;
+ }
+ }
+
+ @Override
+ public void transferSucceeded( TransferEvent event )
+ {
+ transferCompleted( event );
+
+ TransferResource resource = event.getResource();
+ long contentLength = event.getTransferredBytes();
+ if ( contentLength >= 0 )
+ {
+ String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
+ String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B";
+
+ String throughput = "";
+ long duration = System.currentTimeMillis() - resource.getTransferStartTime();
+ if ( duration > 0 )
+ {
+ DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) );
+ double kbPerSec = ( contentLength / 1024.0 ) / ( duration / 1000.0 );
+ throughput = " at " + format.format( kbPerSec ) + " KB/sec";
+ }
+
+ out.println( type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
+ + throughput + ")" );
+ }
+ }
+
+ @Override
+ public void transferFailed( TransferEvent event )
+ {
+ transferCompleted( event );
+
+ event.getException().printStackTrace( out );
+ }
+
+ private void transferCompleted( TransferEvent event )
+ {
+ downloads.remove( event.getResource() );
+
+ StringBuilder buffer = new StringBuilder( 64 );
+ pad( buffer, lastLength );
+ buffer.append( '\r' );
+ out.print( buffer );
+ }
+
+ public void transferCorrupted( TransferEvent event )
+ {
+ event.getException().printStackTrace( out );
+ }
+
+ protected long toKB( long bytes )
+ {
+ return ( bytes + 1023 ) / 1024;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/2b0ef628/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..8e320e5
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright (c) 2010, 2011 Sonatype, Inc.
+ ~ All rights reserved. This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License v1.0
+ ~ which accompanies this distribution, and is available at
+ ~ http://www.eclipse.org/legal/epl-v10.html
+ ~
+ ~ Contributors:
+ ~ Sonatype, Inc. - initial API and implementation
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.sonatype.forge</groupId>
+ <artifactId>forge-parent</artifactId>
+ <version>10</version>
+ </parent>
+
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-demos</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Aether Demos</name>
+ <description>
+ The parent for the Aether demos.
+ </description>
+ <url>http://www.eclipse.org/aether/</url>
+ <inceptionYear>2010</inceptionYear>
+
+ <organization>
+ <name>The Eclipse Foundation</name>
+ <url>http://www.eclipse.org/</url>
+ </organization>
+
+ <mailingLists>
+ <mailingList>
+ <name>Aether Developer List</name>
+ <subscribe>https://dev.eclipse.org/mailman/listinfo/aether-dev</subscribe>
+ <unsubscribe>https://dev.eclipse.org/mailman/listinfo/aether-dev</unsubscribe>
+ <post>aether-dev@eclipse.org</post>
+ <archive>http://dev.eclipse.org/mhonarc/lists/aether-dev/</archive>
+ </mailingList>
+ <mailingList>
+ <name>Aether User List</name>
+ <subscribe>https://dev.eclipse.org/mailman/listinfo/aether-users</subscribe>
+ <unsubscribe>https://dev.eclipse.org/mailman/listinfo/aether-users</unsubscribe>
+ <post>aether-users@eclipse.org</post>
+ <archive>http://dev.eclipse.org/mhonarc/lists/aether-users/</archive>
+ </mailingList>
+ </mailingLists>
+
+ <scm>
+ <connection>scm:git:git://git.eclipse.org/gitroot/aether/aether-demo.git</connection>
+ <developerConnection>scm:git:ssh://git.eclipse.org/gitroot/aether/aether-demo.git</developerConnection>
+ <url>http://git.eclipse.org/c/aether/aether-demo.git/</url>
+ </scm>
+
+ <issueManagement>
+ <system>bugzilla</system>
+ <url>https://bugs.eclipse.org/bugs/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=Aether</url>
+ </issueManagement>
+
+ <licenses>
+ <license>
+ <name>Eclipse Public License, Version 1.0</name>
+ <url>http://www.eclipse.org/legal/epl-v10.html</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <properties>
+ <surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <!-- the child modules are just source code demos and not to be shared as artifacts -->
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.9</version>
+ <configuration>
+ <argLine>-Xmx128m</argLine>
+ <redirectTestOutputToFile>${surefire.redirectTestOutputToFile}</redirectTestOutputToFile>
+ <systemPropertyVariables>
+ <java.io.tmpdir>${project.build.directory}/surefire-tmp</java.io.tmpdir>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-maven-plugin</artifactId>
+ <version>1.7</version>
+ <configuration>
+ <signature>
+ <groupId>org.codehaus.mojo.signature</groupId>
+ <artifactId>java15</artifactId>
+ <version>1.0</version>
+ </signature>
+ </configuration>
+ <executions>
+ <execution>
+ <id>check-java-1.5-compat</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
[08/36] maven-aether git commit: Fixed PlexusRepositorySystemFactory
to properly configure underlying Guice injector now that aether-core has
JSR-330 annos
Posted by hb...@apache.org.
Fixed PlexusRepositorySystemFactory to properly configure underlying Guice injector now that aether-core has JSR-330 annos
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/e78739f4
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/e78739f4
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/e78739f4
Branch: refs/heads/demo
Commit: e78739f442082c84429de7633cb8103eecc3998c
Parents: 9322458
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Feb 5 18:06:45 2012 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Feb 5 18:06:45 2012 +0100
----------------------------------------------------------------------
.../aether/examples/plexus/PlexusRepositorySystemFactory.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e78739f4/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
index fbed875..7f8fd6e 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.aether.examples.plexus;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.DefaultContainerConfiguration;
import org.codehaus.plexus.DefaultPlexusContainer;
import org.eclipse.aether.RepositorySystem;
@@ -27,7 +29,8 @@ public class PlexusRepositorySystemFactory
*/
try
{
- return new DefaultPlexusContainer().lookup( RepositorySystem.class );
+ ContainerConfiguration config = new DefaultContainerConfiguration().setAutoWiring( true );
+ return new DefaultPlexusContainer( config ).lookup( RepositorySystem.class );
}
catch ( Exception e )
{
[11/36] maven-aether git commit: Accounted for refactoring of
AuthenticationBuilder and RemoteRepository in aether-api
Posted by hb...@apache.org.
Accounted for refactoring of AuthenticationBuilder and RemoteRepository in aether-api
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/52f81d29
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/52f81d29
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/52f81d29
Branch: refs/heads/demo
Commit: 52f81d2904801458f9ce317f16f4f71d585838a8
Parents: 40100e3
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Sep 30 17:24:21 2012 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Sep 30 17:28:08 2012 +0200
----------------------------------------------------------------------
.../java/org/eclipse/aether/examples/DeployArtifacts.java | 4 ++--
.../main/java/org/eclipse/aether/examples/aether/Aether.java | 8 ++++----
.../main/java/org/eclipse/aether/examples/util/Booter.java | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/52f81d29/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
index 5fdefd2..b8757bb 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
@@ -44,8 +44,8 @@ public class DeployArtifacts
pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
RemoteRepository distRepo =
- new RemoteRepository( "org.eclipse.aether.examples", "default",
- new File( "target/dist-repo" ).toURI().toString() );
+ new RemoteRepository.Builder( "org.eclipse.aether.examples", "default",
+ new File( "target/dist-repo" ).toURI().toString() ).build();
DeployRequest deployRequest = new DeployRequest();
deployRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/52f81d29/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
index c1f3f4f..6aee749 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
@@ -63,7 +63,7 @@ public class Aether
RepositorySystemSession session = newSession();
Dependency dependency =
new Dependency( new DefaultArtifact( groupId, artifactId, "", "jar", version ), "runtime" );
- RemoteRepository central = new RemoteRepository( "central", "default", remoteRepository );
+ RemoteRepository central = new RemoteRepository.Builder( "central", "default", remoteRepository ).build();
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot( dependency );
@@ -99,9 +99,9 @@ public class Aether
{
RepositorySystemSession session = newSession();
- RemoteRepository nexus = new RemoteRepository( "nexus", "default", remoteRepository );
- Authentication authentication = new AuthenticationBuilder().username( "admin" ).password( "admin123" ).build();
- nexus.setAuthentication( authentication );
+ Authentication auth = new AuthenticationBuilder().addUsername( "admin" ).addPassword( "admin123" ).build();
+ RemoteRepository nexus =
+ new RemoteRepository.Builder( "nexus", "default", remoteRepository ).setAuthentication( auth ).build();
DeployRequest deployRequest = new DeployRequest();
deployRequest.addArtifact( artifact ).addArtifact( pom );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/52f81d29/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
index 412bfab..bd0171a 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
@@ -46,7 +46,7 @@ public class Booter
public static RemoteRepository newCentralRepository()
{
- return new RemoteRepository( "central", "default", "http://repo1.maven.org/maven2/" );
+ return new RemoteRepository.Builder( "central", "default", "http://repo1.maven.org/maven2/" ).build();
}
}
[31/36] maven-aether git commit: Demonstrated how to boot the repo
system using Sisu
Posted by hb...@apache.org.
Demonstrated how to boot the repo system using Sisu
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/d8e8ae8c
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/d8e8ae8c
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/d8e8ae8c
Branch: refs/heads/demo
Commit: d8e8ae8cbb3b9ee54f541504303e08fa1a8e003a
Parents: 1468633
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Jan 26 16:57:14 2014 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Jan 26 16:57:14 2014 +0100
----------------------------------------------------------------------
.../sisu/SisuRepositorySystemFactory.java | 62 ++++++++++++++++++++
.../eclipse/aether/examples/util/Booter.java | 3 +-
2 files changed, 64 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/d8e8ae8c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/sisu/SisuRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/sisu/SisuRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/sisu/SisuRepositorySystemFactory.java
new file mode 100644
index 0000000..379261a
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/sisu/SisuRepositorySystemFactory.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.sisu;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+
+import org.apache.maven.model.building.DefaultModelBuilderFactory;
+import org.apache.maven.model.building.ModelBuilder;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.sisu.launch.Main;
+import org.slf4j.ILoggerFactory;
+
+/**
+ * A factory for repository system instances that employs Eclipse Sisu to wire up the system's components.
+ */
+@Named
+public class SisuRepositorySystemFactory
+{
+
+ @Inject
+ private RepositorySystem repositorySystem;
+
+ public static RepositorySystem newRepositorySystem()
+ {
+ return Main.boot( SisuRepositorySystemFactory.class ).repositorySystem;
+ }
+
+ @Named
+ private static class ModelBuilderProvider
+ implements Provider<ModelBuilder>
+ {
+
+ public ModelBuilder get()
+ {
+ return new DefaultModelBuilderFactory().newInstance();
+ }
+
+ }
+
+ @Named
+ private static class LoggerFactoryProvider
+ implements Provider<ILoggerFactory>
+ {
+
+ public ILoggerFactory get()
+ {
+ return org.slf4j.LoggerFactory.getILoggerFactory();
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/d8e8ae8c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
index 7ea82d5..e5e50b8 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Sonatype, Inc.
+ * Copyright (c) 2010, 2014 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,6 +31,7 @@ public class Booter
{
return org.eclipse.aether.examples.manual.ManualRepositorySystemFactory.newRepositorySystem();
// return org.eclipse.aether.examples.guice.GuiceRepositorySystemFactory.newRepositorySystem();
+ // return org.eclipse.aether.examples.sisu.SisuRepositorySystemFactory.newRepositorySystem();
// return org.eclipse.aether.examples.plexus.PlexusRepositorySystemFactory.newRepositorySystem();
}
[09/36] maven-aether git commit: Fixed import after package rename in
aether-util
Posted by hb...@apache.org.
Fixed import after package rename in aether-util
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/119d55c6
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/119d55c6
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/119d55c6
Branch: refs/heads/demo
Commit: 119d55c6edda0b2016b94ee3f9231bcebd075ff7
Parents: e78739f
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Mar 10 17:31:02 2012 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Mar 10 17:31:02 2012 +0100
----------------------------------------------------------------------
.../src/main/java/org/eclipse/aether/examples/aether/Aether.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/119d55c6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
index fd647bf..901ad9f 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
@@ -32,7 +32,7 @@ import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.DependencyRequest;
import org.eclipse.aether.resolution.DependencyResolutionException;
-import org.eclipse.aether.util.graph.PreorderNodeListGenerator;
+import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator;
public class Aether
{
[30/36] maven-aether git commit: Updated to sisu:0.1.1
Posted by hb...@apache.org.
Updated to sisu:0.1.1
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/14686333
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/14686333
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/14686333
Branch: refs/heads/demo
Commit: 146863337fc5ee6a47b659c651b866c0be3984e1
Parents: 8a40c2a
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Jan 26 16:51:27 2014 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Jan 26 16:51:27 2014 +0100
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/14686333/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 5ba8fa0..4585a9f 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -91,23 +91,19 @@
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
- <version>0.0.0.M3</version>
+ <version>0.1.1</version>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</exclusion>
- <exclusion>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-guice</artifactId>
- <version>3.1.0</version>
+ <version>3.1.6</version>
<classifier>no_aop</classifier>
<optional>true</optional>
<exclusions>
@@ -116,8 +112,8 @@
<artifactId>aopalliance</artifactId>
</exclusion>
<exclusion>
- <groupId>org.sonatype.sisu</groupId>
- <artifactId>sisu-guava</artifactId>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
</exclusion>
</exclusions>
</dependency>
[27/36] maven-aether git commit: Added dedicated CONTRIBUTING file as
recognized by popular tooling
Posted by hb...@apache.org.
Added dedicated CONTRIBUTING file as recognized by popular tooling
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/64e2c540
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/64e2c540
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/64e2c540
Branch: refs/heads/demo
Commit: 64e2c5408c6d2bf41993bd4e7ea9caa670af25b9
Parents: 6d339b4
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Fri Dec 20 18:05:32 2013 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Fri Dec 20 18:05:32 2013 +0100
----------------------------------------------------------------------
CONTRIBUTING.md | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/64e2c540/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..2a98799
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,5 @@
+Contributing Patches
+====================
+Please be sure to read our [contribution guide](http://www.eclipse.org/aether/contribution/) first to avoid running down
+the wrong path. Non-conforming contributions are less likely to get accepted or might not be noticed by the committers
+at all.
[36/36] maven-aether git commit: Enabled EOL normalization for text
files at the repository level
Posted by hb...@apache.org.
Enabled EOL normalization for text files at the repository level
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/322fa556
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/322fa556
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/322fa556
Branch: refs/heads/demo
Commit: 322fa556494335faaf3ad3b7dbe8f89aaaf6222d
Parents: 7648a2b
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Sep 28 15:47:19 2014 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Sep 28 15:47:19 2014 +0200
----------------------------------------------------------------------
.gitattributes | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/322fa556/.gitattributes
----------------------------------------------------------------------
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..cc9347e
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto
[25/36] maven-aether git commit: Made ManualRepositorySystemFactory
dump stack traces of service creation failures to help troubleshooting
Posted by hb...@apache.org.
Made ManualRepositorySystemFactory dump stack traces of service creation failures to help troubleshooting
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/8ae40364
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/8ae40364
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/8ae40364
Branch: refs/heads/demo
Commit: 8ae4036407264c0cafa986df3065b72624009f84
Parents: e426060
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Sep 14 14:58:05 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Sep 14 14:58:05 2013 +0200
----------------------------------------------------------------------
.../examples/manual/ManualRepositorySystemFactory.java | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/8ae40364/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
index 8b605d7..643ee3c 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
@@ -38,6 +38,15 @@ public class ManualRepositorySystemFactory
locator.addService( TransporterFactory.class, FileTransporterFactory.class );
locator.addService( TransporterFactory.class, HttpTransporterFactory.class );
+ locator.setErrorHandler( new DefaultServiceLocator.ErrorHandler()
+ {
+ @Override
+ public void serviceCreationFailed( Class<?> type, Class<?> impl, Throwable exception )
+ {
+ exception.printStackTrace();
+ }
+ } );
+
return locator.getService( RepositorySystem.class );
}
[04/36] maven-aether git commit: Renamed package o.e.a.demo.* to
o.e.a.examples.* to better comply with Eclipse naming conventions
Posted by hb...@apache.org.
Renamed package o.e.a.demo.* to o.e.a.examples.* to better comply with Eclipse naming conventions
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/e86cfec6
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/e86cfec6
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/e86cfec6
Branch: refs/heads/demo
Commit: e86cfec65ee9a8503aa2c0c803b9c1b88f513fd9
Parents: a3a0594
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Tue Nov 1 21:26:30 2011 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Tue Nov 1 21:26:30 2011 +0100
----------------------------------------------------------------------
.../aether/demo/maven/ResolveArtifactMojo.java | 97 -----------
.../examples/maven/ResolveArtifactMojo.java | 97 +++++++++++
.../org/eclipse/aether/demo/AllAetherDemos.java | 32 ----
.../eclipse/aether/demo/DeployArtifacts.java | 57 -------
.../aether/demo/FindAvailableVersions.java | 57 -------
.../eclipse/aether/demo/FindNewestVersion.java | 56 -------
.../eclipse/aether/demo/GetDependencyTree.java | 54 ------
.../aether/demo/GetDirectDependencies.java | 56 -------
.../eclipse/aether/demo/InstallArtifacts.java | 52 ------
.../eclipse/aether/demo/ResolveArtifact.java | 54 ------
.../demo/ResolveTransitiveDependencies.java | 67 --------
.../org/eclipse/aether/demo/aether/Aether.java | 120 --------------
.../eclipse/aether/demo/aether/AetherDemo.java | 67 --------
.../aether/demo/aether/AetherResult.java | 45 -----
.../manual/ManualRepositorySystemFactory.java | 41 -----
.../aether/demo/manual/ManualWagonProvider.java | 39 -----
.../plexus/PlexusRepositorySystemFactory.java | 38 -----
.../org/eclipse/aether/demo/util/Booter.java | 53 ------
.../demo/util/ConsoleDependencyGraphDumper.java | 59 -------
.../demo/util/ConsoleRepositoryListener.java | 123 --------------
.../demo/util/ConsoleTransferListener.java | 164 -------------------
.../eclipse/aether/examples/AllAetherDemos.java | 32 ++++
.../aether/examples/DeployArtifacts.java | 57 +++++++
.../aether/examples/FindAvailableVersions.java | 57 +++++++
.../aether/examples/FindNewestVersion.java | 56 +++++++
.../aether/examples/GetDependencyTree.java | 54 ++++++
.../aether/examples/GetDirectDependencies.java | 56 +++++++
.../aether/examples/InstallArtifacts.java | 52 ++++++
.../aether/examples/ResolveArtifact.java | 54 ++++++
.../examples/ResolveTransitiveDependencies.java | 67 ++++++++
.../eclipse/aether/examples/aether/Aether.java | 120 ++++++++++++++
.../aether/examples/aether/AetherDemo.java | 67 ++++++++
.../aether/examples/aether/AetherResult.java | 45 +++++
.../manual/ManualRepositorySystemFactory.java | 41 +++++
.../examples/manual/ManualWagonProvider.java | 39 +++++
.../plexus/PlexusRepositorySystemFactory.java | 38 +++++
.../eclipse/aether/examples/util/Booter.java | 53 ++++++
.../util/ConsoleDependencyGraphDumper.java | 59 +++++++
.../util/ConsoleRepositoryListener.java | 123 ++++++++++++++
.../examples/util/ConsoleTransferListener.java | 164 +++++++++++++++++++
40 files changed, 1331 insertions(+), 1331 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/demo/maven/ResolveArtifactMojo.java
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/demo/maven/ResolveArtifactMojo.java b/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/demo/maven/ResolveArtifactMojo.java
deleted file mode 100644
index c613381..0000000
--- a/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/demo/maven/ResolveArtifactMojo.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.maven;
-
-import java.util.List;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.ArtifactRequest;
-import org.eclipse.aether.resolution.ArtifactResolutionException;
-import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-
-/**
- * @goal resolve-artifact
- */
-public class ResolveArtifactMojo
- extends AbstractMojo
-{
-
- /**
- * The entry point to Aether, i.e. the component doing all the work.
- *
- * @component
- */
- private RepositorySystem repoSystem;
-
- /**
- * The current repository/network configuration of Maven.
- *
- * @parameter default-value="${repositorySystemSession}"
- * @readonly
- */
- private RepositorySystemSession repoSession;
-
- /**
- * The project's remote repositories to use for the resolution.
- *
- * @parameter default-value="${project.remoteProjectRepositories}"
- * @readonly
- */
- private List<RemoteRepository> remoteRepos;
-
- /**
- * The {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>} of the artifact to resolve.
- *
- * @parameter expression="${aether.artifactCoords}"
- */
- private String artifactCoords;
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- Artifact artifact;
- try
- {
- artifact = new DefaultArtifact( artifactCoords );
- }
- catch ( IllegalArgumentException e )
- {
- throw new MojoFailureException( e.getMessage(), e );
- }
-
- ArtifactRequest request = new ArtifactRequest();
- request.setArtifact( artifact );
- request.setRepositories( remoteRepos );
-
- getLog().info( "Resolving artifact " + artifact + " from " + remoteRepos );
-
- ArtifactResult result;
- try
- {
- result = repoSystem.resolveArtifact( repoSession, request );
- }
- catch ( ArtifactResolutionException e )
- {
- throw new MojoExecutionException( e.getMessage(), e );
- }
-
- getLog().info( "Resolved artifact " + artifact + " to " + result.getArtifact().getFile() + " from "
- + result.getRepository() );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java b/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
new file mode 100644
index 0000000..4dc0d47
--- /dev/null
+++ b/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.maven;
+
+import java.util.List;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResolutionException;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+
+/**
+ * @goal resolve-artifact
+ */
+public class ResolveArtifactMojo
+ extends AbstractMojo
+{
+
+ /**
+ * The entry point to Aether, i.e. the component doing all the work.
+ *
+ * @component
+ */
+ private RepositorySystem repoSystem;
+
+ /**
+ * The current repository/network configuration of Maven.
+ *
+ * @parameter default-value="${repositorySystemSession}"
+ * @readonly
+ */
+ private RepositorySystemSession repoSession;
+
+ /**
+ * The project's remote repositories to use for the resolution.
+ *
+ * @parameter default-value="${project.remoteProjectRepositories}"
+ * @readonly
+ */
+ private List<RemoteRepository> remoteRepos;
+
+ /**
+ * The {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>} of the artifact to resolve.
+ *
+ * @parameter expression="${aether.artifactCoords}"
+ */
+ private String artifactCoords;
+
+ public void execute()
+ throws MojoExecutionException, MojoFailureException
+ {
+ Artifact artifact;
+ try
+ {
+ artifact = new DefaultArtifact( artifactCoords );
+ }
+ catch ( IllegalArgumentException e )
+ {
+ throw new MojoFailureException( e.getMessage(), e );
+ }
+
+ ArtifactRequest request = new ArtifactRequest();
+ request.setArtifact( artifact );
+ request.setRepositories( remoteRepos );
+
+ getLog().info( "Resolving artifact " + artifact + " from " + remoteRepos );
+
+ ArtifactResult result;
+ try
+ {
+ result = repoSystem.resolveArtifact( repoSession, request );
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+
+ getLog().info( "Resolved artifact " + artifact + " to " + result.getArtifact().getFile() + " from "
+ + result.getRepository() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/AllAetherDemos.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/AllAetherDemos.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/AllAetherDemos.java
deleted file mode 100644
index e9c06af..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/AllAetherDemos.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo;
-
-/**
- * Runs all demos at once.
- */
-public class AllAetherDemos
-{
-
- public static void main( String[] args )
- throws Exception
- {
- FindAvailableVersions.main( args );
- FindNewestVersion.main( args );
- GetDirectDependencies.main( args );
- GetDependencyTree.main( args );
- ResolveArtifact.main( args );
- ResolveTransitiveDependencies.main( args );
- InstallArtifacts.main( args );
- DeployArtifacts.main( args );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/DeployArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/DeployArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/DeployArtifacts.java
deleted file mode 100644
index a700eff..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/DeployArtifacts.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo;
-
-import java.io.File;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.demo.util.Booter;
-import org.eclipse.aether.deployment.DeployRequest;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-import org.eclipse.aether.util.artifact.SubArtifact;
-
-
-/**
- * Deploys a JAR and its POM to a remote repository.
- */
-public class DeployArtifacts
-{
-
- public static void main( String[] args )
- throws Exception
- {
- System.out.println( "------------------------------------------------------------" );
- System.out.println( DeployArtifacts.class.getSimpleName() );
-
- RepositorySystem system = Booter.newRepositorySystem();
-
- RepositorySystemSession session = Booter.newRepositorySystemSession( system );
-
- Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.demo", "", "jar", "0.1-SNAPSHOT" );
- jarArtifact = jarArtifact.setFile( new File( "org.eclipse.aether.demo.jar" ) );
-
- Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
- pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
-
- RemoteRepository distRepo =
- new RemoteRepository( "org.eclipse.aether.demo", "default", new File( "target/dist-repo" ).toURI().toString() );
-
- DeployRequest deployRequest = new DeployRequest();
- deployRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact );
- deployRequest.setRepository( distRepo );
-
- system.deploy( session, deployRequest );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindAvailableVersions.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindAvailableVersions.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindAvailableVersions.java
deleted file mode 100644
index b827864..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindAvailableVersions.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo;
-
-import java.util.List;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.demo.util.Booter;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.VersionRangeRequest;
-import org.eclipse.aether.resolution.VersionRangeResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-import org.eclipse.aether.version.Version;
-
-
-/**
- * Determines all available versions of an artifact.
- */
-public class FindAvailableVersions
-{
-
- public static void main( String[] args )
- throws Exception
- {
- System.out.println( "------------------------------------------------------------" );
- System.out.println( FindAvailableVersions.class.getSimpleName() );
-
- RepositorySystem system = Booter.newRepositorySystem();
-
- RepositorySystemSession session = Booter.newRepositorySystemSession( system );
-
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:[0,)" );
-
- RemoteRepository repo = Booter.newCentralRepository();
-
- VersionRangeRequest rangeRequest = new VersionRangeRequest();
- rangeRequest.setArtifact( artifact );
- rangeRequest.addRepository( repo );
-
- VersionRangeResult rangeResult = system.resolveVersionRange( session, rangeRequest );
-
- List<Version> versions = rangeResult.getVersions();
-
- System.out.println( "Available versions " + versions );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindNewestVersion.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindNewestVersion.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindNewestVersion.java
deleted file mode 100644
index 4ca2fa0..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/FindNewestVersion.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.demo.util.Booter;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.VersionRangeRequest;
-import org.eclipse.aether.resolution.VersionRangeResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-import org.eclipse.aether.version.Version;
-
-
-/**
- * Determines the newest version of an artifact.
- */
-public class FindNewestVersion
-{
-
- public static void main( String[] args )
- throws Exception
- {
- System.out.println( "------------------------------------------------------------" );
- System.out.println( FindNewestVersion.class.getSimpleName() );
-
- RepositorySystem system = Booter.newRepositorySystem();
-
- RepositorySystemSession session = Booter.newRepositorySystemSession( system );
-
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:[0,)" );
-
- RemoteRepository repo = Booter.newCentralRepository();
-
- VersionRangeRequest rangeRequest = new VersionRangeRequest();
- rangeRequest.setArtifact( artifact );
- rangeRequest.addRepository( repo );
-
- VersionRangeResult rangeResult = system.resolveVersionRange( session, rangeRequest );
-
- Version newestVersion = rangeResult.getHighestVersion();
-
- System.out.println( "Newest version " + newestVersion + " from repository "
- + rangeResult.getRepository( newestVersion ) );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDependencyTree.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDependencyTree.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDependencyTree.java
deleted file mode 100644
index 9468395..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDependencyTree.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.collection.CollectRequest;
-import org.eclipse.aether.collection.CollectResult;
-import org.eclipse.aether.demo.util.Booter;
-import org.eclipse.aether.demo.util.ConsoleDependencyGraphDumper;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-
-
-/**
- * Collects the transitive dependencies of an artifact.
- */
-public class GetDependencyTree
-{
-
- public static void main( String[] args )
- throws Exception
- {
- System.out.println( "------------------------------------------------------------" );
- System.out.println( GetDependencyTree.class.getSimpleName() );
-
- RepositorySystem system = Booter.newRepositorySystem();
-
- RepositorySystemSession session = Booter.newRepositorySystemSession( system );
-
- Artifact artifact = new DefaultArtifact( "org.apache.maven:maven-aether-provider:3.0.2" );
-
- RemoteRepository repo = Booter.newCentralRepository();
-
- CollectRequest collectRequest = new CollectRequest();
- collectRequest.setRoot( new Dependency( artifact, "" ) );
- collectRequest.addRepository( repo );
-
- CollectResult collectResult = system.collectDependencies( session, collectRequest );
-
- collectResult.getRoot().accept( new ConsoleDependencyGraphDumper() );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDirectDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDirectDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDirectDependencies.java
deleted file mode 100644
index 44f9e63..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/GetDirectDependencies.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.demo.util.Booter;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
-import org.eclipse.aether.resolution.ArtifactDescriptorResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-
-
-/**
- * Determines the direct dependencies of an artifact as declared in its artifact descriptor (POM).
- */
-public class GetDirectDependencies
-{
-
- public static void main( String[] args )
- throws Exception
- {
- System.out.println( "------------------------------------------------------------" );
- System.out.println( GetDirectDependencies.class.getSimpleName() );
-
- RepositorySystem system = Booter.newRepositorySystem();
-
- RepositorySystemSession session = Booter.newRepositorySystemSession( system );
-
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-impl:1.13" );
-
- RemoteRepository repo = Booter.newCentralRepository();
-
- ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
- descriptorRequest.setArtifact( artifact );
- descriptorRequest.addRepository( repo );
-
- ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor( session, descriptorRequest );
-
- for ( Dependency dependency : descriptorResult.getDependencies() )
- {
- System.out.println( dependency );
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/InstallArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/InstallArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/InstallArtifacts.java
deleted file mode 100644
index 75db100..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/InstallArtifacts.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo;
-
-import java.io.File;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.demo.util.Booter;
-import org.eclipse.aether.installation.InstallRequest;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-import org.eclipse.aether.util.artifact.SubArtifact;
-
-
-/**
- * Installs a JAR and its POM to the local repository.
- */
-public class InstallArtifacts
-{
-
- public static void main( String[] args )
- throws Exception
- {
- System.out.println( "------------------------------------------------------------" );
- System.out.println( InstallArtifacts.class.getSimpleName() );
-
- RepositorySystem system = Booter.newRepositorySystem();
-
- RepositorySystemSession session = Booter.newRepositorySystemSession( system );
-
- Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.demo", "", "jar", "0.1-SNAPSHOT" );
- jarArtifact = jarArtifact.setFile( new File( "org.eclipse.aether.demo.jar" ) );
-
- Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
- pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
-
- InstallRequest installRequest = new InstallRequest();
- installRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact );
-
- system.install( session, installRequest );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveArtifact.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveArtifact.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveArtifact.java
deleted file mode 100644
index 766b6ac..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveArtifact.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.demo.util.Booter;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.ArtifactRequest;
-import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-
-
-/**
- * Resolves a single artifact.
- */
-public class ResolveArtifact
-{
-
- public static void main( String[] args )
- throws Exception
- {
- System.out.println( "------------------------------------------------------------" );
- System.out.println( ResolveArtifact.class.getSimpleName() );
-
- RepositorySystem system = Booter.newRepositorySystem();
-
- RepositorySystemSession session = Booter.newRepositorySystemSession( system );
-
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:1.13" );
-
- RemoteRepository repo = Booter.newCentralRepository();
-
- ArtifactRequest artifactRequest = new ArtifactRequest();
- artifactRequest.setArtifact( artifact );
- artifactRequest.addRepository( repo );
-
- ArtifactResult artifactResult = system.resolveArtifact( session, artifactRequest );
-
- artifact = artifactResult.getArtifact();
-
- System.out.println( artifact + " resolved to " + artifact.getFile() );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveTransitiveDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveTransitiveDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveTransitiveDependencies.java
deleted file mode 100644
index dd3f6ce..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/ResolveTransitiveDependencies.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo;
-
-import java.util.List;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.collection.CollectRequest;
-import org.eclipse.aether.demo.util.Booter;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.graph.DependencyFilter;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.resolution.DependencyRequest;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-import org.eclipse.aether.util.artifact.JavaScopes;
-import org.eclipse.aether.util.filter.DependencyFilterUtils;
-
-
-/**
- * Resolves the transitive (compile) dependencies of an artifact.
- */
-public class ResolveTransitiveDependencies
-{
-
- public static void main( String[] args )
- throws Exception
- {
- System.out.println( "------------------------------------------------------------" );
- System.out.println( ResolveTransitiveDependencies.class.getSimpleName() );
-
- RepositorySystem system = Booter.newRepositorySystem();
-
- RepositorySystemSession session = Booter.newRepositorySystemSession( system );
-
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-impl:1.13" );
-
- RemoteRepository repo = Booter.newCentralRepository();
-
- DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter( JavaScopes.COMPILE );
-
- CollectRequest collectRequest = new CollectRequest();
- collectRequest.setRoot( new Dependency( artifact, JavaScopes.COMPILE ) );
- collectRequest.addRepository( repo );
-
- DependencyRequest dependencyRequest = new DependencyRequest( collectRequest, classpathFlter );
-
- List<ArtifactResult> artifactResults =
- system.resolveDependencies( session, dependencyRequest ).getArtifactResults();
-
- for ( ArtifactResult artifactResult : artifactResults )
- {
- System.out.println( artifactResult.getArtifact() + " resolved to " + artifactResult.getArtifact().getFile() );
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/Aether.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/Aether.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/Aether.java
deleted file mode 100644
index 274d41f..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/Aether.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.aether;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.collection.CollectRequest;
-import org.eclipse.aether.demo.util.Booter;
-import org.eclipse.aether.demo.util.ConsoleDependencyGraphDumper;
-import org.eclipse.aether.deployment.DeployRequest;
-import org.eclipse.aether.deployment.DeploymentException;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.graph.DependencyNode;
-import org.eclipse.aether.installation.InstallRequest;
-import org.eclipse.aether.installation.InstallationException;
-import org.eclipse.aether.repository.Authentication;
-import org.eclipse.aether.repository.LocalRepository;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.DependencyRequest;
-import org.eclipse.aether.resolution.DependencyResolutionException;
-import org.eclipse.aether.util.DefaultRepositorySystemSession;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-import org.eclipse.aether.util.graph.PreorderNodeListGenerator;
-
-
-public class Aether
-{
- private String remoteRepository;
-
- private RepositorySystem repositorySystem;
-
- private LocalRepository localRepository;
-
- public Aether( String remoteRepository, String localRepository )
- {
- this.remoteRepository = remoteRepository;
- this.repositorySystem = Booter.newRepositorySystem();
- this.localRepository = new LocalRepository( localRepository );
- }
-
- private RepositorySystemSession newSession()
- {
- DefaultRepositorySystemSession session = Booter.newRepositorySystemSession( repositorySystem );
- session.setLocalRepositoryManager( repositorySystem.newLocalRepositoryManager( localRepository ) );
- return session;
- }
-
- public AetherResult resolve( String groupId, String artifactId, String version )
- throws DependencyResolutionException
- {
- RepositorySystemSession session = newSession();
- Dependency dependency =
- new Dependency( new DefaultArtifact( groupId, artifactId, "", "jar", version ), "runtime" );
- RemoteRepository central = new RemoteRepository( "central", "default", remoteRepository );
-
- CollectRequest collectRequest = new CollectRequest();
- collectRequest.setRoot( dependency );
- collectRequest.addRepository( central );
-
- DependencyRequest dependencyRequest = new DependencyRequest();
- dependencyRequest.setCollectRequest( collectRequest );
-
- DependencyNode rootNode = repositorySystem.resolveDependencies( session, dependencyRequest ).getRoot();
-
- StringBuilder dump = new StringBuilder();
- displayTree( rootNode, dump );
-
- PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
- rootNode.accept( nlg );
-
- return new AetherResult( rootNode, nlg.getFiles(), nlg.getClassPath() );
- }
-
- public void install( Artifact artifact, Artifact pom )
- throws InstallationException
- {
- RepositorySystemSession session = newSession();
-
- InstallRequest installRequest = new InstallRequest();
- installRequest.addArtifact( artifact ).addArtifact( pom );
-
- repositorySystem.install( session, installRequest );
- }
-
- public void deploy( Artifact artifact, Artifact pom, String remoteRepository )
- throws DeploymentException
- {
- RepositorySystemSession session = newSession();
-
- RemoteRepository nexus = new RemoteRepository( "nexus", "default", remoteRepository );
- Authentication authentication = new Authentication( "admin", "admin123" );
- nexus.setAuthentication( authentication );
-
- DeployRequest deployRequest = new DeployRequest();
- deployRequest.addArtifact( artifact ).addArtifact( pom );
- deployRequest.setRepository( nexus );
-
- repositorySystem.deploy( session, deployRequest );
- }
-
- private void displayTree( DependencyNode node, StringBuilder sb )
- {
- ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 );
- node.accept( new ConsoleDependencyGraphDumper( new PrintStream( os ) ) );
- sb.append( os.toString() );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherDemo.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherDemo.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherDemo.java
deleted file mode 100644
index 8d21429..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherDemo.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.aether;
-
-import java.io.File;
-import java.util.List;
-
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.deployment.DeploymentException;
-import org.eclipse.aether.graph.DependencyNode;
-import org.eclipse.aether.installation.InstallationException;
-import org.eclipse.aether.resolution.DependencyResolutionException;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-import org.eclipse.aether.util.artifact.SubArtifact;
-
-@SuppressWarnings( "unused" )
-public class AetherDemo
-{
-
- public void resolve()
- throws DependencyResolutionException
- {
- Aether aether = new Aether( "http://localhost:8081/nexus/content/groups/public", "/Users/jvanzyl/aether-repo" );
-
- AetherResult result = aether.resolve( "com.mycompany.app", "super-app", "1.0" );
-
- // Get the root of the resolved tree of artifacts
- //
- DependencyNode root = result.getRoot();
-
- // Get the list of files for the artifacts resolved
- //
- List<File> artifacts = result.getResolvedFiles();
-
- // Get the classpath of the artifacts resolved
- //
- String classpath = result.getResolvedClassPath();
- }
-
- public void installAndDeploy()
- throws InstallationException, DeploymentException
- {
- Aether aether = new Aether( "http://localhost:8081/nexus/content/groups/public", "/Users/jvanzyl/aether-repo" );
-
- Artifact artifact = new DefaultArtifact( "com.mycompany.super", "super-core", "jar", "0.1-SNAPSHOT" );
- artifact = artifact.setFile( new File( "jar-from-whatever-process.jar" ) );
- Artifact pom = new SubArtifact( artifact, null, "pom" );
- pom = pom.setFile( new File( "pom-from-whatever-process.xml" ) );
-
- // Install into the local repository specified
- //
- aether.install( artifact, pom );
-
- // Deploy to a remote reposistory
- //
- aether.deploy( artifact, pom, "http://localhost:8081/nexus/content/repositories/snapshots/" );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherResult.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherResult.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherResult.java
deleted file mode 100644
index cf2b449..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/aether/AetherResult.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.aether;
-
-import java.io.File;
-import java.util.List;
-
-import org.eclipse.aether.graph.DependencyNode;
-
-public class AetherResult
-{
- private DependencyNode root;
- private List<File> resolvedFiles;
- private String resolvedClassPath;
-
- public AetherResult( DependencyNode root, List<File> resolvedFiles, String resolvedClassPath )
- {
- this.root = root;
- this.resolvedFiles = resolvedFiles;
- this.resolvedClassPath = resolvedClassPath;
- }
-
- public DependencyNode getRoot()
- {
- return root;
- }
-
- public List<File> getResolvedFiles()
- {
- return resolvedFiles;
- }
-
- public String getResolvedClassPath()
- {
- return resolvedClassPath;
- }
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualRepositorySystemFactory.java
deleted file mode 100644
index 11aa788..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualRepositorySystemFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.manual;
-
-import org.apache.maven.repository.internal.DefaultServiceLocator;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.connector.file.FileRepositoryConnectorFactory;
-import org.eclipse.aether.connector.wagon.WagonProvider;
-import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
-import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
-
-/**
- * A factory for repository system instances that employs Aether's built-in service locator infrastructure to wire up
- * the system's components.
- */
-public class ManualRepositorySystemFactory
-{
-
- public static RepositorySystem newRepositorySystem()
- {
- /*
- * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
- * prepopulated DefaultServiceLocator, we only need to register the repository connector factories.
- */
- DefaultServiceLocator locator = new DefaultServiceLocator();
- locator.addService( RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class );
- locator.addService( RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class );
- locator.setServices( WagonProvider.class, new ManualWagonProvider() );
-
- return locator.getService( RepositorySystem.class );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
deleted file mode 100644
index 0a48c56..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.manual;
-
-import org.apache.maven.wagon.Wagon;
-import org.eclipse.aether.connector.wagon.WagonProvider;
-import org.sonatype.maven.wagon.AhcWagon;
-
-/**
- * A simplistic provider for wagon instances when no Plexus-compatible IoC container is used.
- */
-public class ManualWagonProvider
- implements WagonProvider
-{
-
- public Wagon lookup( String roleHint )
- throws Exception
- {
- if ( "http".equals( roleHint ) )
- {
- return new AhcWagon();
- }
- return null;
- }
-
- public void release( Wagon wagon )
- {
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/plexus/PlexusRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/plexus/PlexusRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/plexus/PlexusRepositorySystemFactory.java
deleted file mode 100644
index 8d3f41e..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/plexus/PlexusRepositorySystemFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.plexus;
-
-import org.codehaus.plexus.DefaultPlexusContainer;
-import org.eclipse.aether.RepositorySystem;
-
-/**
- * A factory for repository system instances that employs Plexus to wire up the system's components.
- */
-public class PlexusRepositorySystemFactory
-{
-
- public static RepositorySystem newRepositorySystem()
- {
- /*
- * Aether's components are equipped with plexus-specific metadata to enable discovery and wiring of components
- * by a Plexus container so this is as easy as looking up the implementation.
- */
- try
- {
- return new DefaultPlexusContainer().lookup( RepositorySystem.class );
- }
- catch ( Exception e )
- {
- throw new IllegalStateException( "dependency injection failed", e );
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/Booter.java
deleted file mode 100644
index 8be5593..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/Booter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.util;
-
-import org.apache.maven.repository.internal.MavenRepositorySystemSession;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.demo.manual.ManualRepositorySystemFactory;
-import org.eclipse.aether.repository.LocalRepository;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.util.DefaultRepositorySystemSession;
-
-
-/**
- * A helper to boot the repository system and a repository system session.
- */
-public class Booter
-{
-
- public static RepositorySystem newRepositorySystem()
- {
- return ManualRepositorySystemFactory.newRepositorySystem();
- }
-
- public static DefaultRepositorySystemSession newRepositorySystemSession( RepositorySystem system )
- {
- MavenRepositorySystemSession session = new MavenRepositorySystemSession();
-
- LocalRepository localRepo = new LocalRepository( "target/local-repo" );
- session.setLocalRepositoryManager( system.newLocalRepositoryManager( localRepo ) );
-
- session.setTransferListener( new ConsoleTransferListener() );
- session.setRepositoryListener( new ConsoleRepositoryListener() );
-
- // uncomment to generate dirty trees
- // session.setDependencyGraphTransformer( null );
-
- return session;
- }
-
- public static RemoteRepository newCentralRepository()
- {
- return new RemoteRepository( "central", "default", "http://repo1.maven.org/maven2/" );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleDependencyGraphDumper.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleDependencyGraphDumper.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleDependencyGraphDumper.java
deleted file mode 100644
index 960eeda..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleDependencyGraphDumper.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.util;
-
-import java.io.PrintStream;
-
-import org.eclipse.aether.graph.DependencyNode;
-import org.eclipse.aether.graph.DependencyVisitor;
-
-/**
- * A dependency visitor that dumps the graph to the console.
- */
-public class ConsoleDependencyGraphDumper
- implements DependencyVisitor
-{
-
- private PrintStream out;
-
- private String currentIndent = "";
-
- public ConsoleDependencyGraphDumper()
- {
- this( null );
- }
-
- public ConsoleDependencyGraphDumper( PrintStream out )
- {
- this.out = ( out != null ) ? out : System.out;
- }
-
- public boolean visitEnter( DependencyNode node )
- {
- out.println( currentIndent + node );
- if ( currentIndent.length() <= 0 )
- {
- currentIndent = "+- ";
- }
- else
- {
- currentIndent = "| " + currentIndent;
- }
- return true;
- }
-
- public boolean visitLeave( DependencyNode node )
- {
- currentIndent = currentIndent.substring( 3, currentIndent.length() );
- return true;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleRepositoryListener.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleRepositoryListener.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleRepositoryListener.java
deleted file mode 100644
index 3bf0cb5..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleRepositoryListener.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.util;
-
-import java.io.PrintStream;
-
-import org.eclipse.aether.AbstractRepositoryListener;
-import org.eclipse.aether.RepositoryEvent;
-
-/**
- * A simplistic repository listener that logs events to the console.
- */
-public class ConsoleRepositoryListener
- extends AbstractRepositoryListener
-{
-
- private PrintStream out;
-
- public ConsoleRepositoryListener()
- {
- this( null );
- }
-
- public ConsoleRepositoryListener( PrintStream out )
- {
- this.out = ( out != null ) ? out : System.out;
- }
-
- public void artifactDeployed( RepositoryEvent event )
- {
- out.println( "Deployed " + event.getArtifact() + " to " + event.getRepository() );
- }
-
- public void artifactDeploying( RepositoryEvent event )
- {
- out.println( "Deploying " + event.getArtifact() + " to " + event.getRepository() );
- }
-
- public void artifactDescriptorInvalid( RepositoryEvent event )
- {
- out.println( "Invalid artifact descriptor for " + event.getArtifact() + ": "
- + event.getException().getMessage() );
- }
-
- public void artifactDescriptorMissing( RepositoryEvent event )
- {
- out.println( "Missing artifact descriptor for " + event.getArtifact() );
- }
-
- public void artifactInstalled( RepositoryEvent event )
- {
- out.println( "Installed " + event.getArtifact() + " to " + event.getFile() );
- }
-
- public void artifactInstalling( RepositoryEvent event )
- {
- out.println( "Installing " + event.getArtifact() + " to " + event.getFile() );
- }
-
- public void artifactResolved( RepositoryEvent event )
- {
- out.println( "Resolved artifact " + event.getArtifact() + " from " + event.getRepository() );
- }
-
- public void artifactDownloading( RepositoryEvent event )
- {
- out.println( "Downloading artifact " + event.getArtifact() + " from " + event.getRepository() );
- }
-
- public void artifactDownloaded( RepositoryEvent event )
- {
- out.println( "Downloaded artifact " + event.getArtifact() + " from " + event.getRepository() );
- }
-
- public void artifactResolving( RepositoryEvent event )
- {
- out.println( "Resolving artifact " + event.getArtifact() );
- }
-
- public void metadataDeployed( RepositoryEvent event )
- {
- out.println( "Deployed " + event.getMetadata() + " to " + event.getRepository() );
- }
-
- public void metadataDeploying( RepositoryEvent event )
- {
- out.println( "Deploying " + event.getMetadata() + " to " + event.getRepository() );
- }
-
- public void metadataInstalled( RepositoryEvent event )
- {
- out.println( "Installed " + event.getMetadata() + " to " + event.getFile() );
- }
-
- public void metadataInstalling( RepositoryEvent event )
- {
- out.println( "Installing " + event.getMetadata() + " to " + event.getFile() );
- }
-
- public void metadataInvalid( RepositoryEvent event )
- {
- out.println( "Invalid metadata " + event.getMetadata() );
- }
-
- public void metadataResolved( RepositoryEvent event )
- {
- out.println( "Resolved metadata " + event.getMetadata() + " from " + event.getRepository() );
- }
-
- public void metadataResolving( RepositoryEvent event )
- {
- out.println( "Resolving metadata " + event.getMetadata() + " from " + event.getRepository() );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleTransferListener.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleTransferListener.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleTransferListener.java
deleted file mode 100644
index 04be132..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/util/ConsoleTransferListener.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.demo.util;
-
-import java.io.PrintStream;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.eclipse.aether.transfer.AbstractTransferListener;
-import org.eclipse.aether.transfer.TransferEvent;
-import org.eclipse.aether.transfer.TransferResource;
-
-/**
- * A simplistic transfer listener that logs uploads/downloads to the console.
- */
-public class ConsoleTransferListener
- extends AbstractTransferListener
-{
-
- private PrintStream out;
-
- private Map<TransferResource, Long> downloads = new ConcurrentHashMap<TransferResource, Long>();
-
- private int lastLength;
-
- public ConsoleTransferListener()
- {
- this( null );
- }
-
- public ConsoleTransferListener( PrintStream out )
- {
- this.out = ( out != null ) ? out : System.out;
- }
-
- @Override
- public void transferInitiated( TransferEvent event )
- {
- String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
-
- out.println( message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
- }
-
- @Override
- public void transferProgressed( TransferEvent event )
- {
- TransferResource resource = event.getResource();
- downloads.put( resource, Long.valueOf( event.getTransferredBytes() ) );
-
- StringBuilder buffer = new StringBuilder( 64 );
-
- for ( Map.Entry<TransferResource, Long> entry : downloads.entrySet() )
- {
- long total = entry.getKey().getContentLength();
- long complete = entry.getValue().longValue();
-
- buffer.append( getStatus( complete, total ) ).append( " " );
- }
-
- int pad = lastLength - buffer.length();
- lastLength = buffer.length();
- pad( buffer, pad );
- buffer.append( '\r' );
-
- out.print( buffer );
- }
-
- private String getStatus( long complete, long total )
- {
- if ( total >= 1024 )
- {
- return toKB( complete ) + "/" + toKB( total ) + " KB ";
- }
- else if ( total >= 0 )
- {
- return complete + "/" + total + " B ";
- }
- else if ( complete >= 1024 )
- {
- return toKB( complete ) + " KB ";
- }
- else
- {
- return complete + " B ";
- }
- }
-
- private void pad( StringBuilder buffer, int spaces )
- {
- String block = " ";
- while ( spaces > 0 )
- {
- int n = Math.min( spaces, block.length() );
- buffer.append( block, 0, n );
- spaces -= n;
- }
- }
-
- @Override
- public void transferSucceeded( TransferEvent event )
- {
- transferCompleted( event );
-
- TransferResource resource = event.getResource();
- long contentLength = event.getTransferredBytes();
- if ( contentLength >= 0 )
- {
- String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
- String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B";
-
- String throughput = "";
- long duration = System.currentTimeMillis() - resource.getTransferStartTime();
- if ( duration > 0 )
- {
- DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) );
- double kbPerSec = ( contentLength / 1024.0 ) / ( duration / 1000.0 );
- throughput = " at " + format.format( kbPerSec ) + " KB/sec";
- }
-
- out.println( type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
- + throughput + ")" );
- }
- }
-
- @Override
- public void transferFailed( TransferEvent event )
- {
- transferCompleted( event );
-
- event.getException().printStackTrace( out );
- }
-
- private void transferCompleted( TransferEvent event )
- {
- downloads.remove( event.getResource() );
-
- StringBuilder buffer = new StringBuilder( 64 );
- pad( buffer, lastLength );
- buffer.append( '\r' );
- out.print( buffer );
- }
-
- public void transferCorrupted( TransferEvent event )
- {
- event.getException().printStackTrace( out );
- }
-
- protected long toKB( long bytes )
- {
- return ( bytes + 1023 ) / 1024;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/AllAetherDemos.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/AllAetherDemos.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/AllAetherDemos.java
new file mode 100644
index 0000000..bb85d29
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/AllAetherDemos.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+/**
+ * Runs all demos at once.
+ */
+public class AllAetherDemos
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ FindAvailableVersions.main( args );
+ FindNewestVersion.main( args );
+ GetDirectDependencies.main( args );
+ GetDependencyTree.main( args );
+ ResolveArtifact.main( args );
+ ResolveTransitiveDependencies.main( args );
+ InstallArtifacts.main( args );
+ DeployArtifacts.main( args );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
new file mode 100644
index 0000000..916c3bf
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+import java.io.File;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.artifact.SubArtifact;
+
+
+/**
+ * Deploys a JAR and its POM to a remote repository.
+ */
+public class DeployArtifacts
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( DeployArtifacts.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.examples", "", "jar", "0.1-SNAPSHOT" );
+ jarArtifact = jarArtifact.setFile( new File( "org.eclipse.aether.examples.jar" ) );
+
+ Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
+ pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
+
+ RemoteRepository distRepo =
+ new RemoteRepository( "org.eclipse.aether.examples", "default", new File( "target/dist-repo" ).toURI().toString() );
+
+ DeployRequest deployRequest = new DeployRequest();
+ deployRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact );
+ deployRequest.setRepository( distRepo );
+
+ system.deploy( session, deployRequest );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
new file mode 100644
index 0000000..b3d5219
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+import java.util.List;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.VersionRangeRequest;
+import org.eclipse.aether.resolution.VersionRangeResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.version.Version;
+
+
+/**
+ * Determines all available versions of an artifact.
+ */
+public class FindAvailableVersions
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( FindAvailableVersions.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:[0,)" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ VersionRangeRequest rangeRequest = new VersionRangeRequest();
+ rangeRequest.setArtifact( artifact );
+ rangeRequest.addRepository( repo );
+
+ VersionRangeResult rangeResult = system.resolveVersionRange( session, rangeRequest );
+
+ List<Version> versions = rangeResult.getVersions();
+
+ System.out.println( "Available versions " + versions );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
new file mode 100644
index 0000000..4bf8eb5
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.VersionRangeRequest;
+import org.eclipse.aether.resolution.VersionRangeResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.version.Version;
+
+
+/**
+ * Determines the newest version of an artifact.
+ */
+public class FindNewestVersion
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( FindNewestVersion.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:[0,)" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ VersionRangeRequest rangeRequest = new VersionRangeRequest();
+ rangeRequest.setArtifact( artifact );
+ rangeRequest.addRepository( repo );
+
+ VersionRangeResult rangeResult = system.resolveVersionRange( session, rangeRequest );
+
+ Version newestVersion = rangeResult.getHighestVersion();
+
+ System.out.println( "Newest version " + newestVersion + " from repository "
+ + rangeResult.getRepository( newestVersion ) );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
new file mode 100644
index 0000000..8694f5e
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.collection.CollectResult;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.examples.util.ConsoleDependencyGraphDumper;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+
+
+/**
+ * Collects the transitive dependencies of an artifact.
+ */
+public class GetDependencyTree
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( GetDependencyTree.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.apache.maven:maven-aether-provider:3.0.2" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ CollectRequest collectRequest = new CollectRequest();
+ collectRequest.setRoot( new Dependency( artifact, "" ) );
+ collectRequest.addRepository( repo );
+
+ CollectResult collectResult = system.collectDependencies( session, collectRequest );
+
+ collectResult.getRoot().accept( new ConsoleDependencyGraphDumper() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
new file mode 100644
index 0000000..af6a349
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
+import org.eclipse.aether.resolution.ArtifactDescriptorResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+
+
+/**
+ * Determines the direct dependencies of an artifact as declared in its artifact descriptor (POM).
+ */
+public class GetDirectDependencies
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( GetDirectDependencies.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-impl:1.13" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
+ descriptorRequest.setArtifact( artifact );
+ descriptorRequest.addRepository( repo );
+
+ ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor( session, descriptorRequest );
+
+ for ( Dependency dependency : descriptorResult.getDependencies() )
+ {
+ System.out.println( dependency );
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
new file mode 100644
index 0000000..f0ecf11
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+import java.io.File;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.installation.InstallRequest;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.artifact.SubArtifact;
+
+
+/**
+ * Installs a JAR and its POM to the local repository.
+ */
+public class InstallArtifacts
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( InstallArtifacts.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.examples", "", "jar", "0.1-SNAPSHOT" );
+ jarArtifact = jarArtifact.setFile( new File( "org.eclipse.aether.examples.jar" ) );
+
+ Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
+ pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
+
+ InstallRequest installRequest = new InstallRequest();
+ installRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact );
+
+ system.install( session, installRequest );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
new file mode 100644
index 0000000..8b05cfc
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+
+
+/**
+ * Resolves a single artifact.
+ */
+public class ResolveArtifact
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( ResolveArtifact.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:1.13" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ ArtifactRequest artifactRequest = new ArtifactRequest();
+ artifactRequest.setArtifact( artifact );
+ artifactRequest.addRepository( repo );
+
+ ArtifactResult artifactResult = system.resolveArtifact( session, artifactRequest );
+
+ artifact = artifactResult.getArtifact();
+
+ System.out.println( artifact + " resolved to " + artifact.getFile() );
+ }
+
+}
[28/36] maven-aether git commit: Removed unused property
Posted by hb...@apache.org.
Removed unused property
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/c58f3489
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/c58f3489
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/c58f3489
Branch: refs/heads/demo
Commit: c58f34893590cf9b9f43fc189786ff17c65c5191
Parents: 64e2c54
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Fri Jan 3 18:39:24 2014 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Fri Jan 3 18:39:24 2014 +0100
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/c58f3489/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 7f45888..11e1a0c 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- ~ Copyright (c) 2010, 2013 Sonatype, Inc.
+ ~ Copyright (c) 2010, 2014 Sonatype, Inc.
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the Eclipse Public License v1.0
~ which accompanies this distribution, and is available at
@@ -30,7 +30,6 @@
<properties>
<aetherVersion>0.9.0.M3</aetherVersion>
<mavenVersion>3.1.0</mavenVersion>
- <wagonVersion>1.0</wagonVersion>
</properties>
<dependencyManagement>
[03/36] maven-aether git commit: Renamed package o.e.a.demo.* to
o.e.a.examples.* to better comply with Eclipse naming conventions
Posted by hb...@apache.org.
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
new file mode 100644
index 0000000..a178221
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+import java.util.List;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.resolution.DependencyRequest;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.artifact.JavaScopes;
+import org.eclipse.aether.util.filter.DependencyFilterUtils;
+
+
+/**
+ * Resolves the transitive (compile) dependencies of an artifact.
+ */
+public class ResolveTransitiveDependencies
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( ResolveTransitiveDependencies.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ RepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-impl:1.13" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter( JavaScopes.COMPILE );
+
+ CollectRequest collectRequest = new CollectRequest();
+ collectRequest.setRoot( new Dependency( artifact, JavaScopes.COMPILE ) );
+ collectRequest.addRepository( repo );
+
+ DependencyRequest dependencyRequest = new DependencyRequest( collectRequest, classpathFlter );
+
+ List<ArtifactResult> artifactResults =
+ system.resolveDependencies( session, dependencyRequest ).getArtifactResults();
+
+ for ( ArtifactResult artifactResult : artifactResults )
+ {
+ System.out.println( artifactResult.getArtifact() + " resolved to " + artifactResult.getArtifact().getFile() );
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
new file mode 100644
index 0000000..9262699
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.aether;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.examples.util.ConsoleDependencyGraphDumper;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.installation.InstallRequest;
+import org.eclipse.aether.installation.InstallationException;
+import org.eclipse.aether.repository.Authentication;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.DependencyRequest;
+import org.eclipse.aether.resolution.DependencyResolutionException;
+import org.eclipse.aether.util.DefaultRepositorySystemSession;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.graph.PreorderNodeListGenerator;
+
+
+public class Aether
+{
+ private String remoteRepository;
+
+ private RepositorySystem repositorySystem;
+
+ private LocalRepository localRepository;
+
+ public Aether( String remoteRepository, String localRepository )
+ {
+ this.remoteRepository = remoteRepository;
+ this.repositorySystem = Booter.newRepositorySystem();
+ this.localRepository = new LocalRepository( localRepository );
+ }
+
+ private RepositorySystemSession newSession()
+ {
+ DefaultRepositorySystemSession session = Booter.newRepositorySystemSession( repositorySystem );
+ session.setLocalRepositoryManager( repositorySystem.newLocalRepositoryManager( localRepository ) );
+ return session;
+ }
+
+ public AetherResult resolve( String groupId, String artifactId, String version )
+ throws DependencyResolutionException
+ {
+ RepositorySystemSession session = newSession();
+ Dependency dependency =
+ new Dependency( new DefaultArtifact( groupId, artifactId, "", "jar", version ), "runtime" );
+ RemoteRepository central = new RemoteRepository( "central", "default", remoteRepository );
+
+ CollectRequest collectRequest = new CollectRequest();
+ collectRequest.setRoot( dependency );
+ collectRequest.addRepository( central );
+
+ DependencyRequest dependencyRequest = new DependencyRequest();
+ dependencyRequest.setCollectRequest( collectRequest );
+
+ DependencyNode rootNode = repositorySystem.resolveDependencies( session, dependencyRequest ).getRoot();
+
+ StringBuilder dump = new StringBuilder();
+ displayTree( rootNode, dump );
+
+ PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
+ rootNode.accept( nlg );
+
+ return new AetherResult( rootNode, nlg.getFiles(), nlg.getClassPath() );
+ }
+
+ public void install( Artifact artifact, Artifact pom )
+ throws InstallationException
+ {
+ RepositorySystemSession session = newSession();
+
+ InstallRequest installRequest = new InstallRequest();
+ installRequest.addArtifact( artifact ).addArtifact( pom );
+
+ repositorySystem.install( session, installRequest );
+ }
+
+ public void deploy( Artifact artifact, Artifact pom, String remoteRepository )
+ throws DeploymentException
+ {
+ RepositorySystemSession session = newSession();
+
+ RemoteRepository nexus = new RemoteRepository( "nexus", "default", remoteRepository );
+ Authentication authentication = new Authentication( "admin", "admin123" );
+ nexus.setAuthentication( authentication );
+
+ DeployRequest deployRequest = new DeployRequest();
+ deployRequest.addArtifact( artifact ).addArtifact( pom );
+ deployRequest.setRepository( nexus );
+
+ repositorySystem.deploy( session, deployRequest );
+ }
+
+ private void displayTree( DependencyNode node, StringBuilder sb )
+ {
+ ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 );
+ node.accept( new ConsoleDependencyGraphDumper( new PrintStream( os ) ) );
+ sb.append( os.toString() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherDemo.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherDemo.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherDemo.java
new file mode 100644
index 0000000..c5d39bc
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherDemo.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.aether;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.installation.InstallationException;
+import org.eclipse.aether.resolution.DependencyResolutionException;
+import org.eclipse.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.util.artifact.SubArtifact;
+
+@SuppressWarnings( "unused" )
+public class AetherDemo
+{
+
+ public void resolve()
+ throws DependencyResolutionException
+ {
+ Aether aether = new Aether( "http://localhost:8081/nexus/content/groups/public", "/Users/jvanzyl/aether-repo" );
+
+ AetherResult result = aether.resolve( "com.mycompany.app", "super-app", "1.0" );
+
+ // Get the root of the resolved tree of artifacts
+ //
+ DependencyNode root = result.getRoot();
+
+ // Get the list of files for the artifacts resolved
+ //
+ List<File> artifacts = result.getResolvedFiles();
+
+ // Get the classpath of the artifacts resolved
+ //
+ String classpath = result.getResolvedClassPath();
+ }
+
+ public void installAndDeploy()
+ throws InstallationException, DeploymentException
+ {
+ Aether aether = new Aether( "http://localhost:8081/nexus/content/groups/public", "/Users/jvanzyl/aether-repo" );
+
+ Artifact artifact = new DefaultArtifact( "com.mycompany.super", "super-core", "jar", "0.1-SNAPSHOT" );
+ artifact = artifact.setFile( new File( "jar-from-whatever-process.jar" ) );
+ Artifact pom = new SubArtifact( artifact, null, "pom" );
+ pom = pom.setFile( new File( "pom-from-whatever-process.xml" ) );
+
+ // Install into the local repository specified
+ //
+ aether.install( artifact, pom );
+
+ // Deploy to a remote reposistory
+ //
+ aether.deploy( artifact, pom, "http://localhost:8081/nexus/content/repositories/snapshots/" );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherResult.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherResult.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherResult.java
new file mode 100644
index 0000000..ade17ed
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherResult.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.aether;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.aether.graph.DependencyNode;
+
+public class AetherResult
+{
+ private DependencyNode root;
+ private List<File> resolvedFiles;
+ private String resolvedClassPath;
+
+ public AetherResult( DependencyNode root, List<File> resolvedFiles, String resolvedClassPath )
+ {
+ this.root = root;
+ this.resolvedFiles = resolvedFiles;
+ this.resolvedClassPath = resolvedClassPath;
+ }
+
+ public DependencyNode getRoot()
+ {
+ return root;
+ }
+
+ public List<File> getResolvedFiles()
+ {
+ return resolvedFiles;
+ }
+
+ public String getResolvedClassPath()
+ {
+ return resolvedClassPath;
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
new file mode 100644
index 0000000..6dfa2cd
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.manual;
+
+import org.apache.maven.repository.internal.DefaultServiceLocator;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.connector.file.FileRepositoryConnectorFactory;
+import org.eclipse.aether.connector.wagon.WagonProvider;
+import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
+import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
+
+/**
+ * A factory for repository system instances that employs Aether's built-in service locator infrastructure to wire up
+ * the system's components.
+ */
+public class ManualRepositorySystemFactory
+{
+
+ public static RepositorySystem newRepositorySystem()
+ {
+ /*
+ * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
+ * prepopulated DefaultServiceLocator, we only need to register the repository connector factories.
+ */
+ DefaultServiceLocator locator = new DefaultServiceLocator();
+ locator.addService( RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class );
+ locator.addService( RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class );
+ locator.setServices( WagonProvider.class, new ManualWagonProvider() );
+
+ return locator.getService( RepositorySystem.class );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonProvider.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonProvider.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonProvider.java
new file mode 100644
index 0000000..3533e88
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonProvider.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.manual;
+
+import org.apache.maven.wagon.Wagon;
+import org.eclipse.aether.connector.wagon.WagonProvider;
+import org.sonatype.maven.wagon.AhcWagon;
+
+/**
+ * A simplistic provider for wagon instances when no Plexus-compatible IoC container is used.
+ */
+public class ManualWagonProvider
+ implements WagonProvider
+{
+
+ public Wagon lookup( String roleHint )
+ throws Exception
+ {
+ if ( "http".equals( roleHint ) )
+ {
+ return new AhcWagon();
+ }
+ return null;
+ }
+
+ public void release( Wagon wagon )
+ {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
new file mode 100644
index 0000000..fbed875
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.plexus;
+
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.eclipse.aether.RepositorySystem;
+
+/**
+ * A factory for repository system instances that employs Plexus to wire up the system's components.
+ */
+public class PlexusRepositorySystemFactory
+{
+
+ public static RepositorySystem newRepositorySystem()
+ {
+ /*
+ * Aether's components are equipped with plexus-specific metadata to enable discovery and wiring of components
+ * by a Plexus container so this is as easy as looking up the implementation.
+ */
+ try
+ {
+ return new DefaultPlexusContainer().lookup( RepositorySystem.class );
+ }
+ catch ( Exception e )
+ {
+ throw new IllegalStateException( "dependency injection failed", e );
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
new file mode 100644
index 0000000..d362a9b
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.util;
+
+import org.apache.maven.repository.internal.MavenRepositorySystemSession;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.examples.manual.ManualRepositorySystemFactory;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.util.DefaultRepositorySystemSession;
+
+
+/**
+ * A helper to boot the repository system and a repository system session.
+ */
+public class Booter
+{
+
+ public static RepositorySystem newRepositorySystem()
+ {
+ return ManualRepositorySystemFactory.newRepositorySystem();
+ }
+
+ public static DefaultRepositorySystemSession newRepositorySystemSession( RepositorySystem system )
+ {
+ MavenRepositorySystemSession session = new MavenRepositorySystemSession();
+
+ LocalRepository localRepo = new LocalRepository( "target/local-repo" );
+ session.setLocalRepositoryManager( system.newLocalRepositoryManager( localRepo ) );
+
+ session.setTransferListener( new ConsoleTransferListener() );
+ session.setRepositoryListener( new ConsoleRepositoryListener() );
+
+ // uncomment to generate dirty trees
+ // session.setDependencyGraphTransformer( null );
+
+ return session;
+ }
+
+ public static RemoteRepository newCentralRepository()
+ {
+ return new RemoteRepository( "central", "default", "http://repo1.maven.org/maven2/" );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
new file mode 100644
index 0000000..59867a3
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.util;
+
+import java.io.PrintStream;
+
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.graph.DependencyVisitor;
+
+/**
+ * A dependency visitor that dumps the graph to the console.
+ */
+public class ConsoleDependencyGraphDumper
+ implements DependencyVisitor
+{
+
+ private PrintStream out;
+
+ private String currentIndent = "";
+
+ public ConsoleDependencyGraphDumper()
+ {
+ this( null );
+ }
+
+ public ConsoleDependencyGraphDumper( PrintStream out )
+ {
+ this.out = ( out != null ) ? out : System.out;
+ }
+
+ public boolean visitEnter( DependencyNode node )
+ {
+ out.println( currentIndent + node );
+ if ( currentIndent.length() <= 0 )
+ {
+ currentIndent = "+- ";
+ }
+ else
+ {
+ currentIndent = "| " + currentIndent;
+ }
+ return true;
+ }
+
+ public boolean visitLeave( DependencyNode node )
+ {
+ currentIndent = currentIndent.substring( 3, currentIndent.length() );
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleRepositoryListener.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleRepositoryListener.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleRepositoryListener.java
new file mode 100644
index 0000000..b79091e
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleRepositoryListener.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.util;
+
+import java.io.PrintStream;
+
+import org.eclipse.aether.AbstractRepositoryListener;
+import org.eclipse.aether.RepositoryEvent;
+
+/**
+ * A simplistic repository listener that logs events to the console.
+ */
+public class ConsoleRepositoryListener
+ extends AbstractRepositoryListener
+{
+
+ private PrintStream out;
+
+ public ConsoleRepositoryListener()
+ {
+ this( null );
+ }
+
+ public ConsoleRepositoryListener( PrintStream out )
+ {
+ this.out = ( out != null ) ? out : System.out;
+ }
+
+ public void artifactDeployed( RepositoryEvent event )
+ {
+ out.println( "Deployed " + event.getArtifact() + " to " + event.getRepository() );
+ }
+
+ public void artifactDeploying( RepositoryEvent event )
+ {
+ out.println( "Deploying " + event.getArtifact() + " to " + event.getRepository() );
+ }
+
+ public void artifactDescriptorInvalid( RepositoryEvent event )
+ {
+ out.println( "Invalid artifact descriptor for " + event.getArtifact() + ": "
+ + event.getException().getMessage() );
+ }
+
+ public void artifactDescriptorMissing( RepositoryEvent event )
+ {
+ out.println( "Missing artifact descriptor for " + event.getArtifact() );
+ }
+
+ public void artifactInstalled( RepositoryEvent event )
+ {
+ out.println( "Installed " + event.getArtifact() + " to " + event.getFile() );
+ }
+
+ public void artifactInstalling( RepositoryEvent event )
+ {
+ out.println( "Installing " + event.getArtifact() + " to " + event.getFile() );
+ }
+
+ public void artifactResolved( RepositoryEvent event )
+ {
+ out.println( "Resolved artifact " + event.getArtifact() + " from " + event.getRepository() );
+ }
+
+ public void artifactDownloading( RepositoryEvent event )
+ {
+ out.println( "Downloading artifact " + event.getArtifact() + " from " + event.getRepository() );
+ }
+
+ public void artifactDownloaded( RepositoryEvent event )
+ {
+ out.println( "Downloaded artifact " + event.getArtifact() + " from " + event.getRepository() );
+ }
+
+ public void artifactResolving( RepositoryEvent event )
+ {
+ out.println( "Resolving artifact " + event.getArtifact() );
+ }
+
+ public void metadataDeployed( RepositoryEvent event )
+ {
+ out.println( "Deployed " + event.getMetadata() + " to " + event.getRepository() );
+ }
+
+ public void metadataDeploying( RepositoryEvent event )
+ {
+ out.println( "Deploying " + event.getMetadata() + " to " + event.getRepository() );
+ }
+
+ public void metadataInstalled( RepositoryEvent event )
+ {
+ out.println( "Installed " + event.getMetadata() + " to " + event.getFile() );
+ }
+
+ public void metadataInstalling( RepositoryEvent event )
+ {
+ out.println( "Installing " + event.getMetadata() + " to " + event.getFile() );
+ }
+
+ public void metadataInvalid( RepositoryEvent event )
+ {
+ out.println( "Invalid metadata " + event.getMetadata() );
+ }
+
+ public void metadataResolved( RepositoryEvent event )
+ {
+ out.println( "Resolved metadata " + event.getMetadata() + " from " + event.getRepository() );
+ }
+
+ public void metadataResolving( RepositoryEvent event )
+ {
+ out.println( "Resolving metadata " + event.getMetadata() + " from " + event.getRepository() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e86cfec6/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleTransferListener.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleTransferListener.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleTransferListener.java
new file mode 100644
index 0000000..f162975
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleTransferListener.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.util;
+
+import java.io.PrintStream;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.eclipse.aether.transfer.AbstractTransferListener;
+import org.eclipse.aether.transfer.TransferEvent;
+import org.eclipse.aether.transfer.TransferResource;
+
+/**
+ * A simplistic transfer listener that logs uploads/downloads to the console.
+ */
+public class ConsoleTransferListener
+ extends AbstractTransferListener
+{
+
+ private PrintStream out;
+
+ private Map<TransferResource, Long> downloads = new ConcurrentHashMap<TransferResource, Long>();
+
+ private int lastLength;
+
+ public ConsoleTransferListener()
+ {
+ this( null );
+ }
+
+ public ConsoleTransferListener( PrintStream out )
+ {
+ this.out = ( out != null ) ? out : System.out;
+ }
+
+ @Override
+ public void transferInitiated( TransferEvent event )
+ {
+ String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
+
+ out.println( message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
+ }
+
+ @Override
+ public void transferProgressed( TransferEvent event )
+ {
+ TransferResource resource = event.getResource();
+ downloads.put( resource, Long.valueOf( event.getTransferredBytes() ) );
+
+ StringBuilder buffer = new StringBuilder( 64 );
+
+ for ( Map.Entry<TransferResource, Long> entry : downloads.entrySet() )
+ {
+ long total = entry.getKey().getContentLength();
+ long complete = entry.getValue().longValue();
+
+ buffer.append( getStatus( complete, total ) ).append( " " );
+ }
+
+ int pad = lastLength - buffer.length();
+ lastLength = buffer.length();
+ pad( buffer, pad );
+ buffer.append( '\r' );
+
+ out.print( buffer );
+ }
+
+ private String getStatus( long complete, long total )
+ {
+ if ( total >= 1024 )
+ {
+ return toKB( complete ) + "/" + toKB( total ) + " KB ";
+ }
+ else if ( total >= 0 )
+ {
+ return complete + "/" + total + " B ";
+ }
+ else if ( complete >= 1024 )
+ {
+ return toKB( complete ) + " KB ";
+ }
+ else
+ {
+ return complete + " B ";
+ }
+ }
+
+ private void pad( StringBuilder buffer, int spaces )
+ {
+ String block = " ";
+ while ( spaces > 0 )
+ {
+ int n = Math.min( spaces, block.length() );
+ buffer.append( block, 0, n );
+ spaces -= n;
+ }
+ }
+
+ @Override
+ public void transferSucceeded( TransferEvent event )
+ {
+ transferCompleted( event );
+
+ TransferResource resource = event.getResource();
+ long contentLength = event.getTransferredBytes();
+ if ( contentLength >= 0 )
+ {
+ String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
+ String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B";
+
+ String throughput = "";
+ long duration = System.currentTimeMillis() - resource.getTransferStartTime();
+ if ( duration > 0 )
+ {
+ DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) );
+ double kbPerSec = ( contentLength / 1024.0 ) / ( duration / 1000.0 );
+ throughput = " at " + format.format( kbPerSec ) + " KB/sec";
+ }
+
+ out.println( type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
+ + throughput + ")" );
+ }
+ }
+
+ @Override
+ public void transferFailed( TransferEvent event )
+ {
+ transferCompleted( event );
+
+ event.getException().printStackTrace( out );
+ }
+
+ private void transferCompleted( TransferEvent event )
+ {
+ downloads.remove( event.getResource() );
+
+ StringBuilder buffer = new StringBuilder( 64 );
+ pad( buffer, lastLength );
+ buffer.append( '\r' );
+ out.print( buffer );
+ }
+
+ public void transferCorrupted( TransferEvent event )
+ {
+ event.getException().printStackTrace( out );
+ }
+
+ protected long toKB( long bytes )
+ {
+ return ( bytes + 1023 ) / 1024;
+ }
+
+}
[33/36] maven-aether git commit: Added legal files
Posted by hb...@apache.org.
Added legal files
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/c901f567
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/c901f567
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/c901f567
Branch: refs/heads/demo
Commit: c901f56714f3edaa71c337a2d44236d40ce77d78
Parents: 6a2d85e
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Thu May 1 15:26:30 2014 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Thu May 1 15:26:30 2014 +0200
----------------------------------------------------------------------
epl-v10.html | 261 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
notice.html | 107 ++++++++++++++++++++++
2 files changed, 368 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/c901f567/epl-v10.html
----------------------------------------------------------------------
diff --git a/epl-v10.html b/epl-v10.html
new file mode 100644
index 0000000..fd39122
--- /dev/null
+++ b/epl-v10.html
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style>
+
+</head>
+
+<body lang="EN-US">
+
+<h2>Eclipse Public License - v 1.0</h2>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+</body>
+
+</html>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/c901f567/notice.html
----------------------------------------------------------------------
diff --git a/notice.html b/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/notice.html
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 9, 2014</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ ("Specification").</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology
+ on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
[07/36] maven-aether git commit: Updated imports to account for API
refactoring
Posted by hb...@apache.org.
Updated imports to account for API refactoring
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/9322458c
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/9322458c
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/9322458c
Branch: refs/heads/demo
Commit: 9322458c196e5a90a5de2a6a979133ecf096afd6
Parents: 5fda1c9
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Jan 8 18:34:27 2012 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Jan 8 18:34:27 2012 +0100
----------------------------------------------------------------------
.../eclipse/aether/examples/maven/ResolveArtifactMojo.java | 4 ++--
.../java/org/eclipse/aether/examples/DeployArtifacts.java | 8 ++++----
.../org/eclipse/aether/examples/FindAvailableVersions.java | 5 ++---
.../java/org/eclipse/aether/examples/FindNewestVersion.java | 5 ++---
.../java/org/eclipse/aether/examples/GetDependencyTree.java | 5 ++---
.../org/eclipse/aether/examples/GetDirectDependencies.java | 5 ++---
.../java/org/eclipse/aether/examples/InstallArtifacts.java | 5 ++---
.../java/org/eclipse/aether/examples/ResolveArtifact.java | 5 ++---
.../aether/examples/ResolveTransitiveDependencies.java | 5 ++---
.../main/java/org/eclipse/aether/examples/aether/Aether.java | 7 +++----
.../java/org/eclipse/aether/examples/aether/AetherDemo.java | 4 ++--
.../main/java/org/eclipse/aether/examples/util/Booter.java | 5 ++---
12 files changed, 27 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java b/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
index 4dc0d47..bd6d2c8 100644
--- a/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
+++ b/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,11 +18,11 @@ import org.apache.maven.plugin.MojoFailureException;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
/**
* @goal resolve-artifact
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
index c905415..5fdefd2 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,13 +15,12 @@ import java.io.File;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.deployment.DeployRequest;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
import org.eclipse.aether.util.artifact.SubArtifact;
-
/**
* Deploys a JAR and its POM to a remote repository.
*/
@@ -45,7 +44,8 @@ public class DeployArtifacts
pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
RemoteRepository distRepo =
- new RemoteRepository( "org.eclipse.aether.examples", "default", new File( "target/dist-repo" ).toURI().toString() );
+ new RemoteRepository( "org.eclipse.aether.examples", "default",
+ new File( "target/dist-repo" ).toURI().toString() );
DeployRequest deployRequest = new DeployRequest();
deployRequest.addArtifact( jarArtifact ).addArtifact( pomArtifact );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
index b3d5219..772445a 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,14 +15,13 @@ import java.util.List;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.VersionRangeRequest;
import org.eclipse.aether.resolution.VersionRangeResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
import org.eclipse.aether.version.Version;
-
/**
* Determines all available versions of an artifact.
*/
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
index 4bf8eb5..fa7b38f 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,14 +13,13 @@ package org.eclipse.aether.examples;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.VersionRangeRequest;
import org.eclipse.aether.resolution.VersionRangeResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
import org.eclipse.aether.version.Version;
-
/**
* Determines the newest version of an artifact.
*/
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
index 8694f5e..8c88348 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,14 +13,13 @@ package org.eclipse.aether.examples;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.collection.CollectResult;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.examples.util.ConsoleDependencyGraphDumper;
import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-
/**
* Collects the transitive dependencies of an artifact.
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
index af6a349..3fafb7e 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,13 +13,12 @@ package org.eclipse.aether.examples;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
import org.eclipse.aether.resolution.ArtifactDescriptorResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-
/**
* Determines the direct dependencies of an artifact as declared in its artifact descriptor (POM).
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
index 5871b2a..f5ba32a 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,12 +15,11 @@ import java.io.File;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.installation.InstallRequest;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
import org.eclipse.aether.util.artifact.SubArtifact;
-
/**
* Installs a JAR and its POM to the local repository.
*/
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
index 8b05cfc..bcc8aa1 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,12 +13,11 @@ package org.eclipse.aether.examples;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
-
/**
* Resolves a single artifact.
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
index a178221..9cf7cc8 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.graph.Dependency;
@@ -22,11 +23,9 @@ import org.eclipse.aether.graph.DependencyFilter;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactResult;
import org.eclipse.aether.resolution.DependencyRequest;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
import org.eclipse.aether.util.artifact.JavaScopes;
import org.eclipse.aether.util.filter.DependencyFilterUtils;
-
/**
* Resolves the transitive (compile) dependencies of an artifact.
*/
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
index 9262699..fd647bf 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,11 @@ package org.eclipse.aether.examples.aether;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
+import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.deployment.DeployRequest;
import org.eclipse.aether.deployment.DeploymentException;
@@ -30,11 +32,8 @@ import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.DependencyRequest;
import org.eclipse.aether.resolution.DependencyResolutionException;
-import org.eclipse.aether.util.DefaultRepositorySystemSession;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
import org.eclipse.aether.util.graph.PreorderNodeListGenerator;
-
public class Aether
{
private String remoteRepository;
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherDemo.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherDemo.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherDemo.java
index c5d39bc..62ba6ce 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherDemo.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/AetherDemo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,11 +14,11 @@ import java.io.File;
import java.util.List;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.deployment.DeploymentException;
import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.aether.installation.InstallationException;
import org.eclipse.aether.resolution.DependencyResolutionException;
-import org.eclipse.aether.util.artifact.DefaultArtifact;
import org.eclipse.aether.util.artifact.SubArtifact;
@SuppressWarnings( "unused" )
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/9322458c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
index d362a9b..412bfab 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,12 +11,11 @@
package org.eclipse.aether.examples.util;
import org.apache.maven.repository.internal.MavenRepositorySystemSession;
+import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.examples.manual.ManualRepositorySystemFactory;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.util.DefaultRepositorySystemSession;
-
/**
* A helper to boot the repository system and a repository system session.
[26/36] maven-aether git commit: Refactored example code slightly in
preparation to showcase issue #422413
Posted by hb...@apache.org.
Refactored example code slightly in preparation to showcase issue #422413
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/6d339b4c
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/6d339b4c
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/6d339b4c
Branch: refs/heads/demo
Commit: 6d339b4cfcfecca5da3c2ca7d004c1c925956e56
Parents: 8ae4036
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Nov 24 18:35:06 2013 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Nov 24 18:35:06 2013 +0100
----------------------------------------------------------------------
.../aether/examples/FindAvailableVersions.java | 5 +----
.../eclipse/aether/examples/FindNewestVersion.java | 5 +----
.../aether/examples/GetDependencyHierarchy.java | 12 +++++-------
.../eclipse/aether/examples/GetDependencyTree.java | 5 +----
.../aether/examples/GetDirectDependencies.java | 5 +----
.../org/eclipse/aether/examples/ResolveArtifact.java | 5 +----
.../examples/ResolveTransitiveDependencies.java | 5 +----
.../java/org/eclipse/aether/examples/util/Booter.java | 14 ++++++++++++--
8 files changed, 23 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6d339b4c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
index be309b0..8f556c2 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
@@ -17,7 +17,6 @@ import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
-import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.VersionRangeRequest;
import org.eclipse.aether.resolution.VersionRangeResult;
import org.eclipse.aether.version.Version;
@@ -40,11 +39,9 @@ public class FindAvailableVersions
Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:[0,)" );
- RemoteRepository repo = Booter.newCentralRepository();
-
VersionRangeRequest rangeRequest = new VersionRangeRequest();
rangeRequest.setArtifact( artifact );
- rangeRequest.addRepository( repo );
+ rangeRequest.setRepositories( Booter.newRepositories( system, session ) );
VersionRangeResult rangeResult = system.resolveVersionRange( session, rangeRequest );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6d339b4c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
index e039232..48665fd 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
@@ -15,7 +15,6 @@ import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
-import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.VersionRangeRequest;
import org.eclipse.aether.resolution.VersionRangeResult;
import org.eclipse.aether.version.Version;
@@ -38,11 +37,9 @@ public class FindNewestVersion
Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:[0,)" );
- RemoteRepository repo = Booter.newCentralRepository();
-
VersionRangeRequest rangeRequest = new VersionRangeRequest();
rangeRequest.setArtifact( artifact );
- rangeRequest.addRepository( repo );
+ rangeRequest.setRepositories( Booter.newRepositories( system, session ) );
VersionRangeResult rangeResult = system.resolveVersionRange( session, rangeRequest );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6d339b4c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyHierarchy.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyHierarchy.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyHierarchy.java
index 2991714..015c922 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyHierarchy.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyHierarchy.java
@@ -18,7 +18,6 @@ import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.collection.CollectResult;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.examples.util.ConsoleDependencyGraphDumper;
-import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
import org.eclipse.aether.resolution.ArtifactDescriptorResult;
import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
@@ -45,17 +44,16 @@ public class GetDependencyHierarchy
Artifact artifact = new DefaultArtifact( "org.apache.maven:maven-aether-provider:3.1.0" );
- RemoteRepository repo = Booter.newCentralRepository();
-
- ArtifactDescriptorResult descriptorResult =
- system.readArtifactDescriptor( session,
- new ArtifactDescriptorRequest().setArtifact( artifact ).addRepository( repo ) );
+ ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
+ descriptorRequest.setArtifact( artifact );
+ descriptorRequest.setRepositories( Booter.newRepositories( system, session ) );
+ ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor( session, descriptorRequest );
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRootArtifact( descriptorResult.getArtifact() );
collectRequest.setDependencies( descriptorResult.getDependencies() );
collectRequest.setManagedDependencies( descriptorResult.getManagedDependencies() );
- collectRequest.addRepository( repo );
+ collectRequest.setRepositories( descriptorRequest.getRepositories() );
CollectResult collectResult = system.collectDependencies( session, collectRequest );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6d339b4c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
index 0265895..7a1bf9e 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
@@ -19,7 +19,6 @@ import org.eclipse.aether.collection.CollectResult;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.examples.util.ConsoleDependencyGraphDumper;
import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.repository.RemoteRepository;
/**
* Collects the transitive dependencies of an artifact.
@@ -39,11 +38,9 @@ public class GetDependencyTree
Artifact artifact = new DefaultArtifact( "org.apache.maven:maven-aether-provider:3.1.0" );
- RemoteRepository repo = Booter.newCentralRepository();
-
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot( new Dependency( artifact, "" ) );
- collectRequest.addRepository( repo );
+ collectRequest.setRepositories( Booter.newRepositories( system, session ) );
CollectResult collectResult = system.collectDependencies( session, collectRequest );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6d339b4c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
index bb70025..6378a4d 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
@@ -16,7 +16,6 @@ import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
import org.eclipse.aether.resolution.ArtifactDescriptorResult;
@@ -38,11 +37,9 @@ public class GetDirectDependencies
Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.M3" );
- RemoteRepository repo = Booter.newCentralRepository();
-
ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
descriptorRequest.setArtifact( artifact );
- descriptorRequest.addRepository( repo );
+ descriptorRequest.setRepositories( Booter.newRepositories( system, session ) );
ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor( session, descriptorRequest );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6d339b4c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
index 655678d..beccdd0 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
@@ -15,7 +15,6 @@ import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
-import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResult;
@@ -37,11 +36,9 @@ public class ResolveArtifact
Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:0.9.0.M3" );
- RemoteRepository repo = Booter.newCentralRepository();
-
ArtifactRequest artifactRequest = new ArtifactRequest();
artifactRequest.setArtifact( artifact );
- artifactRequest.addRepository( repo );
+ artifactRequest.setRepositories( Booter.newRepositories( system, session ) );
ArtifactResult artifactResult = system.resolveArtifact( session, artifactRequest );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6d339b4c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
index fbf9489..1596f5e 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
@@ -20,7 +20,6 @@ import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.graph.DependencyFilter;
-import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactResult;
import org.eclipse.aether.resolution.DependencyRequest;
import org.eclipse.aether.util.artifact.JavaScopes;
@@ -44,13 +43,11 @@ public class ResolveTransitiveDependencies
Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.M3" );
- RemoteRepository repo = Booter.newCentralRepository();
-
DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter( JavaScopes.COMPILE );
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot( new Dependency( artifact, JavaScopes.COMPILE ) );
- collectRequest.addRepository( repo );
+ collectRequest.setRepositories( Booter.newRepositories( system, session ) );
DependencyRequest dependencyRequest = new DependencyRequest( collectRequest, classpathFlter );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6d339b4c/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
index 5911ed6..7ea82d5 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
@@ -10,9 +10,14 @@
*******************************************************************************/
package org.eclipse.aether.examples.util;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
@@ -45,9 +50,14 @@ public class Booter
return session;
}
- public static RemoteRepository newCentralRepository()
+ public static List<RemoteRepository> newRepositories( RepositorySystem system, RepositorySystemSession session )
+ {
+ return new ArrayList<RemoteRepository>( Arrays.asList( newCentralRepository() ) );
+ }
+
+ private static RemoteRepository newCentralRepository()
{
- return new RemoteRepository.Builder( "central", "default", "http://repo1.maven.org/maven2/" ).build();
+ return new RemoteRepository.Builder( "central", "default", "http://central.maven.org/maven2/" ).build();
}
}
[14/36] maven-aether git commit: Accounted for change in aether-api
regarding local repo contruction
Posted by hb...@apache.org.
Accounted for change in aether-api regarding local repo contruction
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/ccb79b21
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/ccb79b21
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/ccb79b21
Branch: refs/heads/demo
Commit: ccb79b21a04bb230a425a9399cd912a9e75c71a3
Parents: 0e2353e
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Feb 16 17:15:49 2013 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Feb 16 17:15:49 2013 +0100
----------------------------------------------------------------------
.../src/main/java/org/eclipse/aether/examples/aether/Aether.java | 4 ++--
.../src/main/java/org/eclipse/aether/examples/util/Booter.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/ccb79b21/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
index 6aee749..73c8b26 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -53,7 +53,7 @@ public class Aether
private RepositorySystemSession newSession()
{
DefaultRepositorySystemSession session = Booter.newRepositorySystemSession( repositorySystem );
- session.setLocalRepositoryManager( repositorySystem.newLocalRepositoryManager( localRepository ) );
+ session.setLocalRepositoryManager( repositorySystem.newLocalRepositoryManager( session, localRepository ) );
return session;
}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/ccb79b21/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
index bd0171a..c907903 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,7 +33,7 @@ public class Booter
MavenRepositorySystemSession session = new MavenRepositorySystemSession();
LocalRepository localRepo = new LocalRepository( "target/local-repo" );
- session.setLocalRepositoryManager( system.newLocalRepositoryManager( localRepo ) );
+ session.setLocalRepositoryManager( system.newLocalRepositoryManager( session, localRepo ) );
session.setTransferListener( new ConsoleTransferListener() );
session.setRepositoryListener( new ConsoleRepositoryListener() );
[19/36] maven-aether git commit: Updated to
org.eclipse.sisu.plexus:0.0.0.M3
Posted by hb...@apache.org.
Updated to org.eclipse.sisu.plexus:0.0.0.M3
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/ec181dc6
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/ec181dc6
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/ec181dc6
Branch: refs/heads/demo
Commit: ec181dc661697cf1f31ca595d977f9f722c2965f
Parents: f97cf33
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Jun 22 12:19:45 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Jun 22 12:19:45 2013 +0200
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/ec181dc6/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 534cc3b..c91d19e 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -97,25 +97,17 @@
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
- <version>0.0.0.M2a</version>
+ <version>0.0.0.M3</version>
<optional>true</optional>
<exclusions>
<exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.sisu</groupId>
- <artifactId>sisu-guice</artifactId>
- </exclusion>
- <exclusion>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -129,6 +121,10 @@
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-guava</artifactId>
+ </exclusion>
</exclusions>
</dependency>
</dependencies>
[22/36] maven-aether git commit: Updated examples to use 0.9.0.M3
Posted by hb...@apache.org.
Updated examples to use 0.9.0.M3
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/4af49166
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/4af49166
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/4af49166
Branch: refs/heads/demo
Commit: 4af491666897db0a59f494ef696477ba19322a6b
Parents: 6a4d914
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Wed Jul 31 23:02:40 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Wed Jul 31 23:02:40 2013 +0200
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 21 ++++-------
.../aether/examples/guice/DemoAetherModule.java | 32 +++++++++-------
.../manual/ManualRepositorySystemFactory.java | 16 ++++----
.../manual/ManualWagonConfigurator.java | 26 -------------
.../examples/manual/ManualWagonProvider.java | 39 --------------------
5 files changed, 36 insertions(+), 98 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/4af49166/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 71adc0a..7f45888 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -28,7 +28,7 @@
</description>
<properties>
- <aetherVersion>0.9.0.M2</aetherVersion>
+ <aetherVersion>0.9.0.M3</aetherVersion>
<mavenVersion>3.1.0</mavenVersion>
<wagonVersion>1.0</wagonVersion>
</properties>
@@ -71,12 +71,17 @@
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
- <artifactId>aether-connector-file</artifactId>
+ <artifactId>aether-connector-basic</artifactId>
<version>${aetherVersion}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
- <artifactId>aether-connector-wagon</artifactId>
+ <artifactId>aether-transport-file</artifactId>
+ <version>${aetherVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-transport-http</artifactId>
<version>${aetherVersion}</version>
</dependency>
<dependency>
@@ -85,16 +90,6 @@
<version>${mavenVersion}</version>
</dependency>
<dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-provider-api</artifactId>
- <version>${wagonVersion}</version>
- </dependency>
- <dependency>
- <groupId>org.sonatype.maven</groupId>
- <artifactId>wagon-ahc</artifactId>
- <version>1.2.1</version>
- </dependency>
- <dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>0.0.0.M3</version>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/4af49166/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/DemoAetherModule.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/DemoAetherModule.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/DemoAetherModule.java
index be2b5d7..d05b28d 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/DemoAetherModule.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/DemoAetherModule.java
@@ -18,13 +18,11 @@ import javax.inject.Named;
import javax.inject.Singleton;
import org.apache.maven.repository.internal.MavenAetherModule;
-import org.eclipse.aether.connector.file.FileRepositoryConnectorFactory;
-import org.eclipse.aether.connector.wagon.WagonConfigurator;
-import org.eclipse.aether.connector.wagon.WagonProvider;
-import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
-import org.eclipse.aether.examples.manual.ManualWagonConfigurator;
-import org.eclipse.aether.examples.manual.ManualWagonProvider;
+import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
+import org.eclipse.aether.spi.connector.transport.TransporterFactory;
+import org.eclipse.aether.transport.file.FileTransporterFactory;
+import org.eclipse.aether.transport.http.HttpTransporterFactory;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
@@ -39,20 +37,28 @@ class DemoAetherModule
{
install( new MavenAetherModule() );
// alternatively, use the Guice Multibindings extensions
- bind( RepositoryConnectorFactory.class ).annotatedWith( Names.named( "file" ) ).to( FileRepositoryConnectorFactory.class );
- bind( RepositoryConnectorFactory.class ).annotatedWith( Names.named( "wagon" ) ).to( WagonRepositoryConnectorFactory.class );
- bind( WagonProvider.class ).to( ManualWagonProvider.class );
- bind( WagonConfigurator.class ).to( ManualWagonConfigurator.class );
+ bind( RepositoryConnectorFactory.class ).annotatedWith( Names.named( "basic" ) ).to( BasicRepositoryConnectorFactory.class );
+ bind( TransporterFactory.class ).annotatedWith( Names.named( "file" ) ).to( FileTransporterFactory.class );
+ bind( TransporterFactory.class ).annotatedWith( Names.named( "http" ) ).to( HttpTransporterFactory.class );
}
@Provides
@Singleton
- Set<RepositoryConnectorFactory> provideRepositoryConnectorFactories( @Named( "file" ) RepositoryConnectorFactory file,
- @Named( "wagon" ) RepositoryConnectorFactory wagon )
+ Set<RepositoryConnectorFactory> provideRepositoryConnectorFactories( @Named( "basic" ) RepositoryConnectorFactory basic )
{
Set<RepositoryConnectorFactory> factories = new HashSet<RepositoryConnectorFactory>();
+ factories.add( basic );
+ return Collections.unmodifiableSet( factories );
+ }
+
+ @Provides
+ @Singleton
+ Set<TransporterFactory> provideTransporterFactories( @Named( "file" ) TransporterFactory file,
+ @Named( "http" ) TransporterFactory http )
+ {
+ Set<TransporterFactory> factories = new HashSet<TransporterFactory>();
factories.add( file );
- factories.add( wagon );
+ factories.add( http );
return Collections.unmodifiableSet( factories );
}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/4af49166/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
index 8307ee0..8b605d7 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
@@ -12,11 +12,12 @@ package org.eclipse.aether.examples.manual;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.connector.file.FileRepositoryConnectorFactory;
-import org.eclipse.aether.connector.wagon.WagonProvider;
-import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
+import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
import org.eclipse.aether.impl.DefaultServiceLocator;
import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
+import org.eclipse.aether.spi.connector.transport.TransporterFactory;
+import org.eclipse.aether.transport.file.FileTransporterFactory;
+import org.eclipse.aether.transport.http.HttpTransporterFactory;
/**
* A factory for repository system instances that employs Aether's built-in service locator infrastructure to wire up
@@ -29,12 +30,13 @@ public class ManualRepositorySystemFactory
{
/*
* Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
- * prepopulated DefaultServiceLocator, we only need to register the repository connector factories.
+ * prepopulated DefaultServiceLocator, we only need to register the repository connector and transporter
+ * factories.
*/
DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
- locator.addService( RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class );
- locator.addService( RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class );
- locator.setServices( WagonProvider.class, new ManualWagonProvider() );
+ locator.addService( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );
+ locator.addService( TransporterFactory.class, FileTransporterFactory.class );
+ locator.addService( TransporterFactory.class, HttpTransporterFactory.class );
return locator.getService( RepositorySystem.class );
}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/4af49166/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonConfigurator.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonConfigurator.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonConfigurator.java
deleted file mode 100644
index c2f531a..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonConfigurator.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.examples.manual;
-
-import org.apache.maven.wagon.Wagon;
-import org.eclipse.aether.connector.wagon.WagonConfigurator;
-
-public class ManualWagonConfigurator
- implements WagonConfigurator
-{
-
- public void configure( Wagon wagon, Object configuration )
- throws Exception
- {
- // no-op
- }
-
-}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/4af49166/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonProvider.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonProvider.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonProvider.java
deleted file mode 100644
index 3533e88..0000000
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.aether.examples.manual;
-
-import org.apache.maven.wagon.Wagon;
-import org.eclipse.aether.connector.wagon.WagonProvider;
-import org.sonatype.maven.wagon.AhcWagon;
-
-/**
- * A simplistic provider for wagon instances when no Plexus-compatible IoC container is used.
- */
-public class ManualWagonProvider
- implements WagonProvider
-{
-
- public Wagon lookup( String roleHint )
- throws Exception
- {
- if ( "http".equals( roleHint ) )
- {
- return new AhcWagon();
- }
- return null;
- }
-
- public void release( Wagon wagon )
- {
-
- }
-
-}
[10/36] maven-aether git commit: Accounted for refactoring of
authentication bits in aether-api
Posted by hb...@apache.org.
Accounted for refactoring of authentication bits in aether-api
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/40100e3d
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/40100e3d
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/40100e3d
Branch: refs/heads/demo
Commit: 40100e3dca17a2a3c4c7228f2bfc9f1657db8f65
Parents: 119d55c
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Mon Sep 17 00:22:57 2012 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Mon Sep 17 00:22:57 2012 +0200
----------------------------------------------------------------------
.../src/main/java/org/eclipse/aether/examples/aether/Aether.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/40100e3d/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
index 901ad9f..c1f3f4f 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/aether/Aether.java
@@ -33,6 +33,7 @@ import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.DependencyRequest;
import org.eclipse.aether.resolution.DependencyResolutionException;
import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator;
+import org.eclipse.aether.util.repository.AuthenticationBuilder;
public class Aether
{
@@ -99,7 +100,7 @@ public class Aether
RepositorySystemSession session = newSession();
RemoteRepository nexus = new RemoteRepository( "nexus", "default", remoteRepository );
- Authentication authentication = new Authentication( "admin", "admin123" );
+ Authentication authentication = new AuthenticationBuilder().username( "admin" ).password( "admin123" ).build();
nexus.setAuthentication( authentication );
DeployRequest deployRequest = new DeployRequest();
[15/36] maven-aether git commit: Bug 406212 - aether-demo does not
compile because of renaming of packages
Posted by hb...@apache.org.
Bug 406212 - aether-demo does not compile because of renaming of packages
Updated to io.tesla.maven:maven-aether-provider:3.1.0
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/276cf13d
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/276cf13d
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/276cf13d
Branch: refs/heads/demo
Commit: 276cf13d2d697f10e3999bc328d47f3d936c26fe
Parents: ccb79b2
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Tue Apr 23 00:37:37 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Tue Apr 23 00:37:37 2013 +0200
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 24 +++-----------------
.../manual/ManualRepositorySystemFactory.java | 7 +++---
.../eclipse/aether/examples/util/Booter.java | 8 +++----
3 files changed, 11 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/276cf13d/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index f6aaff3..49e2699 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- ~ Copyright (c) 2010, 2011 Sonatype, Inc.
+ ~ Copyright (c) 2010, 2013 Sonatype, Inc.
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the Eclipse Public License v1.0
~ which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@
<properties>
<aetherVersion>0.9.0-SNAPSHOT</aetherVersion>
- <mavenVersion>3.0.3</mavenVersion>
+ <mavenVersion>3.1.0</mavenVersion>
<wagonVersion>1.0</wagonVersion>
</properties>
@@ -80,27 +80,9 @@
<version>${aetherVersion}</version>
</dependency>
<dependency>
- <groupId>org.apache.maven</groupId>
+ <groupId>io.tesla.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<version>${mavenVersion}</version>
- <exclusions>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-impl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-util</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-api</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/276cf13d/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
index 6dfa2cd..8307ee0 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualRepositorySystemFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,12 @@
*******************************************************************************/
package org.eclipse.aether.examples.manual;
-import org.apache.maven.repository.internal.DefaultServiceLocator;
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.connector.file.FileRepositoryConnectorFactory;
import org.eclipse.aether.connector.wagon.WagonProvider;
import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
+import org.eclipse.aether.impl.DefaultServiceLocator;
import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
/**
@@ -30,7 +31,7 @@ public class ManualRepositorySystemFactory
* Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
* prepopulated DefaultServiceLocator, we only need to register the repository connector factories.
*/
- DefaultServiceLocator locator = new DefaultServiceLocator();
+ DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
locator.addService( RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class );
locator.addService( RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class );
locator.setServices( WagonProvider.class, new ManualWagonProvider() );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/276cf13d/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
index c907903..2ec33f5 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
@@ -10,10 +10,9 @@
*******************************************************************************/
package org.eclipse.aether.examples.util;
-import org.apache.maven.repository.internal.MavenRepositorySystemSession;
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.examples.manual.ManualRepositorySystemFactory;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
@@ -25,12 +24,13 @@ public class Booter
public static RepositorySystem newRepositorySystem()
{
- return ManualRepositorySystemFactory.newRepositorySystem();
+ return org.eclipse.aether.examples.manual.ManualRepositorySystemFactory.newRepositorySystem();
+ // return org.eclipse.aether.examples.plexus.PlexusRepositorySystemFactory.newRepositorySystem();
}
public static DefaultRepositorySystemSession newRepositorySystemSession( RepositorySystem system )
{
- MavenRepositorySystemSession session = new MavenRepositorySystemSession();
+ DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository( "target/local-repo" );
session.setLocalRepositoryManager( system.newLocalRepositoryManager( session, localRepo ) );
[05/36] maven-aether git commit: Removed superfluous property
forgeReleaseUrl, the demos are source-only examples and never released
Posted by hb...@apache.org.
Removed superfluous property forgeReleaseUrl, the demos are source-only examples and never released
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/1e1e9def
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/1e1e9def
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/1e1e9def
Branch: refs/heads/demo
Commit: 1e1e9def92cdf429647a47ee6771114736207da4
Parents: e86cfec
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Nov 6 21:03:17 2011 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Nov 6 21:03:17 2011 +0100
----------------------------------------------------------------------
aether-demo-maven-plugin/pom.xml | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/1e1e9def/aether-demo-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/pom.xml b/aether-demo-maven-plugin/pom.xml
index f947c29..0f546b9 100644
--- a/aether-demo-maven-plugin/pom.xml
+++ b/aether-demo-maven-plugin/pom.xml
@@ -36,7 +36,6 @@
<properties>
<mavenVersion>3.0</mavenVersion>
<aetherVersion>0.9.0-SNAPSHOT</aetherVersion>
- <forgeReleaseUrl>https://repository.sonatype.org/service/local/staging/deploy/maven2</forgeReleaseUrl>
</properties>
<dependencies>
[24/36] maven-aether git commit: Added example snippet demonstrating
verbose dependency graph aka m2e-like dependency hierarchy
Posted by hb...@apache.org.
Added example snippet demonstrating verbose dependency graph aka m2e-like dependency hierarchy
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/e4260601
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/e4260601
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/e4260601
Branch: refs/heads/demo
Commit: e426060176028c5a3aab1850c5fa74b73f68aace
Parents: bfcb0fd
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Aug 17 18:22:06 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Aug 17 18:22:06 2013 +0200
----------------------------------------------------------------------
.../eclipse/aether/examples/AllAetherDemos.java | 3 +-
.../aether/examples/GetDependencyHierarchy.java | 65 ++++++++++++++++++++
.../util/ConsoleDependencyGraphDumper.java | 49 ++++++++++++++-
3 files changed, 115 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e4260601/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/AllAetherDemos.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/AllAetherDemos.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/AllAetherDemos.java
index bb85d29..b53079b 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/AllAetherDemos.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/AllAetherDemos.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@ public class AllAetherDemos
FindNewestVersion.main( args );
GetDirectDependencies.main( args );
GetDependencyTree.main( args );
+ GetDependencyHierarchy.main( args );
ResolveArtifact.main( args );
ResolveTransitiveDependencies.main( args );
InstallArtifacts.main( args );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e4260601/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyHierarchy.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyHierarchy.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyHierarchy.java
new file mode 100644
index 0000000..2991714
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyHierarchy.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples;
+
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.collection.CollectResult;
+import org.eclipse.aether.examples.util.Booter;
+import org.eclipse.aether.examples.util.ConsoleDependencyGraphDumper;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
+import org.eclipse.aether.resolution.ArtifactDescriptorResult;
+import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
+import org.eclipse.aether.util.graph.transformer.ConflictResolver;
+
+/**
+ * Visualizes the transitive dependencies of an artifact similar to m2e's dependency hierarchy view.
+ */
+public class GetDependencyHierarchy
+{
+
+ public static void main( String[] args )
+ throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( GetDependencyHierarchy.class.getSimpleName() );
+
+ RepositorySystem system = Booter.newRepositorySystem();
+
+ DefaultRepositorySystemSession session = Booter.newRepositorySystemSession( system );
+
+ session.setConfigProperty( ConflictResolver.CONFIG_PROP_VERBOSE, true );
+ session.setConfigProperty( DependencyManagerUtils.CONFIG_PROP_VERBOSE, true );
+
+ Artifact artifact = new DefaultArtifact( "org.apache.maven:maven-aether-provider:3.1.0" );
+
+ RemoteRepository repo = Booter.newCentralRepository();
+
+ ArtifactDescriptorResult descriptorResult =
+ system.readArtifactDescriptor( session,
+ new ArtifactDescriptorRequest().setArtifact( artifact ).addRepository( repo ) );
+
+ CollectRequest collectRequest = new CollectRequest();
+ collectRequest.setRootArtifact( descriptorResult.getArtifact() );
+ collectRequest.setDependencies( descriptorResult.getDependencies() );
+ collectRequest.setManagedDependencies( descriptorResult.getManagedDependencies() );
+ collectRequest.addRepository( repo );
+
+ CollectResult collectResult = system.collectDependencies( session, collectRequest );
+
+ collectResult.getRoot().accept( new ConsoleDependencyGraphDumper() );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/e4260601/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
index 254b200..b829990 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
@@ -15,8 +15,13 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.aether.graph.DependencyVisitor;
+import org.eclipse.aether.util.artifact.ArtifactIdUtils;
+import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
+import org.eclipse.aether.util.graph.transformer.ConflictResolver;
/**
* A dependency visitor that dumps the graph to the console.
@@ -58,7 +63,49 @@ public class ConsoleDependencyGraphDumper
private String formatNode( DependencyNode node )
{
- return String.valueOf( node );
+ StringBuilder buffer = new StringBuilder( 128 );
+ Artifact a = node.getArtifact();
+ Dependency d = node.getDependency();
+ buffer.append( a );
+ if ( d != null && d.getScope().length() > 0 )
+ {
+ buffer.append( " [" ).append( d.getScope() );
+ if ( d.isOptional() )
+ {
+ buffer.append( ", optional" );
+ }
+ buffer.append( "]" );
+ }
+ {
+ String premanaged = DependencyManagerUtils.getPremanagedVersion( node );
+ if ( premanaged != null && !premanaged.equals( a.getBaseVersion() ) )
+ {
+ buffer.append( " (version managed from " ).append( premanaged ).append( ")" );
+ }
+ }
+ {
+ String premanaged = DependencyManagerUtils.getPremanagedScope( node );
+ if ( premanaged != null && !premanaged.equals( d.getScope() ) )
+ {
+ buffer.append( " (scope managed from " ).append( premanaged ).append( ")" );
+ }
+ }
+ DependencyNode winner = (DependencyNode) node.getData().get( ConflictResolver.NODE_DATA_WINNER );
+ if ( winner != null && !ArtifactIdUtils.equalsId( a, winner.getArtifact() ) )
+ {
+ Artifact w = winner.getArtifact();
+ buffer.append( " (conflicts with " );
+ if ( ArtifactIdUtils.toVersionlessId( a ).equals( ArtifactIdUtils.toVersionlessId( w ) ) )
+ {
+ buffer.append( w.getVersion() );
+ }
+ else
+ {
+ buffer.append( w );
+ }
+ buffer.append( ")" );
+ }
+ return buffer.toString();
}
public boolean visitLeave( DependencyNode node )
[29/36] maven-aether git commit: Updated demos to use aether:0.9.0.M4
Posted by hb...@apache.org.
Updated demos to use aether:0.9.0.M4
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/8a40c2a4
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/8a40c2a4
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/8a40c2a4
Branch: refs/heads/demo
Commit: 8a40c2a440b9afafcf1b43dc1fb4b4223cbb142d
Parents: c58f348
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Jan 18 13:57:32 2014 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Jan 18 13:57:32 2014 +0100
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/8a40c2a4/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 11e1a0c..5ba8fa0 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -28,7 +28,7 @@
</description>
<properties>
- <aetherVersion>0.9.0.M3</aetherVersion>
+ <aetherVersion>0.9.0.M4</aetherVersion>
<mavenVersion>3.1.0</mavenVersion>
</properties>
[21/36] maven-aether git commit: Updated to
org.apache.maven:maven-aether-provider:3.1.0
Posted by hb...@apache.org.
Updated to org.apache.maven:maven-aether-provider:3.1.0
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/6a4d9145
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/6a4d9145
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/6a4d9145
Branch: refs/heads/demo
Commit: 6a4d91451fa8a25a9a410dc48a7c500885ece6b3
Parents: 5f0c0e8
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Jul 27 13:26:09 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Jul 27 13:26:09 2013 +0200
----------------------------------------------------------------------
aether-demo-maven-plugin/pom.xml | 12 ++++++------
aether-demo-snippets/pom.xml | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6a4d9145/aether-demo-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/pom.xml b/aether-demo-maven-plugin/pom.xml
index 0f546b9..85a6209 100644
--- a/aether-demo-maven-plugin/pom.xml
+++ b/aether-demo-maven-plugin/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- ~ Copyright (c) 2010, 2011 Sonatype, Inc.
+ ~ Copyright (c) 2010, 2013 Sonatype, Inc.
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the Eclipse Public License v1.0
~ which accompanies this distribution, and is available at
@@ -30,12 +30,12 @@
<inceptionYear>2010</inceptionYear>
<prerequisites>
- <maven>3.0.4</maven>
+ <maven>3.1.0</maven>
</prerequisites>
<properties>
- <mavenVersion>3.0</mavenVersion>
- <aetherVersion>0.9.0-SNAPSHOT</aetherVersion>
+ <mavenVersion>3.1.0</mavenVersion>
+ <aetherVersion>0.9.0.M2</aetherVersion>
</properties>
<dependencies>
@@ -53,8 +53,8 @@
<artifactId>maven-artifact</artifactId>
</exclusion>
<exclusion>
- <groupId>org.sonatype.sisu</groupId>
- <artifactId>sisu-inject-plexus</artifactId>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>org.eclipse.sisu.plexus</artifactId>
</exclusion>
</exclusions>
</dependency>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6a4d9145/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index c91d19e..71adc0a 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -80,7 +80,7 @@
<version>${aetherVersion}</version>
</dependency>
<dependency>
- <groupId>io.tesla.maven</groupId>
+ <groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<version>${mavenVersion}</version>
</dependency>
[06/36] maven-aether git commit: Fixed pathname to demo.jar used
during install/deploy examples
Posted by hb...@apache.org.
Fixed pathname to demo.jar used during install/deploy examples
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/5fda1c97
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/5fda1c97
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/5fda1c97
Branch: refs/heads/demo
Commit: 5fda1c97e9497138785049de73510ad5c45faa55
Parents: 1e1e9de
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Nov 13 15:22:02 2011 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Nov 13 15:22:02 2011 +0100
----------------------------------------------------------------------
.../src/main/java/org/eclipse/aether/examples/DeployArtifacts.java | 2 +-
.../main/java/org/eclipse/aether/examples/InstallArtifacts.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/5fda1c97/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
index 916c3bf..c905415 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
@@ -39,7 +39,7 @@ public class DeployArtifacts
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.examples", "", "jar", "0.1-SNAPSHOT" );
- jarArtifact = jarArtifact.setFile( new File( "org.eclipse.aether.examples.jar" ) );
+ jarArtifact = jarArtifact.setFile( new File( "demo.jar" ) );
Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/5fda1c97/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
index f0ecf11..5871b2a 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
@@ -38,7 +38,7 @@ public class InstallArtifacts
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.examples", "", "jar", "0.1-SNAPSHOT" );
- jarArtifact = jarArtifact.setFile( new File( "org.eclipse.aether.examples.jar" ) );
+ jarArtifact = jarArtifact.setFile( new File( "demo.jar" ) );
Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
[35/36] maven-aether git commit: Updated examples to aether-core:1.0.0
Posted by hb...@apache.org.
Updated examples to aether-core:1.0.0
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/7648a2b3
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/7648a2b3
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/7648a2b3
Branch: refs/heads/demo
Commit: 7648a2b353652b00ed6bcc9d2daf5d1d65898b97
Parents: c27ef36
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat May 24 17:50:38 2014 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat May 24 17:50:38 2014 +0200
----------------------------------------------------------------------
aether-demo-maven-plugin/pom.xml | 4 ++--
aether-demo-snippets/pom.xml | 4 ++--
.../java/org/eclipse/aether/examples/GetDirectDependencies.java | 2 +-
.../main/java/org/eclipse/aether/examples/ResolveArtifact.java | 2 +-
.../eclipse/aether/examples/ResolveTransitiveDependencies.java | 2 +-
pom.xml | 4 ++--
6 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/7648a2b3/aether-demo-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/pom.xml b/aether-demo-maven-plugin/pom.xml
index 46b4cdf..969654c 100644
--- a/aether-demo-maven-plugin/pom.xml
+++ b/aether-demo-maven-plugin/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- ~ Copyright (c) 2010, 2013 Sonatype, Inc.
+ ~ Copyright (c) 2010, 2014 Sonatype, Inc.
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the Eclipse Public License v1.0
~ which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@
<parent>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-demos</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>aether-demo-maven-plugin</artifactId>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/7648a2b3/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 0600c2b..57d1a70 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-demos</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>aether-demo-snippets</artifactId>
@@ -28,7 +28,7 @@
</description>
<properties>
- <aetherVersion>0.9.0.v20140226</aetherVersion>
+ <aetherVersion>1.0.0.v20140518</aetherVersion>
<mavenVersion>3.1.0</mavenVersion>
</properties>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/7648a2b3/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
index 4c24e0a..7cccdea 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
@@ -35,7 +35,7 @@ public class GetDirectDependencies
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.v20140226" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:1.0.0.v20140518" );
ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
descriptorRequest.setArtifact( artifact );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/7648a2b3/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
index fd67d53..67ffc4e 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
@@ -34,7 +34,7 @@ public class ResolveArtifact
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:0.9.0.v20140226" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:1.0.0.v20140518" );
ArtifactRequest artifactRequest = new ArtifactRequest();
artifactRequest.setArtifact( artifact );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/7648a2b3/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
index 7108a1c..4152b8a 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
@@ -41,7 +41,7 @@ public class ResolveTransitiveDependencies
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.v20140226" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:1.0.0.v20140518" );
DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter( JavaScopes.COMPILE );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/7648a2b3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d9378c3..11521cd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- ~ Copyright (c) 2010, 2013 Sonatype, Inc.
+ ~ Copyright (c) 2010, 2014 Sonatype, Inc.
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the Eclipse Public License v1.0
~ which accompanies this distribution, and is available at
@@ -22,7 +22,7 @@
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-demos</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Aether Demos</name>
[18/36] maven-aether git commit: Updated to
org.eclipse.sisu.plexus:0.0.0.M2a
Posted by hb...@apache.org.
Updated to org.eclipse.sisu.plexus:0.0.0.M2a
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/f97cf33d
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/f97cf33d
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/f97cf33d
Branch: refs/heads/demo
Commit: f97cf33ddcd3d30c30f2c3f6aa4049ef2dd9207d
Parents: ea84e05
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Jun 1 16:55:28 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Jun 1 16:55:28 2013 +0200
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/f97cf33d/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 6d8c1c8..534cc3b 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -97,7 +97,7 @@
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
- <version>0.0.0.M1</version>
+ <version>0.0.0.M2a</version>
<optional>true</optional>
<exclusions>
<exclusion>
@@ -112,6 +112,10 @@
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-guice</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
[23/36] maven-aether git commit: Polished example code
Posted by hb...@apache.org.
Polished example code
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/bfcb0fd1
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/bfcb0fd1
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/bfcb0fd1
Branch: refs/heads/demo
Commit: bfcb0fd12d2425f5c423e88ad013a7f7b84078bb
Parents: 4af4916
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Aug 17 16:21:14 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Aug 17 16:21:14 2013 +0200
----------------------------------------------------------------------
aether-demo-maven-plugin/pom.xml | 3 +-
.../examples/maven/ResolveArtifactMojo.java | 4 +-
.../aether/examples/FindAvailableVersions.java | 4 +-
.../aether/examples/FindNewestVersion.java | 4 +-
.../aether/examples/GetDependencyTree.java | 4 +-
.../aether/examples/GetDirectDependencies.java | 4 +-
.../aether/examples/ResolveArtifact.java | 4 +-
.../examples/ResolveTransitiveDependencies.java | 4 +-
.../util/ConsoleDependencyGraphDumper.java | 62 ++++++++++++++++----
.../examples/util/ConsoleTransferListener.java | 11 +++-
10 files changed, 77 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/pom.xml b/aether-demo-maven-plugin/pom.xml
index 85a6209..46b4cdf 100644
--- a/aether-demo-maven-plugin/pom.xml
+++ b/aether-demo-maven-plugin/pom.xml
@@ -30,7 +30,7 @@
<inceptionYear>2010</inceptionYear>
<prerequisites>
- <maven>3.1.0</maven>
+ <maven>3.1.0-alpha-1</maven>
</prerequisites>
<properties>
@@ -43,6 +43,7 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${mavenVersion}</version>
+ <scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.apache.maven</groupId>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
----------------------------------------------------------------------
diff --git a/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java b/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
index bd6d2c8..1039bc1 100644
--- a/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
+++ b/aether-demo-maven-plugin/src/main/java/org/eclipse/aether/examples/maven/ResolveArtifactMojo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,6 +25,8 @@ import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult;
/**
+ * Resolves a single artifact (not including its transitive dependencies).
+ *
* @goal resolve-artifact
*/
public class ResolveArtifactMojo
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
index 772445a..be309b0 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindAvailableVersions.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -38,7 +38,7 @@ public class FindAvailableVersions
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:[0,)" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:[0,)" );
RemoteRepository repo = Booter.newCentralRepository();
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
index fa7b38f..e039232 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/FindNewestVersion.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,7 +36,7 @@ public class FindNewestVersion
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:[0,)" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:[0,)" );
RemoteRepository repo = Booter.newCentralRepository();
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
index 8c88348..0265895 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@ public class GetDependencyTree
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.apache.maven:maven-aether-provider:3.0.2" );
+ Artifact artifact = new DefaultArtifact( "org.apache.maven:maven-aether-provider:3.1.0" );
RemoteRepository repo = Booter.newCentralRepository();
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
index 3fafb7e..bb70025 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,7 +36,7 @@ public class GetDirectDependencies
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-impl:1.13" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.M3" );
RemoteRepository repo = Booter.newCentralRepository();
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
index bcc8aa1..655678d 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,7 +35,7 @@ public class ResolveArtifact
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-util:1.13" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:0.9.0.M3" );
RemoteRepository repo = Booter.newCentralRepository();
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
index 9cf7cc8..fbf9489 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,7 +42,7 @@ public class ResolveTransitiveDependencies
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.sonatype.aether:aether-impl:1.13" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.M3" );
RemoteRepository repo = Booter.newCentralRepository();
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
index 59867a3..254b200 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleDependencyGraphDumper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,9 @@
package org.eclipse.aether.examples.util;
import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.aether.graph.DependencyVisitor;
@@ -24,7 +27,7 @@ public class ConsoleDependencyGraphDumper
private PrintStream out;
- private String currentIndent = "";
+ private List<ChildInfo> childInfos = new ArrayList<ChildInfo>();
public ConsoleDependencyGraphDumper()
{
@@ -38,22 +41,61 @@ public class ConsoleDependencyGraphDumper
public boolean visitEnter( DependencyNode node )
{
- out.println( currentIndent + node );
- if ( currentIndent.length() <= 0 )
+ out.println( formatIndentation() + formatNode( node ) );
+ childInfos.add( new ChildInfo( node.getChildren().size() ) );
+ return true;
+ }
+
+ private String formatIndentation()
+ {
+ StringBuilder buffer = new StringBuilder( 128 );
+ for ( Iterator<ChildInfo> it = childInfos.iterator(); it.hasNext(); )
+ {
+ buffer.append( it.next().formatIndentation( !it.hasNext() ) );
+ }
+ return buffer.toString();
+ }
+
+ private String formatNode( DependencyNode node )
+ {
+ return String.valueOf( node );
+ }
+
+ public boolean visitLeave( DependencyNode node )
+ {
+ if ( !childInfos.isEmpty() )
{
- currentIndent = "+- ";
+ childInfos.remove( childInfos.size() - 1 );
}
- else
+ if ( !childInfos.isEmpty() )
{
- currentIndent = "| " + currentIndent;
+ childInfos.get( childInfos.size() - 1 ).index++;
}
return true;
}
- public boolean visitLeave( DependencyNode node )
+ private static class ChildInfo
{
- currentIndent = currentIndent.substring( 3, currentIndent.length() );
- return true;
+
+ final int count;
+
+ int index;
+
+ public ChildInfo( int count )
+ {
+ this.count = count;
+ }
+
+ public String formatIndentation( boolean end )
+ {
+ boolean last = index + 1 >= count;
+ if ( end )
+ {
+ return last ? "\\- " : "+- ";
+ }
+ return last ? " " : "| ";
+ }
+
}
}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/bfcb0fd1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleTransferListener.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleTransferListener.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleTransferListener.java
index f162975..b89329c 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleTransferListener.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/ConsoleTransferListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Sonatype, Inc.
+ * Copyright (c) 2010, 2013 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.aether.transfer.AbstractTransferListener;
+import org.eclipse.aether.transfer.MetadataNotFoundException;
import org.eclipse.aether.transfer.TransferEvent;
import org.eclipse.aether.transfer.TransferResource;
@@ -123,8 +124,9 @@ public class ConsoleTransferListener
long duration = System.currentTimeMillis() - resource.getTransferStartTime();
if ( duration > 0 )
{
+ long bytes = contentLength - resource.getResumeOffset();
DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) );
- double kbPerSec = ( contentLength / 1024.0 ) / ( duration / 1000.0 );
+ double kbPerSec = ( bytes / 1024.0 ) / ( duration / 1000.0 );
throughput = " at " + format.format( kbPerSec ) + " KB/sec";
}
@@ -138,7 +140,10 @@ public class ConsoleTransferListener
{
transferCompleted( event );
- event.getException().printStackTrace( out );
+ if ( !( event.getException() instanceof MetadataNotFoundException ) )
+ {
+ event.getException().printStackTrace( out );
+ }
}
private void transferCompleted( TransferEvent event )
[16/36] maven-aether git commit: Added GuiceRepositorySystemFactory
to demonstrate usage of JSR-330/Guice to wire components
Posted by hb...@apache.org.
Added GuiceRepositorySystemFactory to demonstrate usage of JSR-330/Guice to wire components
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/0a9b2a53
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/0a9b2a53
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/0a9b2a53
Branch: refs/heads/demo
Commit: 0a9b2a53bffbbaef70992dcdb243631f1bc8e48b
Parents: 276cf13
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Tue Apr 23 00:38:57 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Tue Apr 23 00:38:57 2013 +0200
----------------------------------------------------------------------
.../aether/examples/guice/DemoAetherModule.java | 59 ++++++++++++++++++++
.../guice/GuiceRepositorySystemFactory.java | 28 ++++++++++
.../manual/ManualWagonConfigurator.java | 26 +++++++++
.../eclipse/aether/examples/util/Booter.java | 1 +
4 files changed, 114 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/0a9b2a53/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/DemoAetherModule.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/DemoAetherModule.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/DemoAetherModule.java
new file mode 100644
index 0000000..be2b5d7
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/DemoAetherModule.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.guice;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import org.apache.maven.repository.internal.MavenAetherModule;
+import org.eclipse.aether.connector.file.FileRepositoryConnectorFactory;
+import org.eclipse.aether.connector.wagon.WagonConfigurator;
+import org.eclipse.aether.connector.wagon.WagonProvider;
+import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
+import org.eclipse.aether.examples.manual.ManualWagonConfigurator;
+import org.eclipse.aether.examples.manual.ManualWagonProvider;
+import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
+import com.google.inject.name.Names;
+
+class DemoAetherModule
+ extends AbstractModule
+{
+
+ @Override
+ protected void configure()
+ {
+ install( new MavenAetherModule() );
+ // alternatively, use the Guice Multibindings extensions
+ bind( RepositoryConnectorFactory.class ).annotatedWith( Names.named( "file" ) ).to( FileRepositoryConnectorFactory.class );
+ bind( RepositoryConnectorFactory.class ).annotatedWith( Names.named( "wagon" ) ).to( WagonRepositoryConnectorFactory.class );
+ bind( WagonProvider.class ).to( ManualWagonProvider.class );
+ bind( WagonConfigurator.class ).to( ManualWagonConfigurator.class );
+ }
+
+ @Provides
+ @Singleton
+ Set<RepositoryConnectorFactory> provideRepositoryConnectorFactories( @Named( "file" ) RepositoryConnectorFactory file,
+ @Named( "wagon" ) RepositoryConnectorFactory wagon )
+ {
+ Set<RepositoryConnectorFactory> factories = new HashSet<RepositoryConnectorFactory>();
+ factories.add( file );
+ factories.add( wagon );
+ return Collections.unmodifiableSet( factories );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/0a9b2a53/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/GuiceRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/GuiceRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/GuiceRepositorySystemFactory.java
new file mode 100644
index 0000000..37c8b95
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/guice/GuiceRepositorySystemFactory.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.guice;
+
+import org.eclipse.aether.RepositorySystem;
+
+import com.google.inject.Guice;
+
+/**
+ * A factory for repository system instances that employs JSR-330 via Guice to wire up the system's components.
+ */
+public class GuiceRepositorySystemFactory
+{
+
+ public static RepositorySystem newRepositorySystem()
+ {
+ return Guice.createInjector( new DemoAetherModule() ).getInstance( RepositorySystem.class );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/0a9b2a53/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonConfigurator.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonConfigurator.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonConfigurator.java
new file mode 100644
index 0000000..c2f531a
--- /dev/null
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/manual/ManualWagonConfigurator.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.aether.examples.manual;
+
+import org.apache.maven.wagon.Wagon;
+import org.eclipse.aether.connector.wagon.WagonConfigurator;
+
+public class ManualWagonConfigurator
+ implements WagonConfigurator
+{
+
+ public void configure( Wagon wagon, Object configuration )
+ throws Exception
+ {
+ // no-op
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/0a9b2a53/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
index 2ec33f5..5911ed6 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/util/Booter.java
@@ -25,6 +25,7 @@ public class Booter
public static RepositorySystem newRepositorySystem()
{
return org.eclipse.aether.examples.manual.ManualRepositorySystemFactory.newRepositorySystem();
+ // return org.eclipse.aether.examples.guice.GuiceRepositorySystemFactory.newRepositorySystem();
// return org.eclipse.aether.examples.plexus.PlexusRepositorySystemFactory.newRepositorySystem();
}
[32/36] maven-aether git commit: Updated demo to use aether:0.9.0
Posted by hb...@apache.org.
Updated demo to use aether:0.9.0
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/6a2d85e1
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/6a2d85e1
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/6a2d85e1
Branch: refs/heads/demo
Commit: 6a2d85e13c9f0de52b214f1ee9563c88c1f5c941
Parents: d8e8ae8
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sun Mar 2 13:39:07 2014 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sun Mar 2 13:39:07 2014 +0100
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 2 +-
.../eclipse/aether/examples/GetDirectDependencies.java | 4 ++--
.../org/eclipse/aether/examples/ResolveArtifact.java | 4 ++--
.../aether/examples/ResolveTransitiveDependencies.java | 4 ++--
.../examples/sisu/SisuRepositorySystemFactory.java | 13 -------------
5 files changed, 7 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6a2d85e1/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 4585a9f..0600c2b 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -28,7 +28,7 @@
</description>
<properties>
- <aetherVersion>0.9.0.M4</aetherVersion>
+ <aetherVersion>0.9.0.v20140226</aetherVersion>
<mavenVersion>3.1.0</mavenVersion>
</properties>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6a2d85e1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
index 6378a4d..4c24e0a 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Sonatype, Inc.
+ * Copyright (c) 2010, 2014 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,7 +35,7 @@ public class GetDirectDependencies
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.M3" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.v20140226" );
ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
descriptorRequest.setArtifact( artifact );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6a2d85e1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
index beccdd0..fd67d53 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Sonatype, Inc.
+ * Copyright (c) 2010, 2014 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,7 +34,7 @@ public class ResolveArtifact
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:0.9.0.M3" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-util:0.9.0.v20140226" );
ArtifactRequest artifactRequest = new ArtifactRequest();
artifactRequest.setArtifact( artifact );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6a2d85e1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
index 1596f5e..7108a1c 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Sonatype, Inc.
+ * Copyright (c) 2010, 2014 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,7 +41,7 @@ public class ResolveTransitiveDependencies
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
- Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.M3" );
+ Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:0.9.0.v20140226" );
DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter( JavaScopes.COMPILE );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/6a2d85e1/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/sisu/SisuRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/sisu/SisuRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/sisu/SisuRepositorySystemFactory.java
index 379261a..cbd3add 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/sisu/SisuRepositorySystemFactory.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/sisu/SisuRepositorySystemFactory.java
@@ -18,7 +18,6 @@ import org.apache.maven.model.building.DefaultModelBuilderFactory;
import org.apache.maven.model.building.ModelBuilder;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.sisu.launch.Main;
-import org.slf4j.ILoggerFactory;
/**
* A factory for repository system instances that employs Eclipse Sisu to wire up the system's components.
@@ -47,16 +46,4 @@ public class SisuRepositorySystemFactory
}
- @Named
- private static class LoggerFactoryProvider
- implements Provider<ILoggerFactory>
- {
-
- public ILoggerFactory get()
- {
- return org.slf4j.LoggerFactory.getILoggerFactory();
- }
-
- }
-
}
[17/36] maven-aether git commit: Made demos use last release of
Aether instead of SNAPSHOT
Posted by hb...@apache.org.
Made demos use last release of Aether instead of SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/ea84e055
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/ea84e055
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/ea84e055
Branch: refs/heads/demo
Commit: ea84e0552f669b4d660c1518eccb84e49c81d215
Parents: 0a9b2a5
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Tue Apr 23 00:48:56 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Tue Apr 23 00:48:56 2013 +0200
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/ea84e055/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 49e2699..6d8c1c8 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -28,7 +28,7 @@
</description>
<properties>
- <aetherVersion>0.9.0-SNAPSHOT</aetherVersion>
+ <aetherVersion>0.9.0.M2</aetherVersion>
<mavenVersion>3.1.0</mavenVersion>
<wagonVersion>1.0</wagonVersion>
</properties>
[13/36] maven-aether git commit: Moved demo.jar out of project root
into src/main/data
Posted by hb...@apache.org.
Moved demo.jar out of project root into src/main/data
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/0e2353ee
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/0e2353ee
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/0e2353ee
Branch: refs/heads/demo
Commit: 0e2353ee43429a00850552b2594f8e7fc767df13
Parents: 28e37e5
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Nov 3 19:04:02 2012 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Nov 3 19:04:02 2012 +0100
----------------------------------------------------------------------
aether-demo-snippets/demo.jar | Bin 345 -> 0 bytes
aether-demo-snippets/src/main/data/demo.jar | Bin 0 -> 345 bytes
.../org/eclipse/aether/examples/DeployArtifacts.java | 2 +-
.../eclipse/aether/examples/InstallArtifacts.java | 2 +-
4 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/0e2353ee/aether-demo-snippets/demo.jar
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/demo.jar b/aether-demo-snippets/demo.jar
deleted file mode 100644
index 5fcb2f7..0000000
Binary files a/aether-demo-snippets/demo.jar and /dev/null differ
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/0e2353ee/aether-demo-snippets/src/main/data/demo.jar
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/data/demo.jar b/aether-demo-snippets/src/main/data/demo.jar
new file mode 100644
index 0000000..5fcb2f7
Binary files /dev/null and b/aether-demo-snippets/src/main/data/demo.jar differ
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/0e2353ee/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
index b8757bb..6d8732b 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/DeployArtifacts.java
@@ -38,7 +38,7 @@ public class DeployArtifacts
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.examples", "", "jar", "0.1-SNAPSHOT" );
- jarArtifact = jarArtifact.setFile( new File( "demo.jar" ) );
+ jarArtifact = jarArtifact.setFile( new File( "src/main/data/demo.jar" ) );
Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/0e2353ee/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
index f5ba32a..0e0ff0f 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/InstallArtifacts.java
@@ -37,7 +37,7 @@ public class InstallArtifacts
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
Artifact jarArtifact = new DefaultArtifact( "test", "org.eclipse.aether.examples", "", "jar", "0.1-SNAPSHOT" );
- jarArtifact = jarArtifact.setFile( new File( "demo.jar" ) );
+ jarArtifact = jarArtifact.setFile( new File( "src/main/data/demo.jar" ) );
Artifact pomArtifact = new SubArtifact( jarArtifact, "", "pom" );
pomArtifact = pomArtifact.setFile( new File( "pom.xml" ) );
[20/36] maven-aether git commit: Added aether-demo-snippets as module
to root POM to ease project import into IDE
Posted by hb...@apache.org.
Added aether-demo-snippets as module to root POM to ease project import into IDE
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/5f0c0e80
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/5f0c0e80
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/5f0c0e80
Branch: refs/heads/demo
Commit: 5f0c0e8073e944836cfe884170cbd62a6dd250ef
Parents: ec181dc
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Mon Jul 15 19:25:22 2013 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Mon Jul 15 19:25:22 2013 +0200
----------------------------------------------------------------------
pom.xml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/5f0c0e80/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8e320e5..d9378c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- ~ Copyright (c) 2010, 2011 Sonatype, Inc.
+ ~ Copyright (c) 2010, 2013 Sonatype, Inc.
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the Eclipse Public License v1.0
~ which accompanies this distribution, and is available at
@@ -73,6 +73,10 @@
</license>
</licenses>
+ <modules>
+ <module>aether-demo-snippets</module>
+ </modules>
+
<properties>
<surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
</properties>
[12/36] maven-aether git commit: Updated to Eclipse Sisu
Posted by hb...@apache.org.
Updated to Eclipse Sisu
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/28e37e53
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/28e37e53
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/28e37e53
Branch: refs/heads/demo
Commit: 28e37e534ce36ae93d4767b930688126a602b916
Parents: 52f81d2
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat Nov 3 18:55:34 2012 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat Nov 3 18:55:34 2012 +0100
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 50 ++++++++++++++++++++++++++++++++++-----
1 file changed, 44 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/28e37e53/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 84e990f..f6aaff3 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -28,11 +28,26 @@
</description>
<properties>
- <aetherVersion>0.9.0-SNAPSHOT</aetherVersion>
+ <aetherVersion>0.9.0-SNAPSHOT</aetherVersion>
<mavenVersion>3.0.3</mavenVersion>
<wagonVersion>1.0</wagonVersion>
</properties>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.2</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<dependency>
<groupId>org.eclipse.aether</groupId>
@@ -98,14 +113,37 @@
<version>1.2.1</version>
</dependency>
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <version>2.1</version>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>org.eclipse.sisu.plexus</artifactId>
+ <version>0.0.0.M1</version>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>asm</groupId>
+ <artifactId>asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-guice</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.sonatype.sisu</groupId>
- <artifactId>sisu-inject-plexus</artifactId>
- <version>2.3.0</version>
+ <artifactId>sisu-guice</artifactId>
+ <version>3.1.0</version>
+ <classifier>no_aop</classifier>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>aopalliance</groupId>
+ <artifactId>aopalliance</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
</project>
[34/36] maven-aether git commit: Bug 433953 - Remove support for
Plexus IoC framework
Posted by hb...@apache.org.
Bug 433953 - Remove support for Plexus IoC framework
Tweaked Plexus demo to enable consumption of JSR-330 components
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/c27ef36f
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/c27ef36f
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/c27ef36f
Branch: refs/heads/demo
Commit: c27ef36f63c18cca3e742c7175a6959a647394a6
Parents: c901f56
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Thu May 1 22:58:37 2014 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Thu May 1 22:58:37 2014 +0200
----------------------------------------------------------------------
.../aether/examples/plexus/PlexusRepositorySystemFactory.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/c27ef36f/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
index 7f8fd6e..5090160 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/plexus/PlexusRepositorySystemFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Sonatype, Inc.
+ * Copyright (c) 2010, 2014 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@ package org.eclipse.aether.examples.plexus;
import org.codehaus.plexus.ContainerConfiguration;
import org.codehaus.plexus.DefaultContainerConfiguration;
import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusConstants;
import org.eclipse.aether.RepositorySystem;
/**
@@ -29,7 +30,9 @@ public class PlexusRepositorySystemFactory
*/
try
{
- ContainerConfiguration config = new DefaultContainerConfiguration().setAutoWiring( true );
+ ContainerConfiguration config = new DefaultContainerConfiguration();
+ config.setAutoWiring( true );
+ config.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
return new DefaultPlexusContainer( config ).lookup( RepositorySystem.class );
}
catch ( Exception e )
[02/36] maven-aether git commit: Fixed dependency on plexus-utils to
use proper version 2.1 as requested via CQ 5630 Fixed dependency on HTTP
wagon to use wagon-ahc:1.2.1 as requested via CQ 5659
Posted by hb...@apache.org.
Fixed dependency on plexus-utils to use proper version 2.1 as requested via CQ 5630
Fixed dependency on HTTP wagon to use wagon-ahc:1.2.1 as requested via CQ 5659
Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/a3a0594f
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/a3a0594f
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/a3a0594f
Branch: refs/heads/demo
Commit: a3a0594fa179276a52bebe6b1a3bf4eb6ea0a803
Parents: 2b0ef62
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Tue Nov 1 21:23:54 2011 +0100
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Tue Nov 1 21:23:54 2011 +0100
----------------------------------------------------------------------
aether-demo-snippets/pom.xml | 14 ++++----------
.../aether/demo/manual/ManualWagonProvider.java | 4 ++--
2 files changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/a3a0594f/aether-demo-snippets/pom.xml
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/pom.xml b/aether-demo-snippets/pom.xml
index 9eeb35e..84e990f 100644
--- a/aether-demo-snippets/pom.xml
+++ b/aether-demo-snippets/pom.xml
@@ -93,20 +93,14 @@
<version>${wagonVersion}</version>
</dependency>
<dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-http-lightweight</artifactId>
- <version>${wagonVersion}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-http-shared</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.sonatype.maven</groupId>
+ <artifactId>wagon-ahc</artifactId>
+ <version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>2.0.7</version>
+ <version>2.1</version>
</dependency>
<dependency>
<groupId>org.sonatype.sisu</groupId>
http://git-wip-us.apache.org/repos/asf/maven-aether/blob/a3a0594f/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
----------------------------------------------------------------------
diff --git a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
index af75da0..0a48c56 100644
--- a/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
+++ b/aether-demo-snippets/src/main/java/org/eclipse/aether/demo/manual/ManualWagonProvider.java
@@ -11,8 +11,8 @@
package org.eclipse.aether.demo.manual;
import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.providers.http.LightweightHttpWagon;
import org.eclipse.aether.connector.wagon.WagonProvider;
+import org.sonatype.maven.wagon.AhcWagon;
/**
* A simplistic provider for wagon instances when no Plexus-compatible IoC container is used.
@@ -26,7 +26,7 @@ public class ManualWagonProvider
{
if ( "http".equals( roleHint ) )
{
- return new LightweightHttpWagon();
+ return new AhcWagon();
}
return null;
}