Updated examples to use 0.9.0.M3

Project: http://git-wip-us.apache.org/repos/asf/maven-resolver/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-resolver/commit/4af49166
Tree: http://git-wip-us.apache.org/repos/asf/maven-resolver/tree/4af49166
Diff: http://git-wip-us.apache.org/repos/asf/maven-resolver/diff/4af49166

Branch: refs/heads/master
Commit: 4af491666897db0a59f494ef696477ba19322a6b
Parents: 6a4d914
Author: Benjamin Bentmann <bentm...@sonatype.com>
Authored: Wed Jul 31 23:02:40 2013 +0200
Committer: Benjamin Bentmann <bentm...@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-resolver/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-resolver/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-resolver/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-resolver/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-resolver/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 )
-    {
-
-    }
-
-}

Reply via email to