maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r773926 - in /maven/components/branches/MNG-2766: ./ maven-compat/ maven-compat/src/main/java/org/apache/maven/artifact/manager/ maven-compat/src/main/java/org/apache/maven/artifact/resolver/ maven-compat/src/test/java/org/apache/maven/arti...
Date Tue, 12 May 2009 15:08:54 GMT
Author: jvanzyl
Date: Tue May 12 15:08:53 2009
New Revision: 773926

URL: http://svn.apache.org/viewvc?rev=773926&view=rev
Log:
o adding components to test wagons
o add method to view supported protocols
o add a note to the test to show the lifecycle plan is getting some repeated elements

Modified:
    maven/components/branches/MNG-2766/build.xml
    maven/components/branches/MNG-2766/maven-compat/pom.xml
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
    maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java
    maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/StringWagon.java
    maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonA.java
    maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonB.java
    maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonC.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java
    maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java
    maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java

Modified: maven/components/branches/MNG-2766/build.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/build.xml?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/build.xml (original)
+++ maven/components/branches/MNG-2766/build.xml Tue May 12 15:08:53 2009
@@ -65,7 +65,7 @@
     <property name="maven.assembly" location="apache-maven/target/${maven.home.basename.expected}-bin.zip"/>
     <property name="maven.repo.local" value="${user.home}/.m2/repository"/>
     <property name="maven.debug" value="-e"/>
-    <property name="maven.test.skip" value="false"/> <!-- TODO: Change this default
back to false once we're done -->
+    <property name="maven.test.skip" value="true"/> <!-- TODO: Change this default
back to false once we're done -->
     <property name="surefire.useFile" value="true"/>
     <echo>maven.home = ${maven.home.effective}</echo>
     <echo>maven.repo.local = ${maven.repo.local}</echo>

Modified: maven/components/branches/MNG-2766/maven-compat/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/pom.xml?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/pom.xml (original)
+++ maven/components/branches/MNG-2766/maven-compat/pom.xml Tue May 12 15:08:53 2009
@@ -43,7 +43,10 @@
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-file</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-http-lightweight</artifactId>
     </dependency>
     <dependency>
       <groupId>easymock</groupId>

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
Tue May 12 15:08:53 2009
@@ -23,6 +23,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
@@ -817,4 +818,9 @@
     {
         return httpUserAgent;
     }
+
+    public Set<String> getSupportProtocols()
+    {
+        return wagons.keySet();
+    }
 }

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/manager/WagonManager.java
Tue May 12 15:08:53 2009
@@ -21,6 +21,8 @@
 
 import java.io.File;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
@@ -85,4 +87,6 @@
 
     void getArtifactMetadataFromDeploymentRepository( ArtifactMetadata metadata, ArtifactRepository
remoteRepository, File file, String checksumPolicyWarn )
         throws TransferFailedException, ResourceDoesNotExistException;    
+    
+    Set<String> getSupportProtocols();
 }

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
Tue May 12 15:08:53 2009
@@ -155,6 +155,8 @@
 
             boolean resolved = false;
 
+            boolean destinationExists = destination.exists();
+            
             // There are three conditions in which we'll go after the artifact here:
             // 1. the force flag is set.
             // 2. the artifact's file doesn't exist (this would be true for release or snapshot
artifacts)

Modified: maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java
Tue May 12 15:08:53 2009
@@ -23,6 +23,7 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.DefaultArtifact;
@@ -75,7 +76,8 @@
     public void testAvailableProtocols()
         throws Exception
     {
-        wagonManager.getWagon( "file" );
+        Set<String> protocols = wagonManager.getSupportProtocols();
+        System.out.println( protocols );
     }    
     
     public void testUnnecessaryRepositoryLookup() throws Exception {
@@ -284,9 +286,7 @@
     {
         assertWagon( "a" );
 
-        assertWagon( "b1" );
-
-        assertWagon( "b2" );
+        assertWagon( "b" );
 
         assertWagon( "c" );
 

Modified: maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/StringWagon.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/StringWagon.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/StringWagon.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/StringWagon.java
Tue May 12 15:08:53 2009
@@ -31,10 +31,13 @@
 import org.apache.maven.wagon.ResourceDoesNotExistException;
 import org.apache.maven.wagon.StreamWagon;
 import org.apache.maven.wagon.TransferFailedException;
+import org.apache.maven.wagon.Wagon;
 import org.apache.maven.wagon.authentication.AuthenticationException;
 import org.apache.maven.wagon.authorization.AuthorizationException;
 import org.apache.maven.wagon.resource.Resource;
+import org.codehaus.plexus.component.annotations.Component;
 
+@Component(role=Wagon.class,hint="string")
 public class StringWagon
     extends StreamWagon
 {

Modified: maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonA.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonA.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonA.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonA.java
Tue May 12 15:08:53 2009
@@ -1,5 +1,8 @@
 package org.apache.maven.artifact.manager;
 
+import org.apache.maven.wagon.Wagon;
+import org.codehaus.plexus.component.annotations.Component;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -26,6 +29,7 @@
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
  */
+@Component(role=Wagon.class,hint="a")
 public class WagonA
     extends WagonMock
 {

Modified: maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonB.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonB.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonB.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonB.java
Tue May 12 15:08:53 2009
@@ -1,5 +1,8 @@
 package org.apache.maven.artifact.manager;
 
+import org.apache.maven.wagon.Wagon;
+import org.codehaus.plexus.component.annotations.Component;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -26,6 +29,7 @@
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
  */
+@Component(role=Wagon.class,hint="b")
 public class WagonB
     extends WagonMock
 {

Modified: maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonC.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonC.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonC.java
(original)
+++ maven/components/branches/MNG-2766/maven-compat/src/test/java/org/apache/maven/artifact/manager/WagonC.java
Tue May 12 15:08:53 2009
@@ -1,5 +1,8 @@
 package org.apache.maven.artifact.manager;
 
+import org.apache.maven.wagon.Wagon;
+import org.codehaus.plexus.component.annotations.Component;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -26,6 +29,7 @@
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
  */
+@Component(role=Wagon.class,hint="c")
 public class WagonC
     extends WagonMock
 {

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
Tue May 12 15:08:53 2009
@@ -428,7 +428,6 @@
 
     // org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process
     MojoDescriptor getMojoDescriptor( String task, MavenProject project, ArtifactRepository
localRepository )
-    //MojoDescriptor getMojoDescriptor( String groupId, String artifactId, String version,
String goal, MavenProject project, ArtifactRepository localRepository )
         throws LifecycleExecutionException
     {        
         String goal;
@@ -495,7 +494,7 @@
             String message = "Invalid task '" + task + "': you must specify a valid lifecycle
phase, or" + " a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal";
             throw new LifecycleExecutionException( message );
         }
-
+               
         for ( Plugin buildPlugin : project.getBuildPlugins() )
         {
             if ( buildPlugin.getKey().equals( plugin.getKey() ) )
@@ -511,7 +510,7 @@
         MojoDescriptor mojoDescriptor;
         
         try
-        {
+        {                        
             mojoDescriptor = pluginManager.getMojoDescriptor( plugin, goal, project, localRepository
);
         }
         catch ( PluginLoaderException e )

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
Tue May 12 15:08:53 2009
@@ -40,7 +40,6 @@
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
 import org.apache.maven.artifact.resolver.ResolutionErrorHandler;
 import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Dependency;
@@ -51,7 +50,6 @@
 import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
 import org.apache.maven.project.DuplicateArtifactAttachmentException;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 import org.apache.maven.repository.RepositorySystem;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.classworlds.realm.ClassRealm;

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java
Tue May 12 15:08:53 2009
@@ -43,7 +43,7 @@
     
     private MavenProject topProject;
     
-    private boolean processPlugins = false;
+    private boolean processPlugins = true;
     
     public DefaultProjectBuilderConfiguration()
     {        

Modified: maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java
Tue May 12 15:08:53 2009
@@ -61,6 +61,28 @@
         // surefire:test
         // jar:jar
         
+//        resources:resources
+//        resources:resources
+//        compiler:compile
+//        compiler:compile
+//        plexus-component-metadata:generate-metadata
+//        resources:testResources
+//        resources:testResources
+//        compiler:testCompile
+//        compiler:testCompile
+//        plexus-component-metadata:generate-test-metadata
+//        surefire:test
+//        surefire:test
+//        jar:jar
+//        jar:jar
+        
+        /*
+        for( MojoExecution e : lifecyclePlan )
+        {
+            System.out.println( e.getMojoDescriptor().getFullGoalName() );
+        }
+        */
+        
         assertEquals( "resources:resources", lifecyclePlan.get( 0 ).getMojoDescriptor().getFullGoalName()
);
         assertEquals( "compiler:compile", lifecyclePlan.get( 1 ).getMojoDescriptor().getFullGoalName()
);
         assertEquals( "plexus-component-metadata:generate-metadata", lifecyclePlan.get( 2
).getMojoDescriptor().getFullGoalName() );

Modified: maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java?rev=773926&r1=773925&r2=773926&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java
Tue May 12 15:08:53 2009
@@ -54,7 +54,7 @@
         assertNotNull( mojoDescriptor );
         assertEquals( "generate-metadata", mojoDescriptor.getGoal() );
         assertNotNull( mojoDescriptor.getRealm() );
-        mojoDescriptor.getRealm().display();
+        //mojoDescriptor.getRealm().display();
         
         PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor();
         assertNotNull( pluginDescriptor );



Mime
View raw message