continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1594919 - in /continuum/trunk: ./ continuum-artifact-manager/ continuum-artifact-manager/src/ continuum-artifact-manager/src/main/ continuum-artifact-manager/src/main/java/ continuum-artifact-manager/src/main/java/org/ continuum-artifact-m...
Date Thu, 15 May 2014 13:56:24 GMT
Author: brett
Date: Thu May 15 13:56:23 2014
New Revision: 1594919

URL: http://svn.apache.org/r1594919
Log:
[CONTINUUM-2149] globally apply wagon manager fix

Was not present in build agents. Instead, replace the maven-artifact-manager
JAR with our customised version


Added:
    continuum/trunk/continuum-artifact-manager/   (with props)
    continuum/trunk/continuum-artifact-manager/pom.xml   (with props)
    continuum/trunk/continuum-artifact-manager/src/
    continuum/trunk/continuum-artifact-manager/src/main/
    continuum/trunk/continuum-artifact-manager/src/main/java/
    continuum/trunk/continuum-artifact-manager/src/main/java/org/
    continuum/trunk/continuum-artifact-manager/src/main/java/org/apache/
    continuum/trunk/continuum-artifact-manager/src/main/java/org/apache/maven/
    continuum/trunk/continuum-artifact-manager/src/main/java/org/apache/maven/artifact/
    continuum/trunk/continuum-artifact-manager/src/main/java/org/apache/maven/artifact/manager/
    continuum/trunk/continuum-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
      - copied, changed from r1594589, continuum/trunk/continuum-core/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
Removed:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
Modified:
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/pom.xml
    continuum/trunk/continuum-core/pom.xml
    continuum/trunk/continuum-data-management/data-management-cli/pom.xml
    continuum/trunk/continuum-notifiers/continuum-notifier-wagon/pom.xml
    continuum/trunk/continuum-release/pom.xml
    continuum/trunk/pom.xml

Propchange: continuum/trunk/continuum-artifact-manager/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu May 15 13:56:23 2014
@@ -0,0 +1,2 @@
+*.iml
+target

Added: continuum/trunk/continuum-artifact-manager/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-artifact-manager/pom.xml?rev=1594919&view=auto
==============================================================================
--- continuum/trunk/continuum-artifact-manager/pom.xml (added)
+++ continuum/trunk/continuum-artifact-manager/pom.xml Thu May 15 13:56:23 2014
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.continuum</groupId>
+    <artifactId>continuum</artifactId>
+    <version>1.4.2-SNAPSHOT</version>
+  </parent>
+  <artifactId>continuum-artifact-manager</artifactId>
+  <name>Continuum :: Replacement Artifact Manager</name>
+  <description>
+    Patched DefaultWagonManager for compatibility with plexus-spring
+  </description>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact-manager</artifactId>
+    </dependency>
+    <!-- Promoted transitive dependencies -->
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-repository-metadata</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-provider-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>backport-util-concurrent</groupId>
+      <artifactId>backport-util-concurrent</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>1.6</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <artifactSet>
+            <includes>
+              <include>org.apache.maven:maven-artifact-manager</include>
+            </includes>
+          </artifactSet>
+          <filters>
+            <filter>
+              <artifact>org.apache.maven:maven-artifact-manager</artifact>
+              <excludes>
+                <exclude>org/apache/maven/artifact/manager/DefaultWagonManager*</exclude>
+              </excludes>
+            </filter>
+          </filters>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: continuum/trunk/continuum-artifact-manager/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: continuum/trunk/continuum-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
(from r1594589, continuum/trunk/continuum-core/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java)
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java?p2=continuum/trunk/continuum-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java&p1=continuum/trunk/continuum-core/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java&r1=1594589&r2=1594919&rev=1594919&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
(original)
+++ continuum/trunk/continuum-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
Thu May 15 13:56:23 2014
@@ -41,13 +41,10 @@ import org.apache.maven.wagon.repository
 import org.apache.maven.wagon.repository.RepositoryPermissions;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
-import org.codehaus.plexus.component.configurator.ComponentConfigurator;
 import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.configuration.PlexusConfiguration;
 import org.codehaus.plexus.configuration.PlexusConfigurationException;
-import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -100,9 +97,6 @@ public class DefaultWagonManager
     //used LinkedMap to preserve the order.
     private Map mirrors = new LinkedHashMap();
 
-    /** Map( String, XmlPlexusConfiguration ) with the repository id and the wagon configuration
*/
-    private Map<String, XmlPlexusConfiguration> serverConfigurationMap = new HashMap<String,
XmlPlexusConfiguration>();
-
     private Map<String, String> serverWagonProviderMap = new HashMap<String, String>();
 
     private TransferListener downloadMonitor;
@@ -134,8 +128,6 @@ public class DefaultWagonManager
 
         Wagon wagon = getWagon( protocol, repository.getId() );
 
-        configureWagon( wagon, repository.getId(), protocol );
-
         return wagon;
     }
 
@@ -250,8 +242,6 @@ public class DefaultWagonManager
         try
         {
             wagon = getWagon( protocol, repository.getId() );
-
-            configureWagon( wagon, repository );
         }
         catch ( UnsupportedProtocolException e )
         {
@@ -469,8 +459,6 @@ public class DefaultWagonManager
         try
         {
             wagon = getWagon( protocol, repository.getId() );
-
-            configureWagon( wagon, repository );
         }
         catch ( UnsupportedProtocolException e )
         {
@@ -1082,93 +1070,6 @@ public class DefaultWagonManager
         }
     }
 
-    /**
-     * Applies the server configuration to the wagon
-     *
-     * @param wagon      the wagon to configure
-     * @param repository the repository that has the configuration
-     * @throws WagonConfigurationException wraps any error given during configuration of
the wagon instance
-     */
-    private void configureWagon( Wagon wagon,
-                                 ArtifactRepository repository )
-        throws WagonConfigurationException
-    {
-        configureWagon( wagon, repository.getId(), repository.getProtocol() );
-    }
-
-    private void configureWagon( Wagon wagon, String repositoryId, String protocol )
-        throws WagonConfigurationException
-    {
-        PlexusConfiguration config = serverConfigurationMap.get( repositoryId );
-        if ( config != null )
-        {
-            getLogger().warn( "Unsupported configuration: " + config + " for wagon " + protocol
);
-        }
-    }
-
-    // TODO: Remove this, once the maven-shade-plugin 1.2 release is out, allowing configuration
of httpHeaders in the components.xml
-    private PlexusConfiguration updateUserAgentForHttp( Wagon wagon, PlexusConfiguration
config )
-    {
-        if ( config == null )
-        {
-            config = new XmlPlexusConfiguration( "configuration" );
-        }
-
-        if ( httpUserAgent != null )
-        {
-            try
-            {
-                wagon.getClass().getMethod( "setHttpHeaders", new Class[]{ Properties.class
} );
-
-                PlexusConfiguration headerConfig = config.getChild( "httpHeaders", true );
-                PlexusConfiguration[] children = headerConfig.getChildren( "property" );
-                boolean found = false;
-
-                getLogger().debug( "Checking for pre-existing User-Agent configuration."
);
-                for ( int i = 0; i < children.length; i++ )
-                {
-                    PlexusConfiguration c = children[i].getChild( "name", false );
-                    if ( c != null && "User-Agent".equals( c.getValue( null ) ) )
-                    {
-                        found = true;
-                        break;
-                    }
-                }
-
-                if ( !found )
-                {
-                    getLogger().debug( "Adding User-Agent configuration." );
-                    XmlPlexusConfiguration propertyConfig = new XmlPlexusConfiguration( "property"
);
-                    headerConfig.addChild( propertyConfig );
-
-                    XmlPlexusConfiguration nameConfig = new XmlPlexusConfiguration( "name"
);
-                    nameConfig.setValue( "User-Agent" );
-                    propertyConfig.addChild( nameConfig );
-
-                    XmlPlexusConfiguration versionConfig = new XmlPlexusConfiguration( "value"
);
-                    versionConfig.setValue( httpUserAgent );
-                    propertyConfig.addChild( versionConfig );
-                }
-                else
-                {
-                    getLogger().debug( "User-Agent configuration found." );
-                }
-            }
-            catch ( SecurityException e )
-            {
-                getLogger().debug( "setHttpHeaders method not accessible on wagon: " + wagon
+ "; skipping User-Agent configuration." );
-                // forget it. this method is public, if it exists.
-            }
-            catch ( NoSuchMethodException e )
-            {
-                getLogger().debug( "setHttpHeaders method not found on wagon: " + wagon +
"; skipping User-Agent configuration." );
-                // forget it.
-            }
-        }
-
-        return config;
-    }
-
     public void addConfiguration( String repositoryId,
                                   Xpp3Dom configuration )
     {
@@ -1177,22 +1078,7 @@ public class DefaultWagonManager
             throw new IllegalArgumentException( "arguments can't be null" );
         }
 
-        final XmlPlexusConfiguration xmlConf = new XmlPlexusConfiguration( configuration
);
-
-        for ( int i = 0; i < configuration.getChildCount(); i++ )
-        {
-            Xpp3Dom domChild = configuration.getChild( i );
-            if ( WAGON_PROVIDER_CONFIGURATION.equals( domChild.getName() ) )
-            {
-                serverWagonProviderMap.put( repositoryId, domChild.getValue() );
-                configuration.removeChild( i );
-                break;
-            }
-
-            i++;
-        }
-
-        serverConfigurationMap.put( repositoryId, xmlConf );
+        getLogger().warn( "Unsupported configuration: " + configuration + " for repository
" + repositoryId );
     }
 
     public void setDefaultRepositoryPermissions( RepositoryPermissions defaultRepositoryPermissions
)

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/pom.xml?rev=1594919&r1=1594918&r2=1594919&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/pom.xml (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/pom.xml Thu May 15 13:56:23
2014
@@ -110,10 +110,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact-manager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
       <artifactId>maven-settings</artifactId>
     </dependency>
     <dependency>

Modified: continuum/trunk/continuum-core/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/pom.xml?rev=1594919&r1=1594918&r2=1594919&view=diff
==============================================================================
--- continuum/trunk/continuum-core/pom.xml (original)
+++ continuum/trunk/continuum-core/pom.xml Thu May 15 13:56:23 2014
@@ -50,10 +50,6 @@
       <artifactId>maven-settings</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact-manager</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.continuum</groupId>
       <artifactId>continuum-notifier-api</artifactId>
     </dependency>

Modified: continuum/trunk/continuum-data-management/data-management-cli/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-cli/pom.xml?rev=1594919&r1=1594918&r2=1594919&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-cli/pom.xml (original)
+++ continuum/trunk/continuum-data-management/data-management-cli/pom.xml Thu May 15 13:56:23
2014
@@ -37,8 +37,8 @@
       <artifactId>maven-artifact</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact-manager</artifactId>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-artifact-manager</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-wagon/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-wagon/pom.xml?rev=1594919&r1=1594918&r2=1594919&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-wagon/pom.xml (original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-wagon/pom.xml Thu May 15 13:56:23
2014
@@ -33,8 +33,8 @@
       <artifactId>maven-artifact</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact-manager</artifactId>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-artifact-manager</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>

Modified: continuum/trunk/continuum-release/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/pom.xml?rev=1594919&r1=1594918&r2=1594919&view=diff
==============================================================================
--- continuum/trunk/continuum-release/pom.xml (original)
+++ continuum/trunk/continuum-release/pom.xml Thu May 15 13:56:23 2014
@@ -82,8 +82,8 @@
       <artifactId>maven-artifact</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact-manager</artifactId>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-artifact-manager</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.release</groupId>

Modified: continuum/trunk/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/pom.xml?rev=1594919&r1=1594918&r2=1594919&view=diff
==============================================================================
--- continuum/trunk/pom.xml (original)
+++ continuum/trunk/pom.xml Thu May 15 13:56:23 2014
@@ -41,7 +41,7 @@
   <properties>
     <jetty.version>8.1.7.v20120910</jetty.version>
     <continuumWebappVersion>${project.version}</continuumWebappVersion>
-    <!-- Note, when later moving beyond 2.2.1, the copy of DefaultWagonManager should
be removed -->
+    <!-- Note, when later moving beyond 2.2.1, the continuum-artifact-manager module should
be removed -->
     <maven.version>2.2.1</maven.version>
     <spring.version>2.5.6</spring.version>
     <struts.version>2.3.14.2</struts.version>
@@ -251,6 +251,7 @@
                     <exclude>xml-apis:xml-apis</exclude>
                     <exclude>jtidy:jtidy</exclude>
                     <exclude>jdom:jdom</exclude>
+                    <exclude>org.apache.maven:maven-artifact-manager</exclude>
                   </excludes>
                 </bannedDependencies>
               </rules>
@@ -335,6 +336,7 @@
     <module>continuum-buildagent</module>
     <module>continuum-distributed</module>
     <module>continuum-builder</module>
+    <module>continuum-artifact-manager</module>
   </modules>
   <repositories>
     <!-- only needed for these two artifacts that can't be redistributed
@@ -485,6 +487,22 @@
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
+        <artifactId>maven-repository-metadata</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.continuum</groupId>
+        <artifactId>continuum-artifact-manager</artifactId>
+        <version>${project.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-artifact-manager</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
         <artifactId>maven-project</artifactId>
         <version>${maven.version}</version>
         <exclusions>
@@ -492,6 +510,10 @@
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-container-default</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-artifact-manager</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
       <dependency>
@@ -603,6 +625,10 @@
             <groupId>jdom</groupId>
             <artifactId>jdom</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-artifact-manager</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
       <dependency>
@@ -946,6 +972,10 @@
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-container-default</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-artifact-manager</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
       <dependency>



Mime
View raw message