]> source.dussan.org Git - archiva.git/commitdiff
Refactoring package names for maven metadata module
authorMartin Stockhammer <martin_s@apache.org>
Fri, 24 Dec 2021 12:16:12 +0000 (13:16 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Fri, 24 Dec 2021 12:16:12 +0000 (13:16 +0100)
56 files changed:
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/ArchivaIndexManagerMock.java
archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/DebugTransferListener.java [new file with mode: 0644]
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/DefaultWagonFactory.java [new file with mode: 0644]
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/WagonFactory.java [new file with mode: 0644]
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/WagonFactoryException.java [new file with mode: 0755]
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/WagonFactoryRequest.java [new file with mode: 0644]
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/DebugTransferListener.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/DefaultWagonFactory.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/WagonFactory.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/WagonFactoryException.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/WagonFactoryRequest.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-common/src/main/resources/META-INF/spring-context.xml
archiva-modules/archiva-maven/archiva-maven-indexer/src/main/java/org/apache/archiva/maven/indexer/MavenIndexManager.java
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/maven/metadata/MavenMetadataReader.java [new file with mode: 0644]
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/maven/metadata/model/MavenArtifactFacet.java [new file with mode: 0644]
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/MavenMetadataReader.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/model/MavenArtifactFacet.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/resources/META-INF/spring-context.xml
archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/maven/proxy/MavenRepositoryProxyHandler.java [new file with mode: 0644]
archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/common/WagonFactoryTest.java
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/resources/spring-context.xml
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/MavenContentHelper.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/dependency/tree/Maven3DependencyTreeBuilder.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/merge/Maven2RepositoryMerger.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/metadata/storage/Maven2RepositoryPathTranslator.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/metadata/storage/Maven2RepositoryStorage.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/metadata/storage/MavenArtifactFacetFactory.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/metadata/storage/RepositoryModelResolver.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ArtifactExtensionMappingTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenContentHelperTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/metadata/RepositoryMetadataReaderTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/metadata/storage/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/metadata/storage/Maven2RepositoryMetadataResolverMRM1411Test.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/metadata/storage/Maven2RepositoryMetadataResolverManagedReleaseTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/metadata/storage/Maven2RepositoryMetadataResolverTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/metadata/storage/MavenRepositoryMetadataReaderTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/mock/ArchivaIndexManagerMock.java
archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DefaultDownloadRemoteIndexScheduler.java
archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTask.java
archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/scheduler/indexing/maven/DownloadRemoteIndexTaskRequest.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/ArchivaIndexManagerMock.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactBuilder.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/OverridingRepositoryProxyHandler.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java
archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryWalkingStatisticsProvider.java
archiva-modules/metadata/metadata-store-provider/oak-jcr/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java

index 787219647fa8b868d499080422b3d24945889424..d16e911ee608fe5725665e6ec7a05bcaf855e820 100644 (file)
@@ -22,7 +22,7 @@ package org.apache.archiva.consumers.core.repository;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.*;
 import org.apache.archiva.metadata.audit.RepositoryListener;
 import org.apache.archiva.repository.ManagedRepositoryContent;
index 5fccfc7702838c33169b06ad5927fb78cfb0a1b0..1e1030ff08f5dff0b5370be042e251c9204b15f2 100644 (file)
@@ -27,7 +27,7 @@
            http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="true">
   <context:annotation-config/>
-  <context:component-scan base-package="org.apache.archiva.metadata.repository,org.apache.archiva.repository.maven.content,org.apache.archiva.metadata.maven"/>
+  <context:component-scan base-package="org.apache.archiva.metadata.repository,org.apache.archiva.repository.maven.content,org.apache.archiva.maven.metadata"/>
 
   <bean name="commons-configuration" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
     <property name="initialConfiguration">
index e2255ee4212114762c8d7b26bc7d0bac762cd75c..8b2d1f6080741b0eb1c0ba3996b9e4874f010bab 100644 (file)
@@ -28,9 +28,9 @@ import org.apache.archiva.indexer.IndexCreationFailedException;
 import org.apache.archiva.indexer.IndexUpdateFailedException;
 import org.apache.archiva.indexer.UnsupportedBaseContextException;
 import org.apache.archiva.proxy.ProxyRegistry;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryException;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryException;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.repository.EditableRepository;
 import org.apache.archiva.repository.ManagedRepository;
index 9280bd747a5e3dc43f60f7491389288ca23f5217..4915d72c81ec3264d4ba0d3f3910ebd797b14ff1 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.repository.scanner.mock;
 
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.repository.content.BaseRepositoryContentLayout;
 import org.apache.archiva.repository.content.ContentAccessException;
@@ -34,7 +34,6 @@ import org.apache.archiva.repository.content.Artifact;
 import org.apache.archiva.repository.content.BaseDataItemTypes;
 import org.apache.archiva.repository.content.ContentItem;
 import org.apache.archiva.repository.content.DataItem;
-import org.apache.archiva.repository.content.ItemNotFoundException;
 import org.apache.archiva.repository.content.ItemSelector;
 import org.apache.archiva.repository.content.Namespace;
 import org.apache.archiva.repository.content.Project;
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/DebugTransferListener.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/DebugTransferListener.java
new file mode 100644 (file)
index 0000000..77a833f
--- /dev/null
@@ -0,0 +1,74 @@
+package org.apache.archiva.maven.proxy;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.wagon.events.TransferEvent;
+import org.apache.maven.wagon.events.TransferListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M1
+ */
+public class DebugTransferListener
+    implements TransferListener
+{
+    private Logger log = LoggerFactory.getLogger( getClass() );
+
+    @Override
+    public void transferInitiated( TransferEvent transferEvent )
+    {
+        log.debug( "transferInitiated for resource {} on repository url {}", transferEvent.getResource().getName(),
+                   transferEvent.getWagon().getRepository().getUrl() );
+    }
+
+    @Override
+    public void transferStarted( TransferEvent transferEvent )
+    {
+        log.debug( "transferStarted for resource {} on repository url {}", transferEvent.getResource().getName(),
+                   transferEvent.getWagon().getRepository().getUrl() );
+    }
+
+    @Override
+    public void transferProgress( TransferEvent transferEvent, byte[] bytes, int i )
+    {
+        log.debug( "transferProgress for resource {} on repository url {}", transferEvent.getResource().getName(),
+                   transferEvent.getWagon().getRepository().getUrl() );
+    }
+
+    @Override
+    public void transferCompleted( TransferEvent transferEvent )
+    {
+        log.debug( "transferCompleted for resource {} on repository url {}", transferEvent.getResource().getName(),
+                   transferEvent.getWagon().getRepository().getUrl() );
+    }
+
+    @Override
+    public void transferError( TransferEvent transferEvent )
+    {
+        log.debug( "transferError for resource {} on repository url {}", transferEvent.getResource().getName(),
+                   transferEvent.getWagon().getRepository().getUrl(), transferEvent.getException() );
+    }
+
+    @Override
+    public void debug( String s )
+    {
+        log.debug( "wagon debug {}", s );
+    }
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/DefaultWagonFactory.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/DefaultWagonFactory.java
new file mode 100644 (file)
index 0000000..6ce2d0b
--- /dev/null
@@ -0,0 +1,116 @@
+package org.apache.archiva.maven.proxy;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.maven.wagon.Wagon;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M1
+ */
+@Service ("wagonFactory")
+public class DefaultWagonFactory
+    implements WagonFactory
+{
+
+    private ApplicationContext applicationContext;
+
+    private Logger logger = LoggerFactory.getLogger( getClass() );
+
+    private DebugTransferListener debugTransferListener = new DebugTransferListener();
+
+    @Inject
+    public DefaultWagonFactory( ApplicationContext applicationContext )
+    {
+        this.applicationContext = applicationContext;
+    }
+
+    @Override
+    public Wagon getWagon( WagonFactoryRequest wagonFactoryRequest )
+        throws WagonFactoryException
+    {
+        try
+        {
+            String protocol = StringUtils.startsWith( wagonFactoryRequest.getProtocol(), "wagon#" )
+                ? wagonFactoryRequest.getProtocol()
+                : "wagon#" + wagonFactoryRequest.getProtocol();
+
+            // if it's a ntlm proxy we have to lookup the wagon light which support thats
+            // wagon http client doesn't support that
+            if ( wagonFactoryRequest.getNetworkProxy() != null && wagonFactoryRequest.getNetworkProxy().isUseNtlm() )
+            {
+                protocol = protocol + "-ntlm";
+            }
+
+            Wagon wagon = applicationContext.getBean( protocol, Wagon.class );
+            wagon.addTransferListener( debugTransferListener );
+            configureUserAgent( wagon, wagonFactoryRequest );
+            return wagon;
+        }
+        catch ( BeansException e )
+        {
+            throw new WagonFactoryException( e.getMessage(), e );
+        }
+    }
+
+    protected void configureUserAgent( Wagon wagon, WagonFactoryRequest wagonFactoryRequest )
+    {
+        try
+        {
+            Class<? extends Wagon> clazz = wagon.getClass();
+            Method getHttpHeaders = clazz.getMethod( "getHttpHeaders" );
+
+            Properties headers = (Properties) getHttpHeaders.invoke( wagon );
+            if ( headers == null )
+            {
+                headers = new Properties();
+            }
+
+            headers.put( "User-Agent", wagonFactoryRequest.getUserAgent() );
+
+            if ( !wagonFactoryRequest.getHeaders().isEmpty() )
+            {
+                for ( Map.Entry<String, String> entry : wagonFactoryRequest.getHeaders().entrySet() )
+                {
+                    headers.put( entry.getKey(), entry.getValue() );
+                }
+            }
+
+            Method setHttpHeaders = clazz.getMethod( "setHttpHeaders", new Class[]{ Properties.class } );
+            setHttpHeaders.invoke( wagon, headers );
+
+            logger.debug( "http headers set to: {}", headers );
+        }
+        catch ( Exception e )
+        {
+            logger.warn( "fail to configure User-Agent: {}", e.getMessage(), e );
+        }
+    }
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/WagonFactory.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/WagonFactory.java
new file mode 100644 (file)
index 0000000..df05f17
--- /dev/null
@@ -0,0 +1,37 @@
+package org.apache.archiva.maven.proxy;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.wagon.Wagon;
+
+/**
+ * Create a Wagon instance for the given protocol.
+ */
+public interface WagonFactory
+{
+    /**
+     * Create a new Wagon instance for the given protocol.
+     *
+     * @param wagonFactoryRequest
+     *
+     * @return the Wagon instance
+     */
+    Wagon getWagon( WagonFactoryRequest wagonFactoryRequest )
+        throws WagonFactoryException;
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/WagonFactoryException.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/WagonFactoryException.java
new file mode 100755 (executable)
index 0000000..0e349d4
--- /dev/null
@@ -0,0 +1,32 @@
+package org.apache.archiva.maven.proxy;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M1
+ */
+public class WagonFactoryException
+    extends Exception
+{
+    public WagonFactoryException( String message, Throwable e )
+    {
+        super( message, e );
+    }
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/WagonFactoryRequest.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/maven/proxy/WagonFactoryRequest.java
new file mode 100644 (file)
index 0000000..6980c5f
--- /dev/null
@@ -0,0 +1,178 @@
+package org.apache.archiva.maven.proxy;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.proxy.model.NetworkProxy;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M4
+ */
+public class WagonFactoryRequest
+{
+
+    public static final String USER_AGENT_SYSTEM_PROPERTY = "archiva.userAgent";
+
+    private static String DEFAULT_USER_AGENT = "Java-Archiva";
+
+    /**
+     * the protocol to find the Wagon for, which must be prefixed with <code>wagon#</code>, for example
+     * <code>wagon#http</code>. <b>to have a wagon supporting ntlm add -ntlm</b>
+     */
+    private String protocol;
+
+    private Map<String, String> headers = new HashMap<>();
+
+    private String userAgent = DEFAULT_USER_AGENT;
+
+    static {
+        if ( StringUtils.isNotBlank( System.getProperty( USER_AGENT_SYSTEM_PROPERTY))) {
+            DEFAULT_USER_AGENT=System.getProperty(USER_AGENT_SYSTEM_PROPERTY);
+        }
+    }
+
+    private NetworkProxy networkProxy;
+
+    public WagonFactoryRequest()
+    {
+        // no op
+    }
+
+    public WagonFactoryRequest( String protocol, Map<String, String> headers )
+    {
+        this.protocol = protocol;
+        this.headers = headers;
+    }
+
+    public String getProtocol()
+    {
+        return protocol;
+    }
+
+    public void setProtocol( String protocol )
+    {
+        this.protocol = protocol;
+    }
+
+    public WagonFactoryRequest protocol( String protocol )
+    {
+        this.protocol = protocol;
+        return this;
+    }
+
+    public Map<String, String> getHeaders()
+    {
+        if ( this.headers == null )
+        {
+            this.headers = new HashMap<>();
+        }
+        return headers;
+    }
+
+    public void setHeaders( Map<String, String> headers )
+    {
+        this.headers = headers;
+    }
+
+    public WagonFactoryRequest headers( Map<String, String> headers )
+    {
+        this.headers = headers;
+        return this;
+    }
+
+    public String getUserAgent()
+    {
+        return userAgent;
+    }
+
+    public void setUserAgent( String userAgent )
+    {
+        this.userAgent = userAgent;
+    }
+
+    public WagonFactoryRequest userAgent( String userAgent )
+    {
+        this.userAgent = userAgent;
+        return this;
+    }
+
+    public NetworkProxy getNetworkProxy()
+    {
+        return networkProxy;
+    }
+
+    public void setNetworkProxy( NetworkProxy networkProxy )
+    {
+        this.networkProxy = networkProxy;
+    }
+
+    public WagonFactoryRequest networkProxy( NetworkProxy networkProxy )
+    {
+        this.networkProxy = networkProxy;
+        return this;
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( !( o instanceof WagonFactoryRequest ) )
+        {
+            return false;
+        }
+
+        WagonFactoryRequest that = (WagonFactoryRequest) o;
+
+        if ( protocol != null ? !protocol.equals( that.protocol ) : that.protocol != null )
+        {
+            return false;
+        }
+        if ( userAgent != null ? !userAgent.equals( that.userAgent ) : that.userAgent != null )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        int result = protocol != null ? protocol.hashCode() : 0;
+        result = 31 * result + ( userAgent != null ? userAgent.hashCode() : 0 );
+        return result;
+    }
+
+    @Override
+    public String toString()
+    {
+        return "WagonFactoryRequest{" +
+            "protocol='" + protocol + '\'' +
+            ", headers=" + headers +
+            ", userAgent='" + userAgent + '\'' +
+            ", networkProxy=" + networkProxy +
+            '}';
+    }
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/DebugTransferListener.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/DebugTransferListener.java
deleted file mode 100644 (file)
index f5ceaae..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-package org.apache.archiva.proxy.maven;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.wagon.events.TransferEvent;
-import org.apache.maven.wagon.events.TransferListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M1
- */
-public class DebugTransferListener
-    implements TransferListener
-{
-    private Logger log = LoggerFactory.getLogger( getClass() );
-
-    @Override
-    public void transferInitiated( TransferEvent transferEvent )
-    {
-        log.debug( "transferInitiated for resource {} on repository url {}", transferEvent.getResource().getName(),
-                   transferEvent.getWagon().getRepository().getUrl() );
-    }
-
-    @Override
-    public void transferStarted( TransferEvent transferEvent )
-    {
-        log.debug( "transferStarted for resource {} on repository url {}", transferEvent.getResource().getName(),
-                   transferEvent.getWagon().getRepository().getUrl() );
-    }
-
-    @Override
-    public void transferProgress( TransferEvent transferEvent, byte[] bytes, int i )
-    {
-        log.debug( "transferProgress for resource {} on repository url {}", transferEvent.getResource().getName(),
-                   transferEvent.getWagon().getRepository().getUrl() );
-    }
-
-    @Override
-    public void transferCompleted( TransferEvent transferEvent )
-    {
-        log.debug( "transferCompleted for resource {} on repository url {}", transferEvent.getResource().getName(),
-                   transferEvent.getWagon().getRepository().getUrl() );
-    }
-
-    @Override
-    public void transferError( TransferEvent transferEvent )
-    {
-        log.debug( "transferError for resource {} on repository url {}", transferEvent.getResource().getName(),
-                   transferEvent.getWagon().getRepository().getUrl(), transferEvent.getException() );
-    }
-
-    @Override
-    public void debug( String s )
-    {
-        log.debug( "wagon debug {}", s );
-    }
-}
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/DefaultWagonFactory.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/DefaultWagonFactory.java
deleted file mode 100644 (file)
index f1fcf09..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.apache.archiva.proxy.maven;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.maven.wagon.Wagon;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.stereotype.Service;
-
-import javax.inject.Inject;
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M1
- */
-@Service ("wagonFactory")
-public class DefaultWagonFactory
-    implements WagonFactory
-{
-
-    private ApplicationContext applicationContext;
-
-    private Logger logger = LoggerFactory.getLogger( getClass() );
-
-    private DebugTransferListener debugTransferListener = new DebugTransferListener();
-
-    @Inject
-    public DefaultWagonFactory( ApplicationContext applicationContext )
-    {
-        this.applicationContext = applicationContext;
-    }
-
-    @Override
-    public Wagon getWagon( WagonFactoryRequest wagonFactoryRequest )
-        throws WagonFactoryException
-    {
-        try
-        {
-            String protocol = StringUtils.startsWith( wagonFactoryRequest.getProtocol(), "wagon#" )
-                ? wagonFactoryRequest.getProtocol()
-                : "wagon#" + wagonFactoryRequest.getProtocol();
-
-            // if it's a ntlm proxy we have to lookup the wagon light which support thats
-            // wagon http client doesn't support that
-            if ( wagonFactoryRequest.getNetworkProxy() != null && wagonFactoryRequest.getNetworkProxy().isUseNtlm() )
-            {
-                protocol = protocol + "-ntlm";
-            }
-
-            Wagon wagon = applicationContext.getBean( protocol, Wagon.class );
-            wagon.addTransferListener( debugTransferListener );
-            configureUserAgent( wagon, wagonFactoryRequest );
-            return wagon;
-        }
-        catch ( BeansException e )
-        {
-            throw new WagonFactoryException( e.getMessage(), e );
-        }
-    }
-
-    protected void configureUserAgent( Wagon wagon, WagonFactoryRequest wagonFactoryRequest )
-    {
-        try
-        {
-            Class<? extends Wagon> clazz = wagon.getClass();
-            Method getHttpHeaders = clazz.getMethod( "getHttpHeaders" );
-
-            Properties headers = (Properties) getHttpHeaders.invoke( wagon );
-            if ( headers == null )
-            {
-                headers = new Properties();
-            }
-
-            headers.put( "User-Agent", wagonFactoryRequest.getUserAgent() );
-
-            if ( !wagonFactoryRequest.getHeaders().isEmpty() )
-            {
-                for ( Map.Entry<String, String> entry : wagonFactoryRequest.getHeaders().entrySet() )
-                {
-                    headers.put( entry.getKey(), entry.getValue() );
-                }
-            }
-
-            Method setHttpHeaders = clazz.getMethod( "setHttpHeaders", new Class[]{ Properties.class } );
-            setHttpHeaders.invoke( wagon, headers );
-
-            logger.debug( "http headers set to: {}", headers );
-        }
-        catch ( Exception e )
-        {
-            logger.warn( "fail to configure User-Agent: {}", e.getMessage(), e );
-        }
-    }
-}
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/WagonFactory.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/WagonFactory.java
deleted file mode 100644 (file)
index 379be74..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.archiva.proxy.maven;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.wagon.Wagon;
-
-/**
- * Create a Wagon instance for the given protocol.
- */
-public interface WagonFactory
-{
-    /**
-     * Create a new Wagon instance for the given protocol.
-     *
-     * @param wagonFactoryRequest
-     *
-     * @return the Wagon instance
-     */
-    Wagon getWagon( WagonFactoryRequest wagonFactoryRequest )
-        throws WagonFactoryException;
-}
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/WagonFactoryException.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/WagonFactoryException.java
deleted file mode 100755 (executable)
index 2bb7e27..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.apache.archiva.proxy.maven;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M1
- */
-public class WagonFactoryException
-    extends Exception
-{
-    public WagonFactoryException( String message, Throwable e )
-    {
-        super( message, e );
-    }
-}
diff --git a/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/WagonFactoryRequest.java b/archiva-modules/archiva-maven/archiva-maven-common/src/main/java/org/apache/archiva/proxy/maven/WagonFactoryRequest.java
deleted file mode 100644 (file)
index 3dc729c..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-package org.apache.archiva.proxy.maven;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.proxy.model.NetworkProxy;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M4
- */
-public class WagonFactoryRequest
-{
-
-    public static final String USER_AGENT_SYSTEM_PROPERTY = "archiva.userAgent";
-
-    private static String DEFAULT_USER_AGENT = "Java-Archiva";
-
-    /**
-     * the protocol to find the Wagon for, which must be prefixed with <code>wagon#</code>, for example
-     * <code>wagon#http</code>. <b>to have a wagon supporting ntlm add -ntlm</b>
-     */
-    private String protocol;
-
-    private Map<String, String> headers = new HashMap<>();
-
-    private String userAgent = DEFAULT_USER_AGENT;
-
-    static {
-        if ( StringUtils.isNotBlank( System.getProperty( USER_AGENT_SYSTEM_PROPERTY))) {
-            DEFAULT_USER_AGENT=System.getProperty(USER_AGENT_SYSTEM_PROPERTY);
-        }
-    }
-
-    private NetworkProxy networkProxy;
-
-    public WagonFactoryRequest()
-    {
-        // no op
-    }
-
-    public WagonFactoryRequest( String protocol, Map<String, String> headers )
-    {
-        this.protocol = protocol;
-        this.headers = headers;
-    }
-
-    public String getProtocol()
-    {
-        return protocol;
-    }
-
-    public void setProtocol( String protocol )
-    {
-        this.protocol = protocol;
-    }
-
-    public WagonFactoryRequest protocol( String protocol )
-    {
-        this.protocol = protocol;
-        return this;
-    }
-
-    public Map<String, String> getHeaders()
-    {
-        if ( this.headers == null )
-        {
-            this.headers = new HashMap<>();
-        }
-        return headers;
-    }
-
-    public void setHeaders( Map<String, String> headers )
-    {
-        this.headers = headers;
-    }
-
-    public WagonFactoryRequest headers( Map<String, String> headers )
-    {
-        this.headers = headers;
-        return this;
-    }
-
-    public String getUserAgent()
-    {
-        return userAgent;
-    }
-
-    public void setUserAgent( String userAgent )
-    {
-        this.userAgent = userAgent;
-    }
-
-    public WagonFactoryRequest userAgent( String userAgent )
-    {
-        this.userAgent = userAgent;
-        return this;
-    }
-
-    public NetworkProxy getNetworkProxy()
-    {
-        return networkProxy;
-    }
-
-    public void setNetworkProxy( NetworkProxy networkProxy )
-    {
-        this.networkProxy = networkProxy;
-    }
-
-    public WagonFactoryRequest networkProxy( NetworkProxy networkProxy )
-    {
-        this.networkProxy = networkProxy;
-        return this;
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( !( o instanceof WagonFactoryRequest ) )
-        {
-            return false;
-        }
-
-        WagonFactoryRequest that = (WagonFactoryRequest) o;
-
-        if ( protocol != null ? !protocol.equals( that.protocol ) : that.protocol != null )
-        {
-            return false;
-        }
-        if ( userAgent != null ? !userAgent.equals( that.userAgent ) : that.userAgent != null )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        int result = protocol != null ? protocol.hashCode() : 0;
-        result = 31 * result + ( userAgent != null ? userAgent.hashCode() : 0 );
-        return result;
-    }
-
-    @Override
-    public String toString()
-    {
-        return "WagonFactoryRequest{" +
-            "protocol='" + protocol + '\'' +
-            ", headers=" + headers +
-            ", userAgent='" + userAgent + '\'' +
-            ", networkProxy=" + networkProxy +
-            '}';
-    }
-}
index 2549359c09a38cbd9840b2b89247509a4735b922..2f61235d70220d72866b7e481fcdba197ef81de6 100644 (file)
@@ -28,6 +28,6 @@
        default-lazy-init="true">
 
   <context:annotation-config/>
-  <context:component-scan base-package="org.apache.archiva.proxy.maven"/>
+  <context:component-scan base-package="org.apache.archiva.maven.proxy"/>
 
 </beans>
\ No newline at end of file
index 35f61c4228a61c706dbc989fea13f02bd547fda2..e45cfb8c1310a63a6c2d09a66fa79f3a190af590 100644 (file)
@@ -27,9 +27,9 @@ import org.apache.archiva.indexer.IndexCreationFailedException;
 import org.apache.archiva.indexer.IndexUpdateFailedException;
 import org.apache.archiva.indexer.UnsupportedBaseContextException;
 import org.apache.archiva.proxy.ProxyRegistry;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryException;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryException;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.repository.EditableRepository;
 import org.apache.archiva.repository.ManagedRepository;
diff --git a/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/maven/metadata/MavenMetadataReader.java b/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/maven/metadata/MavenMetadataReader.java
new file mode 100644 (file)
index 0000000..42e75c8
--- /dev/null
@@ -0,0 +1,196 @@
+package org.apache.archiva.maven.metadata;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.Plugin;
+import org.apache.archiva.model.SnapshotVersion;
+import org.apache.archiva.repository.RepositoryType;
+import org.apache.archiva.repository.metadata.MetadataReader;
+import org.apache.archiva.repository.metadata.RepositoryMetadataException;
+import org.apache.archiva.repository.storage.StorageAsset;
+import org.apache.archiva.xml.XMLException;
+import org.apache.archiva.xml.XMLReader;
+import org.apache.archiva.xml.XmlUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.time.Instant;
+import java.util.Date;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M3
+ */
+@Service("metadataReader#maven")
+public class MavenMetadataReader implements MetadataReader
+{
+    public static final String MAVEN_METADATA = "maven-metadata.xml";
+
+
+    /*
+    <?xml version="1.0" encoding="UTF-8"?>
+    <metadata modelVersion="1.1.0">
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva</artifactId>
+      <version>1.4-M3-SNAPSHOT</version>
+      <versioning>
+        <snapshot>
+          <timestamp>20120310.230917</timestamp>
+          <buildNumber>2</buildNumber>
+        </snapshot>
+        <lastUpdated>20120310230917</lastUpdated>
+        <snapshotVersions>
+          <snapshotVersion>
+            <extension>pom</extension>
+            <value>1.4-M3-20120310.230917-2</value>
+            <updated>20120310230917</updated>
+          </snapshotVersion>
+        </snapshotVersions>
+      </versioning>
+    </metadata>
+    */
+
+    private static final Logger log = LoggerFactory.getLogger( MavenMetadataReader.class );
+
+
+    /**
+     * Read and return the {@link org.apache.archiva.model.ArchivaRepositoryMetadata} object from the provided xml file.
+     *
+     * @param metadataFile the maven-metadata.xml file to read.
+     * @return the archiva repository metadata object that represents the provided file contents.
+     * @throws RepositoryMetadataException if the file cannot be read
+     */
+    public ArchivaRepositoryMetadata read( StorageAsset metadataFile )
+            throws RepositoryMetadataException {
+
+        XMLReader xml;
+        try
+        {
+            xml = new XMLReader( "metadata", metadataFile );
+        }
+        catch ( XMLException e )
+        {
+            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
+        }
+        return read( xml, metadataFile.getModificationTime(), metadataFile.getSize() );
+
+    }
+
+    public ArchivaRepositoryMetadata read( Path metadataFile )
+        throws RepositoryMetadataException {
+
+        XMLReader xml;
+        try
+        {
+            xml = new XMLReader( "metadata", metadataFile );
+        }
+        catch ( XMLException e )
+        {
+            log.error( "XML error while reading metadata file {}: {}", metadataFile, e.getMessage(), e );
+            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
+        }
+        try
+        {
+            return read( xml, Files.getLastModifiedTime( metadataFile ).toInstant(), Files.size( metadataFile ) );
+        }
+        catch ( IOException e )
+        {
+            log.error( "IO Error while reading metadata file {}: {}", metadataFile, e.getMessage(), e );
+            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
+        }
+
+    }
+
+    private ArchivaRepositoryMetadata read( XMLReader xml, Instant modTime, long fileSize) throws RepositoryMetadataException
+    {
+        // invoke this to remove namespaces, see MRM-1136
+        xml.removeNamespaces();
+
+        ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
+
+        try
+        {
+            metadata.setGroupId( xml.getElementText( "//metadata/groupId" ) );
+            metadata.setArtifactId( xml.getElementText( "//metadata/artifactId" ) );
+            metadata.setVersion( xml.getElementText( "//metadata/version" ) );
+            metadata.setFileLastModified( Date.from(modTime) );
+            metadata.setFileSize( fileSize );
+            metadata.setLastUpdated( xml.getElementText( "//metadata/versioning/lastUpdated" ) );
+            metadata.setLatestVersion( xml.getElementText( "//metadata/versioning/latest" ) );
+            metadata.setReleasedVersion( xml.getElementText( "//metadata/versioning/release" ) );
+            metadata.setAvailableVersions( xml.getElementListText( "//metadata/versioning/versions/version" ) );
+
+            Element snapshotElem = xml.getElement( "//metadata/versioning/snapshot" );
+            if ( snapshotElem != null )
+            {
+                SnapshotVersion snapshot = new SnapshotVersion( );
+                snapshot.setTimestamp( XmlUtil.getChildText( snapshotElem, "timestamp" ) );
+                String buildNumber = XmlUtil.getChildText( snapshotElem, "buildNumber" );
+                if ( NumberUtils.isCreatable( buildNumber ) )
+                {
+                    snapshot.setBuildNumber( NumberUtils.toInt( buildNumber ) );
+                }
+                metadata.setSnapshotVersion( snapshot );
+            }
+
+            for ( Node node : xml.getElementList( "//metadata/plugins/plugin" ) )
+            {
+                if ( node instanceof Element )
+                {
+                    Element plugin = (Element) node;
+                    Plugin p = new Plugin( );
+                    String prefix = plugin.getElementsByTagName( "prefix" ).item( 0 ).getTextContent( ).trim( );
+                    p.setPrefix( prefix );
+                    String artifactId = plugin.getElementsByTagName( "artifactId" ).item( 0 ).getTextContent( ).trim( );
+                    p.setArtifactId( artifactId );
+                    String name = plugin.getElementsByTagName( "name" ).item( 0 ).getTextContent( ).trim( );
+                    p.setName( name );
+                    metadata.addPlugin( p );
+                }
+            }
+        } catch ( XMLException e) {
+            throw new RepositoryMetadataException( "XML Error while reading metadata file : " + e.getMessage( ), e );
+        }
+        return metadata;
+    }
+
+    @Override
+    public boolean isValidMetadataPath( String path )
+    {
+        if ( StringUtils.isNotEmpty( path ) ) {
+            return path.endsWith( MAVEN_METADATA );
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public boolean isValidForType( RepositoryType repositoryType )
+    {
+        return RepositoryType.MAVEN.equals( repositoryType );
+    }
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/maven/metadata/model/MavenArtifactFacet.java b/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/maven/metadata/model/MavenArtifactFacet.java
new file mode 100644 (file)
index 0000000..64ee638
--- /dev/null
@@ -0,0 +1,143 @@
+package org.apache.archiva.maven.metadata.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.metadata.model.MetadataFacet;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class MavenArtifactFacet
+    implements MetadataFacet
+{
+    private String classifier;
+
+    private String type;
+
+    private String timestamp;
+
+    private int buildNumber;
+
+    public static final String FACET_ID = "org.apache.archiva.metadata.repository.storage.maven2.artifact";
+
+    public String getClassifier()
+    {
+        return classifier;
+    }
+
+    public void setClassifier( String classifier )
+    {
+        this.classifier = classifier;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+
+    public void setType( String type )
+    {
+        this.type = type;
+    }
+
+    public String getTimestamp()
+    {
+        return timestamp;
+    }
+
+    public void setTimestamp( String timestamp )
+    {
+        this.timestamp = timestamp;
+    }
+
+    public int getBuildNumber()
+    {
+        return buildNumber;
+    }
+
+    public void setBuildNumber( int buildNumber )
+    {
+        this.buildNumber = buildNumber;
+    }
+
+    @Override
+    public String getFacetId()
+    {
+        return FACET_ID;
+    }
+
+    @Override
+    public String getName()
+    {
+        // TODO: not needed, perhaps artifact/version metadata facet should be separate interface?
+        return null;
+    }
+
+    @Override
+    public Map<String, String> toProperties()
+    {
+        Map<String, String> properties = new HashMap<>();
+        properties.put( "type", type );
+        if ( classifier != null )
+        {
+            properties.put( "classifier", classifier );
+        }
+        if ( timestamp != null )
+        {
+            properties.put( "timestamp", timestamp );
+        }
+        if ( buildNumber > 0 )
+        {
+            properties.put( "buildNumber", Integer.toString( buildNumber ) );
+        }
+        return properties;
+    }
+
+    @Override
+    public void fromProperties( Map<String, String> properties )
+    {
+        type = properties.get( "type" );
+        classifier = properties.get( "classifier" );
+        timestamp = properties.get( "timestamp" );
+        String buildNumber = properties.get( "buildNumber" );
+        if ( buildNumber != null )
+        {
+            this.buildNumber = Integer.parseInt( buildNumber );
+        }
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( !( o instanceof MavenArtifactFacet ) )
+        {
+            return false;
+        }
+
+        MavenArtifactFacet that = (MavenArtifactFacet) o;
+
+        return StringUtils.equals( that.getClassifier(), this.classifier );
+    }
+
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/MavenMetadataReader.java b/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/MavenMetadataReader.java
deleted file mode 100644 (file)
index 8f04ff1..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-package org.apache.archiva.metadata.maven;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.archiva.model.Plugin;
-import org.apache.archiva.model.SnapshotVersion;
-import org.apache.archiva.repository.RepositoryType;
-import org.apache.archiva.repository.metadata.MetadataReader;
-import org.apache.archiva.repository.metadata.RepositoryMetadataException;
-import org.apache.archiva.repository.storage.StorageAsset;
-import org.apache.archiva.xml.XMLException;
-import org.apache.archiva.xml.XMLReader;
-import org.apache.archiva.xml.XmlUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.math.NumberUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.time.Instant;
-import java.util.Date;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M3
- */
-@Service("metadataReader#maven")
-public class MavenMetadataReader implements MetadataReader
-{
-    public static final String MAVEN_METADATA = "maven-metadata.xml";
-
-
-    /*
-    <?xml version="1.0" encoding="UTF-8"?>
-    <metadata modelVersion="1.1.0">
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva</artifactId>
-      <version>1.4-M3-SNAPSHOT</version>
-      <versioning>
-        <snapshot>
-          <timestamp>20120310.230917</timestamp>
-          <buildNumber>2</buildNumber>
-        </snapshot>
-        <lastUpdated>20120310230917</lastUpdated>
-        <snapshotVersions>
-          <snapshotVersion>
-            <extension>pom</extension>
-            <value>1.4-M3-20120310.230917-2</value>
-            <updated>20120310230917</updated>
-          </snapshotVersion>
-        </snapshotVersions>
-      </versioning>
-    </metadata>
-    */
-
-    private static final Logger log = LoggerFactory.getLogger( MavenMetadataReader.class );
-
-
-    /**
-     * Read and return the {@link org.apache.archiva.model.ArchivaRepositoryMetadata} object from the provided xml file.
-     *
-     * @param metadataFile the maven-metadata.xml file to read.
-     * @return the archiva repository metadata object that represents the provided file contents.
-     * @throws RepositoryMetadataException if the file cannot be read
-     */
-    public ArchivaRepositoryMetadata read( StorageAsset metadataFile )
-            throws RepositoryMetadataException {
-
-        XMLReader xml;
-        try
-        {
-            xml = new XMLReader( "metadata", metadataFile );
-        }
-        catch ( XMLException e )
-        {
-            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
-        }
-        return read( xml, metadataFile.getModificationTime(), metadataFile.getSize() );
-
-    }
-
-    public ArchivaRepositoryMetadata read( Path metadataFile )
-        throws RepositoryMetadataException {
-
-        XMLReader xml;
-        try
-        {
-            xml = new XMLReader( "metadata", metadataFile );
-        }
-        catch ( XMLException e )
-        {
-            log.error( "XML error while reading metadata file {}: {}", metadataFile, e.getMessage(), e );
-            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
-        }
-        try
-        {
-            return read( xml, Files.getLastModifiedTime( metadataFile ).toInstant(), Files.size( metadataFile ) );
-        }
-        catch ( IOException e )
-        {
-            log.error( "IO Error while reading metadata file {}: {}", metadataFile, e.getMessage(), e );
-            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
-        }
-
-    }
-
-    private ArchivaRepositoryMetadata read( XMLReader xml, Instant modTime, long fileSize) throws RepositoryMetadataException
-    {
-        // invoke this to remove namespaces, see MRM-1136
-        xml.removeNamespaces();
-
-        ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
-
-        try
-        {
-            metadata.setGroupId( xml.getElementText( "//metadata/groupId" ) );
-            metadata.setArtifactId( xml.getElementText( "//metadata/artifactId" ) );
-            metadata.setVersion( xml.getElementText( "//metadata/version" ) );
-            metadata.setFileLastModified( Date.from(modTime) );
-            metadata.setFileSize( fileSize );
-            metadata.setLastUpdated( xml.getElementText( "//metadata/versioning/lastUpdated" ) );
-            metadata.setLatestVersion( xml.getElementText( "//metadata/versioning/latest" ) );
-            metadata.setReleasedVersion( xml.getElementText( "//metadata/versioning/release" ) );
-            metadata.setAvailableVersions( xml.getElementListText( "//metadata/versioning/versions/version" ) );
-
-            Element snapshotElem = xml.getElement( "//metadata/versioning/snapshot" );
-            if ( snapshotElem != null )
-            {
-                SnapshotVersion snapshot = new SnapshotVersion( );
-                snapshot.setTimestamp( XmlUtil.getChildText( snapshotElem, "timestamp" ) );
-                String buildNumber = XmlUtil.getChildText( snapshotElem, "buildNumber" );
-                if ( NumberUtils.isCreatable( buildNumber ) )
-                {
-                    snapshot.setBuildNumber( NumberUtils.toInt( buildNumber ) );
-                }
-                metadata.setSnapshotVersion( snapshot );
-            }
-
-            for ( Node node : xml.getElementList( "//metadata/plugins/plugin" ) )
-            {
-                if ( node instanceof Element )
-                {
-                    Element plugin = (Element) node;
-                    Plugin p = new Plugin( );
-                    String prefix = plugin.getElementsByTagName( "prefix" ).item( 0 ).getTextContent( ).trim( );
-                    p.setPrefix( prefix );
-                    String artifactId = plugin.getElementsByTagName( "artifactId" ).item( 0 ).getTextContent( ).trim( );
-                    p.setArtifactId( artifactId );
-                    String name = plugin.getElementsByTagName( "name" ).item( 0 ).getTextContent( ).trim( );
-                    p.setName( name );
-                    metadata.addPlugin( p );
-                }
-            }
-        } catch ( XMLException e) {
-            throw new RepositoryMetadataException( "XML Error while reading metadata file : " + e.getMessage( ), e );
-        }
-        return metadata;
-    }
-
-    @Override
-    public boolean isValidMetadataPath( String path )
-    {
-        if ( StringUtils.isNotEmpty( path ) ) {
-            return path.endsWith( MAVEN_METADATA );
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public boolean isValidForType( RepositoryType repositoryType )
-    {
-        return RepositoryType.MAVEN.equals( repositoryType );
-    }
-}
diff --git a/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/model/MavenArtifactFacet.java b/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/model/MavenArtifactFacet.java
deleted file mode 100644 (file)
index 6d0f8df..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-package org.apache.archiva.metadata.maven.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.metadata.model.MetadataFacet;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class MavenArtifactFacet
-    implements MetadataFacet
-{
-    private String classifier;
-
-    private String type;
-
-    private String timestamp;
-
-    private int buildNumber;
-
-    public static final String FACET_ID = "org.apache.archiva.metadata.repository.storage.maven2.artifact";
-
-    public String getClassifier()
-    {
-        return classifier;
-    }
-
-    public void setClassifier( String classifier )
-    {
-        this.classifier = classifier;
-    }
-
-    public String getType()
-    {
-        return type;
-    }
-
-    public void setType( String type )
-    {
-        this.type = type;
-    }
-
-    public String getTimestamp()
-    {
-        return timestamp;
-    }
-
-    public void setTimestamp( String timestamp )
-    {
-        this.timestamp = timestamp;
-    }
-
-    public int getBuildNumber()
-    {
-        return buildNumber;
-    }
-
-    public void setBuildNumber( int buildNumber )
-    {
-        this.buildNumber = buildNumber;
-    }
-
-    @Override
-    public String getFacetId()
-    {
-        return FACET_ID;
-    }
-
-    @Override
-    public String getName()
-    {
-        // TODO: not needed, perhaps artifact/version metadata facet should be separate interface?
-        return null;
-    }
-
-    @Override
-    public Map<String, String> toProperties()
-    {
-        Map<String, String> properties = new HashMap<>();
-        properties.put( "type", type );
-        if ( classifier != null )
-        {
-            properties.put( "classifier", classifier );
-        }
-        if ( timestamp != null )
-        {
-            properties.put( "timestamp", timestamp );
-        }
-        if ( buildNumber > 0 )
-        {
-            properties.put( "buildNumber", Integer.toString( buildNumber ) );
-        }
-        return properties;
-    }
-
-    @Override
-    public void fromProperties( Map<String, String> properties )
-    {
-        type = properties.get( "type" );
-        classifier = properties.get( "classifier" );
-        timestamp = properties.get( "timestamp" );
-        String buildNumber = properties.get( "buildNumber" );
-        if ( buildNumber != null )
-        {
-            this.buildNumber = Integer.parseInt( buildNumber );
-        }
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( !( o instanceof MavenArtifactFacet ) )
-        {
-            return false;
-        }
-
-        MavenArtifactFacet that = (MavenArtifactFacet) o;
-
-        return StringUtils.equals( that.getClassifier(), this.classifier );
-    }
-
-}
index 4163a146092cd5b2c83e368dbb63a9282c11ffff..498e98c05ce1027d97ad91b70d72a8f999b29baf 100644 (file)
@@ -28,6 +28,6 @@
        default-lazy-init="true">
 
   <context:annotation-config/>
-  <context:component-scan base-package="org.apache.archiva.metadata.maven"/>
+  <context:component-scan base-package="org.apache.archiva.maven.metadata"/>
 
 </beans>
\ No newline at end of file
diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/maven/proxy/MavenRepositoryProxyHandler.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/maven/proxy/MavenRepositoryProxyHandler.java
new file mode 100644 (file)
index 0000000..ae41391
--- /dev/null
@@ -0,0 +1,388 @@
+package org.apache.archiva.maven.proxy;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.proxy.DefaultRepositoryProxyHandler;
+import org.apache.archiva.proxy.NotFoundException;
+import org.apache.archiva.proxy.NotModifiedException;
+import org.apache.archiva.proxy.ProxyException;
+import org.apache.archiva.proxy.model.NetworkProxy;
+import org.apache.archiva.proxy.model.ProxyConnector;
+import org.apache.archiva.proxy.model.RepositoryProxyHandler;
+import org.apache.archiva.repository.ManagedRepository;
+import org.apache.archiva.repository.RemoteRepository;
+import org.apache.archiva.repository.RepositoryCredentials;
+import org.apache.archiva.repository.RepositoryType;
+import org.apache.archiva.repository.base.PasswordCredentials;
+import org.apache.archiva.repository.storage.StorageAsset;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.WagonException;
+import org.apache.maven.wagon.authentication.AuthenticationException;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+import org.apache.maven.wagon.proxy.ProxyInfo;
+import org.apache.maven.wagon.repository.Repository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import java.io.IOException;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+/**
+ * DefaultRepositoryProxyHandler
+ * TODO exception handling needs work - "not modified" is not really an exceptional case, and it has more layers than
+ * your average brown onion
+ */
+@Service( "repositoryProxyHandler#maven" )
+public class MavenRepositoryProxyHandler extends DefaultRepositoryProxyHandler {
+
+    private static final Logger log = LoggerFactory.getLogger( MavenRepositoryProxyHandler.class );
+
+    private static final List<RepositoryType> REPOSITORY_TYPES = new ArrayList<>();
+
+    static {
+        REPOSITORY_TYPES.add(RepositoryType.MAVEN);
+    }
+
+    @Inject
+    private WagonFactory wagonFactory;
+
+    private ConcurrentMap<String, ProxyInfo> networkProxyMap = new ConcurrentHashMap<>();
+
+    @Override
+    public void initialize() {
+        super.initialize();
+    }
+
+    private void updateWagonProxyInfo(Map<String, NetworkProxy> proxyList) {
+        this.networkProxyMap.clear();
+        for (Map.Entry<String, NetworkProxy> proxyEntry : proxyList.entrySet()) {
+            String key = proxyEntry.getKey();
+            NetworkProxy networkProxyDef = proxyEntry.getValue();
+
+            ProxyInfo proxy = new ProxyInfo();
+
+            proxy.setType(networkProxyDef.getProtocol());
+            proxy.setHost(networkProxyDef.getHost());
+            proxy.setPort(networkProxyDef.getPort());
+            proxy.setUserName(networkProxyDef.getUsername());
+            proxy.setPassword(new String(networkProxyDef.getPassword()));
+
+            this.networkProxyMap.put(key, proxy);
+        }
+    }
+
+    @Override
+    public void setNetworkProxies(Map<String, NetworkProxy> networkProxies ) {
+        super.setNetworkProxies( networkProxies );
+        updateWagonProxyInfo( networkProxies );
+    }
+
+    /**
+     * @param connector
+     * @param remoteRepository
+     * @param tmpResource
+     * @param checksumFiles
+     * @param url
+     * @param remotePath
+     * @param resource
+     * @param workingDirectory
+     * @param repository
+     * @throws ProxyException
+     * @throws NotModifiedException
+     */
+    @Override
+    protected void transferResources( ProxyConnector connector, RemoteRepository remoteRepository,
+                                      StorageAsset tmpResource, StorageAsset[] checksumFiles, String url, String remotePath, StorageAsset resource,
+                                      Path workingDirectory, ManagedRepository repository )
+            throws ProxyException, NotModifiedException {
+        Wagon wagon = null;
+        try {
+            URI repoUrl = remoteRepository.getLocation( );
+            String protocol = repoUrl.getScheme( );
+            NetworkProxy networkProxy = null;
+            String proxyId = connector.getProxyId();
+            if (StringUtils.isNotBlank(proxyId)) {
+
+                networkProxy = getNetworkProxy(proxyId);
+            }
+            WagonFactoryRequest wagonFactoryRequest = new WagonFactoryRequest("wagon#" + protocol,
+                    remoteRepository.getExtraHeaders());
+            if (networkProxy == null) {
+
+                log.warn("No network proxy with id {} found for connector {}->{}", proxyId,
+                        connector.getSourceRepository().getId(), connector.getTargetRepository().getId());
+            } else {
+                wagonFactoryRequest = wagonFactoryRequest.networkProxy(networkProxy);
+            }
+            wagon = wagonFactory.getWagon(wagonFactoryRequest);
+            if (wagon == null) {
+                throw new ProxyException("Unsupported target repository protocol: " + protocol);
+            }
+
+            boolean connected = connectToRepository(connector, wagon, remoteRepository);
+            if (connected) {
+                transferArtifact(wagon, remoteRepository, remotePath, resource.getFilePath(),
+                    tmpResource);
+
+                // TODO: these should be used to validate the download based on the policies, not always downloaded
+                // to
+                // save on connections since md5 is rarely used
+                for ( StorageAsset checksumFile : checksumFiles )
+                {
+                    String ext = "." + StringUtils.substringAfterLast( checksumFile.getName( ), "." );
+                    transferChecksum( wagon, remoteRepository, remotePath, resource.getFilePath( ), ext,
+                        checksumFile.getFilePath( ) );
+                }
+            }
+        }
+        catch (NotModifiedException e) {
+            // Do not cache url here.
+            throw e;
+        }
+        catch ( ProxyException e) {
+            urlFailureCache.cacheFailure(url);
+            throw e;
+        }
+        catch (WagonFactoryException e) {
+            throw new ProxyException(e.getMessage(), e);
+        } finally {
+            if (wagon != null) {
+                try {
+                    wagon.disconnect();
+                } catch (ConnectionException e) {
+                    log.warn("Unable to disconnect wagon.", e);
+                }
+            }
+        }
+    }
+
+    protected void transferArtifact( Wagon wagon, RemoteRepository remoteRepository, String remotePath,
+                                     Path resource,
+                                     StorageAsset destFile )
+            throws ProxyException {
+        transferSimpleFile(wagon, remoteRepository, remotePath, resource, destFile.getFilePath());
+    }
+
+    /**
+     * <p>
+     * Quietly transfer the checksum file from the remote repository to the local file.
+     * </p>
+     *
+     * @param wagon            the wagon instance (should already be connected) to use.
+     * @param remoteRepository the remote repository to transfer from.
+     * @param remotePath       the remote path to the resource to get.
+     * @param resource         the local file that should contain the downloaded contents
+     * @param ext              the type of checksum to transfer (example: ".md5" or ".sha1")
+     * @throws ProxyException if copying the downloaded file into place did not succeed.
+     */
+    protected void transferChecksum( Wagon wagon, RemoteRepository remoteRepository, String remotePath,
+                                     Path resource, String ext,
+                                     Path destFile )
+            throws ProxyException {
+        String url = remoteRepository.getLocation().toString() + remotePath + ext;
+
+        // Transfer checksum does not use the policy.
+        if (urlFailureCache.hasFailedBefore(url)) {
+            return;
+        }
+
+        try {
+            transferSimpleFile(wagon, remoteRepository, remotePath + ext, resource, destFile);
+            log.debug("Checksum {} Downloaded: {} to move to {}", url, destFile, resource);
+        } catch (NotFoundException e) {
+            urlFailureCache.cacheFailure(url);
+            log.debug("Transfer failed, checksum not found: {}", url);
+            // Consume it, do not pass this on.
+        } catch (NotModifiedException e) {
+            log.debug("Transfer skipped, checksum not modified: {}", url);
+            // Consume it, do not pass this on.
+        } catch (ProxyException e) {
+            urlFailureCache.cacheFailure(url);
+            log.warn("Transfer failed on checksum: {} : {}", url, e.getMessage(), e);
+            // Critical issue, pass it on.
+            throw e;
+        }
+    }
+
+    /**
+     * Perform the transfer of the remote file to the local file specified.
+     *
+     * @param wagon            the wagon instance to use.
+     * @param remoteRepository the remote repository to use
+     * @param remotePath       the remote path to attempt to get
+     * @param origFile         the local file to save to
+     * @throws ProxyException if there was a problem moving the downloaded file into place.
+     */
+    protected void transferSimpleFile( Wagon wagon, RemoteRepository remoteRepository, String remotePath,
+                                       Path origFile, Path destFile )
+            throws ProxyException {
+        assert (remotePath != null);
+
+        // Transfer the file.
+        try {
+
+
+            if (!Files.exists(origFile)) {
+                log.debug("Retrieving {} from {}", remotePath, remoteRepository.getId());
+                wagon.get(addParameters(remotePath, remoteRepository), destFile.toFile());
+
+                // You wouldn't get here on failure, a WagonException would have been thrown.
+                log.debug("Downloaded successfully.");
+            } else {
+                boolean success;
+                log.debug("Retrieving {} from {} if updated", remotePath, remoteRepository.getId());
+                try {
+                    success = wagon.getIfNewer(addParameters(remotePath, remoteRepository), destFile.toFile(),
+                            Files.getLastModifiedTime(origFile).toMillis());
+                } catch (IOException e) {
+                    throw new ProxyException("Failed to the modification time of " + origFile.toAbsolutePath());
+                }
+                if (!success) {
+                    throw new NotModifiedException(
+                            "Not downloaded, as local file is newer than remote side: " + origFile.toAbsolutePath());
+                }
+
+                if (Files.exists(destFile)) {
+                    log.debug("Downloaded successfully.");
+                }
+            }
+        } catch (ResourceDoesNotExistException e) {
+            throw new NotFoundException(
+                    "Resource [" + remoteRepository.getLocation() + "/" + remotePath + "] does not exist: " + e.getMessage(),
+                    e);
+        } catch (WagonException e) {
+            // TODO: shouldn't have to drill into the cause, but TransferFailedException is often not descriptive enough
+
+            String msg =
+                    "Download failure on resource [" + remoteRepository.getLocation() + "/" + remotePath + "]:" + e.getMessage();
+            if (e.getCause() != null) {
+                msg += " (cause: " + e.getCause() + ")";
+            }
+            throw new ProxyException(msg, e);
+        }
+    }
+
+    /**
+     * Using wagon, connect to the remote repository.
+     *
+     * @param connector        the connector configuration to utilize (for obtaining network proxy configuration from)
+     * @param wagon            the wagon instance to establish the connection on.
+     * @param remoteRepository the remote repository to connect to.
+     * @return true if the connection was successful. false if not connected.
+     */
+    protected boolean connectToRepository(ProxyConnector connector, Wagon wagon,
+                                          RemoteRepository remoteRepository) {
+        final ProxyInfo networkProxy =
+                connector.getProxyId() == null ? null : this.networkProxyMap.get(connector.getProxyId());
+
+        if (log.isDebugEnabled()) {
+            if (networkProxy != null) {
+                // TODO: move to proxyInfo.toString()
+                String msg = "Using network proxy " + networkProxy.getHost() + ":" + networkProxy.getPort()
+                        + " to connect to remote repository " + remoteRepository.getLocation();
+                if (networkProxy.getNonProxyHosts() != null) {
+                    msg += "; excluding hosts: " + networkProxy.getNonProxyHosts();
+                }
+                if (StringUtils.isNotBlank(networkProxy.getUserName())) {
+                    msg += "; as user: " + networkProxy.getUserName();
+                }
+                log.debug(msg);
+            }
+        }
+
+        AuthenticationInfo authInfo = null;
+        String username = "";
+        String password = "";
+        RepositoryCredentials repCred = remoteRepository.getLoginCredentials();
+        if (repCred != null && repCred instanceof PasswordCredentials ) {
+            PasswordCredentials pwdCred = (PasswordCredentials) repCred;
+            username = pwdCred.getUsername();
+            password = pwdCred.getPassword() == null ? "" : new String(pwdCred.getPassword());
+        }
+
+        if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)) {
+            log.debug("Using username {} to connect to remote repository {}", username, remoteRepository.getLocation());
+            authInfo = new AuthenticationInfo();
+            authInfo.setUserName(username);
+            authInfo.setPassword(password);
+        }
+
+        // Convert seconds to milliseconds
+
+        long timeoutInMilliseconds = remoteRepository.getTimeout().toMillis();
+
+        // Set timeout  read and connect
+        // FIXME olamy having 2 config values
+        wagon.setReadTimeout((int) timeoutInMilliseconds);
+        wagon.setTimeout((int) timeoutInMilliseconds);
+
+        try {
+            Repository wagonRepository =
+                    new Repository(remoteRepository.getId(), remoteRepository.getLocation().toString());
+            wagon.connect(wagonRepository, authInfo, networkProxy);
+            return true;
+        } catch (ConnectionException | AuthenticationException e) {
+            log.warn("Could not connect to {}: {}", remoteRepository.getId(), e.getMessage());
+            return false;
+        }
+
+    }
+
+
+    public WagonFactory getWagonFactory() {
+        return wagonFactory;
+    }
+
+    public void setWagonFactory(WagonFactory wagonFactory) {
+        this.wagonFactory = wagonFactory;
+    }
+
+    @Override
+    public List<RepositoryType> supports() {
+        return REPOSITORY_TYPES;
+    }
+
+    @Override
+    public void addNetworkproxy( String id, NetworkProxy networkProxy )
+    {
+
+    }
+
+    @Override
+    public <T extends RepositoryProxyHandler> T getHandler( Class<T> clazz ) throws IllegalArgumentException
+    {
+        if (clazz.isAssignableFrom( this.getClass() )) {
+            return (T)this;
+        } else {
+            throw new IllegalArgumentException( "This Proxy Handler is no subclass of " + clazz );
+        }
+    }
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/main/java/org/apache/archiva/proxy/maven/MavenRepositoryProxyHandler.java
deleted file mode 100644 (file)
index 477185a..0000000
+++ /dev/null
@@ -1,389 +0,0 @@
-package org.apache.archiva.proxy.maven;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.proxy.DefaultRepositoryProxyHandler;
-import org.apache.archiva.proxy.NotFoundException;
-import org.apache.archiva.proxy.NotModifiedException;
-import org.apache.archiva.proxy.ProxyException;
-import org.apache.archiva.proxy.model.NetworkProxy;
-import org.apache.archiva.proxy.model.ProxyConnector;
-import org.apache.archiva.proxy.model.RepositoryProxyHandler;
-import org.apache.archiva.repository.ManagedRepository;
-import org.apache.archiva.repository.RemoteRepository;
-import org.apache.archiva.repository.RepositoryCredentials;
-import org.apache.archiva.repository.RepositoryType;
-import org.apache.archiva.repository.base.PasswordCredentials;
-import org.apache.archiva.repository.storage.StorageAsset;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.maven.wagon.ConnectionException;
-import org.apache.maven.wagon.ResourceDoesNotExistException;
-import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.WagonException;
-import org.apache.maven.wagon.authentication.AuthenticationException;
-import org.apache.maven.wagon.authentication.AuthenticationInfo;
-import org.apache.maven.wagon.proxy.ProxyInfo;
-import org.apache.maven.wagon.repository.Repository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import javax.inject.Inject;
-import java.io.IOException;
-import java.net.URI;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * DefaultRepositoryProxyHandler
- * TODO exception handling needs work - "not modified" is not really an exceptional case, and it has more layers than
- * your average brown onion
- */
-@Service( "repositoryProxyHandler#maven" )
-public class MavenRepositoryProxyHandler extends DefaultRepositoryProxyHandler {
-
-    private static final Logger log = LoggerFactory.getLogger( MavenRepositoryProxyHandler.class );
-
-    private static final List<RepositoryType> REPOSITORY_TYPES = new ArrayList<>();
-
-    static {
-        REPOSITORY_TYPES.add(RepositoryType.MAVEN);
-    }
-
-    @Inject
-    private WagonFactory wagonFactory;
-
-    private ConcurrentMap<String, ProxyInfo> networkProxyMap = new ConcurrentHashMap<>();
-
-    @Override
-    public void initialize() {
-        super.initialize();
-    }
-
-    private void updateWagonProxyInfo(Map<String, NetworkProxy> proxyList) {
-        this.networkProxyMap.clear();
-        for (Map.Entry<String, NetworkProxy> proxyEntry : proxyList.entrySet()) {
-            String key = proxyEntry.getKey();
-            NetworkProxy networkProxyDef = proxyEntry.getValue();
-
-            ProxyInfo proxy = new ProxyInfo();
-
-            proxy.setType(networkProxyDef.getProtocol());
-            proxy.setHost(networkProxyDef.getHost());
-            proxy.setPort(networkProxyDef.getPort());
-            proxy.setUserName(networkProxyDef.getUsername());
-            proxy.setPassword(new String(networkProxyDef.getPassword()));
-
-            this.networkProxyMap.put(key, proxy);
-        }
-    }
-
-    @Override
-    public void setNetworkProxies(Map<String, NetworkProxy> networkProxies ) {
-        super.setNetworkProxies( networkProxies );
-        updateWagonProxyInfo( networkProxies );
-    }
-
-    /**
-     * @param connector
-     * @param remoteRepository
-     * @param tmpResource
-     * @param checksumFiles
-     * @param url
-     * @param remotePath
-     * @param resource
-     * @param workingDirectory
-     * @param repository
-     * @throws ProxyException
-     * @throws NotModifiedException
-     */
-    @Override
-    protected void transferResources( ProxyConnector connector, RemoteRepository remoteRepository,
-                                      StorageAsset tmpResource, StorageAsset[] checksumFiles, String url, String remotePath, StorageAsset resource,
-                                      Path workingDirectory, ManagedRepository repository )
-            throws ProxyException, NotModifiedException {
-        Wagon wagon = null;
-        try {
-            URI repoUrl = remoteRepository.getLocation( );
-            String protocol = repoUrl.getScheme( );
-            NetworkProxy networkProxy = null;
-            String proxyId = connector.getProxyId();
-            if (StringUtils.isNotBlank(proxyId)) {
-
-                networkProxy = getNetworkProxy(proxyId);
-            }
-            WagonFactoryRequest wagonFactoryRequest = new WagonFactoryRequest("wagon#" + protocol,
-                    remoteRepository.getExtraHeaders());
-            if (networkProxy == null) {
-
-                log.warn("No network proxy with id {} found for connector {}->{}", proxyId,
-                        connector.getSourceRepository().getId(), connector.getTargetRepository().getId());
-            } else {
-                wagonFactoryRequest = wagonFactoryRequest.networkProxy(networkProxy);
-            }
-            wagon = wagonFactory.getWagon(wagonFactoryRequest);
-            if (wagon == null) {
-                throw new ProxyException("Unsupported target repository protocol: " + protocol);
-            }
-
-            boolean connected = connectToRepository(connector, wagon, remoteRepository);
-            if (connected) {
-                transferArtifact(wagon, remoteRepository, remotePath, resource.getFilePath(),
-                    tmpResource);
-
-                // TODO: these should be used to validate the download based on the policies, not always downloaded
-                // to
-                // save on connections since md5 is rarely used
-                for ( StorageAsset checksumFile : checksumFiles )
-                {
-                    String ext = "." + StringUtils.substringAfterLast( checksumFile.getName( ), "." );
-                    transferChecksum( wagon, remoteRepository, remotePath, resource.getFilePath( ), ext,
-                        checksumFile.getFilePath( ) );
-                }
-            }
-        }
-        catch (NotModifiedException e) {
-            // Do not cache url here.
-            throw e;
-        }
-        catch ( ProxyException e) {
-            urlFailureCache.cacheFailure(url);
-            throw e;
-        }
-        catch (WagonFactoryException e) {
-            throw new ProxyException(e.getMessage(), e);
-        } finally {
-            if (wagon != null) {
-                try {
-                    wagon.disconnect();
-                } catch (ConnectionException e) {
-                    log.warn("Unable to disconnect wagon.", e);
-                }
-            }
-        }
-    }
-
-    protected void transferArtifact( Wagon wagon, RemoteRepository remoteRepository, String remotePath,
-                                     Path resource,
-                                     StorageAsset destFile )
-            throws ProxyException {
-        transferSimpleFile(wagon, remoteRepository, remotePath, resource, destFile.getFilePath());
-    }
-
-    /**
-     * <p>
-     * Quietly transfer the checksum file from the remote repository to the local file.
-     * </p>
-     *
-     * @param wagon            the wagon instance (should already be connected) to use.
-     * @param remoteRepository the remote repository to transfer from.
-     * @param remotePath       the remote path to the resource to get.
-     * @param resource         the local file that should contain the downloaded contents
-     * @param ext              the type of checksum to transfer (example: ".md5" or ".sha1")
-     * @throws ProxyException if copying the downloaded file into place did not succeed.
-     */
-    protected void transferChecksum( Wagon wagon, RemoteRepository remoteRepository, String remotePath,
-                                     Path resource, String ext,
-                                     Path destFile )
-            throws ProxyException {
-        String url = remoteRepository.getLocation().toString() + remotePath + ext;
-
-        // Transfer checksum does not use the policy.
-        if (urlFailureCache.hasFailedBefore(url)) {
-            return;
-        }
-
-        try {
-            transferSimpleFile(wagon, remoteRepository, remotePath + ext, resource, destFile);
-            log.debug("Checksum {} Downloaded: {} to move to {}", url, destFile, resource);
-        } catch (NotFoundException e) {
-            urlFailureCache.cacheFailure(url);
-            log.debug("Transfer failed, checksum not found: {}", url);
-            // Consume it, do not pass this on.
-        } catch (NotModifiedException e) {
-            log.debug("Transfer skipped, checksum not modified: {}", url);
-            // Consume it, do not pass this on.
-        } catch (ProxyException e) {
-            urlFailureCache.cacheFailure(url);
-            log.warn("Transfer failed on checksum: {} : {}", url, e.getMessage(), e);
-            // Critical issue, pass it on.
-            throw e;
-        }
-    }
-
-    /**
-     * Perform the transfer of the remote file to the local file specified.
-     *
-     * @param wagon            the wagon instance to use.
-     * @param remoteRepository the remote repository to use
-     * @param remotePath       the remote path to attempt to get
-     * @param origFile         the local file to save to
-     * @throws ProxyException if there was a problem moving the downloaded file into place.
-     */
-    protected void transferSimpleFile( Wagon wagon, RemoteRepository remoteRepository, String remotePath,
-                                       Path origFile, Path destFile )
-            throws ProxyException {
-        assert (remotePath != null);
-
-        // Transfer the file.
-        try {
-
-
-            if (!Files.exists(origFile)) {
-                log.debug("Retrieving {} from {}", remotePath, remoteRepository.getId());
-                wagon.get(addParameters(remotePath, remoteRepository), destFile.toFile());
-
-                // You wouldn't get here on failure, a WagonException would have been thrown.
-                log.debug("Downloaded successfully.");
-            } else {
-                boolean success;
-                log.debug("Retrieving {} from {} if updated", remotePath, remoteRepository.getId());
-                try {
-                    success = wagon.getIfNewer(addParameters(remotePath, remoteRepository), destFile.toFile(),
-                            Files.getLastModifiedTime(origFile).toMillis());
-                } catch (IOException e) {
-                    throw new ProxyException("Failed to the modification time of " + origFile.toAbsolutePath());
-                }
-                if (!success) {
-                    throw new NotModifiedException(
-                            "Not downloaded, as local file is newer than remote side: " + origFile.toAbsolutePath());
-                }
-
-                if (Files.exists(destFile)) {
-                    log.debug("Downloaded successfully.");
-                }
-            }
-        } catch (ResourceDoesNotExistException e) {
-            throw new NotFoundException(
-                    "Resource [" + remoteRepository.getLocation() + "/" + remotePath + "] does not exist: " + e.getMessage(),
-                    e);
-        } catch (WagonException e) {
-            // TODO: shouldn't have to drill into the cause, but TransferFailedException is often not descriptive enough
-
-            String msg =
-                    "Download failure on resource [" + remoteRepository.getLocation() + "/" + remotePath + "]:" + e.getMessage();
-            if (e.getCause() != null) {
-                msg += " (cause: " + e.getCause() + ")";
-            }
-            throw new ProxyException(msg, e);
-        }
-    }
-
-    /**
-     * Using wagon, connect to the remote repository.
-     *
-     * @param connector        the connector configuration to utilize (for obtaining network proxy configuration from)
-     * @param wagon            the wagon instance to establish the connection on.
-     * @param remoteRepository the remote repository to connect to.
-     * @return true if the connection was successful. false if not connected.
-     */
-    protected boolean connectToRepository(ProxyConnector connector, Wagon wagon,
-                                          RemoteRepository remoteRepository) {
-        final ProxyInfo networkProxy =
-                connector.getProxyId() == null ? null : this.networkProxyMap.get(connector.getProxyId());
-
-        if (log.isDebugEnabled()) {
-            if (networkProxy != null) {
-                // TODO: move to proxyInfo.toString()
-                String msg = "Using network proxy " + networkProxy.getHost() + ":" + networkProxy.getPort()
-                        + " to connect to remote repository " + remoteRepository.getLocation();
-                if (networkProxy.getNonProxyHosts() != null) {
-                    msg += "; excluding hosts: " + networkProxy.getNonProxyHosts();
-                }
-                if (StringUtils.isNotBlank(networkProxy.getUserName())) {
-                    msg += "; as user: " + networkProxy.getUserName();
-                }
-                log.debug(msg);
-            }
-        }
-
-        AuthenticationInfo authInfo = null;
-        String username = "";
-        String password = "";
-        RepositoryCredentials repCred = remoteRepository.getLoginCredentials();
-        if (repCred != null && repCred instanceof PasswordCredentials ) {
-            PasswordCredentials pwdCred = (PasswordCredentials) repCred;
-            username = pwdCred.getUsername();
-            password = pwdCred.getPassword() == null ? "" : new String(pwdCred.getPassword());
-        }
-
-        if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)) {
-            log.debug("Using username {} to connect to remote repository {}", username, remoteRepository.getLocation());
-            authInfo = new AuthenticationInfo();
-            authInfo.setUserName(username);
-            authInfo.setPassword(password);
-        }
-
-        // Convert seconds to milliseconds
-
-        long timeoutInMilliseconds = remoteRepository.getTimeout().toMillis();
-
-        // Set timeout  read and connect
-        // FIXME olamy having 2 config values
-        wagon.setReadTimeout((int) timeoutInMilliseconds);
-        wagon.setTimeout((int) timeoutInMilliseconds);
-
-        try {
-            Repository wagonRepository =
-                    new Repository(remoteRepository.getId(), remoteRepository.getLocation().toString());
-            wagon.connect(wagonRepository, authInfo, networkProxy);
-            return true;
-        } catch (ConnectionException | AuthenticationException e) {
-            log.warn("Could not connect to {}: {}", remoteRepository.getId(), e.getMessage());
-            return false;
-        }
-
-    }
-
-
-    public WagonFactory getWagonFactory() {
-        return wagonFactory;
-    }
-
-    public void setWagonFactory(WagonFactory wagonFactory) {
-        this.wagonFactory = wagonFactory;
-    }
-
-    @Override
-    public List<RepositoryType> supports() {
-        return REPOSITORY_TYPES;
-    }
-
-    @Override
-    public void addNetworkproxy( String id, NetworkProxy networkProxy )
-    {
-
-    }
-
-    @Override
-    public <T extends RepositoryProxyHandler> T getHandler( Class<T> clazz ) throws IllegalArgumentException
-    {
-        if (clazz.isAssignableFrom( this.getClass() )) {
-            return (T)this;
-        } else {
-            throw new IllegalArgumentException( "This Proxy Handler is no subclass of " + clazz );
-        }
-    }
-}
index f7289383ccf24ae5c7e505e360eed213698c60ef..6b59078626646e859f940ae0e2f6aa19af16dd3a 100644 (file)
@@ -20,8 +20,8 @@ package org.apache.archiva.proxy.common;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
 import org.apache.maven.wagon.Wagon;
 import org.junit.Test;
@@ -47,9 +47,9 @@ public class WagonFactoryTest
         throws Exception
     {
 
-        Wagon first = factory.getWagon( new org.apache.archiva.proxy.maven.WagonFactoryRequest().protocol( "wagon#file" ) );
+        Wagon first = factory.getWagon( new WagonFactoryRequest().protocol( "wagon#file" ) );
 
-        Wagon second = factory.getWagon( new org.apache.archiva.proxy.maven.WagonFactoryRequest().protocol( "wagon#file" ) );
+        Wagon second = factory.getWagon( new WagonFactoryRequest().protocol( "wagon#file" ) );
 
         // ensure we support only protocol name too
         Wagon third = factory.getWagon( new WagonFactoryRequest().protocol( "file" ) );
index 237b9046b0ef431af3bf222ef14e0b51892fe061..5c1566dee9ae3076932f47fa49ee08dea5e5d707 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.repository.mock;
 
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.repository.content.BaseRepositoryContentLayout;
 import org.apache.archiva.repository.content.ContentAccessException;
index d9cc2c985699a4b86ed22a3bded76013bea351e2..d60773700379de546cb0b9fd0485c9761c7bc60b 100755 (executable)
@@ -50,7 +50,7 @@
   <bean name="repositoryContentProvider#mocked" class="org.apache.archiva.repository.mock.RepositoryContentProviderMock" />
 
 
-  <bean name="repositoryProxyHandler#test" class="org.apache.archiva.proxy.maven.MavenRepositoryProxyHandler">
+  <bean name="repositoryProxyHandler#test" class="org.apache.archiva.maven.proxy.MavenRepositoryProxyHandler">
     <property name="archivaConfiguration" ref="archivaConfiguration#mock"/>
     <property name="metadataTools" ref="metadataTools#mocked"/>
   </bean>
index b0c7b5e2e05b44a8701e94897ca6e90912187135..88711a58f9c55d5a254ebdf146e5c3339379aa73 100644 (file)
@@ -22,7 +22,7 @@ import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.FileUtils;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.configuration.FileTypes;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.repository.EditableManagedRepository;
 import org.apache.archiva.repository.ItemDeleteStatus;
 import org.apache.archiva.repository.ManagedRepository;
index 70e52f6079c03ff8a1167e94261bbd51804d07ee..60a9a55623ae258de5c83142d01405da28ee012c 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.content;
  */
 
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.SnapshotVersion;
 import org.apache.archiva.repository.content.ItemSelector;
index a83c3e13dcd6a0c039fc164747ad6d5cfe224886..4877a14178f67de09f20fb4b8957094d768dffcc 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.maven2.model.TreeEntry;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.repository.ManagedRepository;
index 6f63592dc1408ad67ffd7da52f6aed200a5b9d28..1f21f6ffac07c2d7105297c1bd233d521fe96623 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.archiva.configuration.ArchivaConfiguration;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.archiva.filter.Filter;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
index facfc0549253d5230fda4eba7264f5e6ea55196c..91c62bd7e70f74c172624fdaddb45e01a2a5acfa 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.metadata.storage;
  */
 
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.repository.storage.StorageAsset;
index 7ebbe93cffd080eb57b53ea611176b21fa25597c..cc6ad243feec2c7a014e22268e1b176d48e50f54 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.checksum.ChecksummedFile;
 import org.apache.archiva.common.Try;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.filter.Filter;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
@@ -39,7 +39,7 @@ import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.SnapshotVersion;
 import org.apache.archiva.policies.ProxyDownloadException;
 import org.apache.archiva.proxy.ProxyRegistry;
-import org.apache.archiva.proxy.maven.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactory;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.proxy.model.ProxyConnector;
 import org.apache.archiva.proxy.model.RepositoryProxyHandler;
index cf436582d23f3ed0b9a5e59b533385cd51e92363..a1ad2e5ae4d16c9738d2837d45d24ac6e37306a5 100644 (file)
@@ -18,7 +18,7 @@ package org.apache.archiva.repository.maven.metadata.storage;
  * under the License.
  */
 
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.model.facets.AbstractMetadataFacetFactory;
 import org.springframework.stereotype.Service;
 
index 6b72cc1583e7fede3fcc063cad82abea4461785b..79c415a43e4158b9f3d667498481e814d22f0e4e 100644 (file)
@@ -19,13 +19,13 @@ package org.apache.archiva.repository.maven.metadata.storage;
  */
 
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.SnapshotVersion;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryException;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryException;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.RemoteRepository;
index 2028cf1a47d1daf700eacf91a501684e672fda90..656c1c3eba4859b2c963acd296309dd855b278c1 100644 (file)
@@ -18,7 +18,7 @@ package org.apache.archiva.repository.maven.content;
  * under the License.
  */
 
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider;
index 067098ed8f47bfc6c7e9a3f3949d43f4820171c3..0b74e9dac9c69d5079d8c99808e7af22b4e68fdc 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.common.utils.VersionComparator;
 import org.apache.archiva.configuration.ArchivaConfiguration;
 import org.apache.archiva.configuration.FileType;
 import org.apache.archiva.configuration.FileTypes;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.repository.EditableManagedRepository;
 import org.apache.archiva.repository.ManagedRepository;
index 1fc0fc5706ebf76d58eb1f89675aee2a2fdd2970..0de06b8380998c555e6aaab96f19a97103f7dd47 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.content;
  */
 
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.repository.content.ItemSelector;
 import org.apache.archiva.repository.content.base.ArchivaItemSelector;
 import org.apache.archiva.repository.storage.StorageAsset;
index 3d04c907eac8efed891fefc755243e2ad5c8b34c..34799465a74201c58bbe65db5e591fe2509ea389 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.metadata;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.repository.metadata.RepositoryMetadataException;
 import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
index 57ec29ae5a474d79c37410ebc21c9d70d4e3bf00..5c0f58f2c6fe53c67757f7152285f3a973d0487c 100644 (file)
@@ -33,8 +33,8 @@ import org.apache.archiva.metadata.model.License;
 import org.apache.archiva.metadata.model.MailingList;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.repository.RepositoryRegistry;
 import org.apache.archiva.repository.base.RepositoryHandlerDependencies;
 import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
index c7a7bafb760646bc42186bf218df0bde63a68be6..45d0d1f7309ceb834dd53b1369f4cf8042524c8e 100644 (file)
@@ -33,8 +33,8 @@ import org.apache.archiva.metadata.model.MailingList;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
 import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.repository.ReleaseScheme;
 import org.apache.archiva.repository.RepositoryRegistry;
 import org.apache.archiva.repository.base.RepositoryHandlerDependencies;
index c786302d95a18aa79a94b51e8c4d6b32f38efc77..5d522949cb3d9e4df3240d80b661250be9be604a 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.filter.Filter;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
 import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException;
-import org.apache.archiva.proxy.maven.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactory;
 import org.apache.archiva.repository.RepositoryRegistry;
 import org.apache.archiva.repository.base.RepositoryHandlerDependencies;
 import org.junit.Before;
index ca54e8b4980e50f9b6723617dee9befa54d4d0fc..ddc02df342135465880f30c38c9d00eac1da01e6 100644 (file)
@@ -28,7 +28,7 @@ import org.apache.archiva.configuration.RepositoryScanningConfiguration;
 import org.apache.archiva.filter.AllFilter;
 import org.apache.archiva.filter.ExcludesFilter;
 import org.apache.archiva.filter.Filter;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.Dependency;
 import org.apache.archiva.metadata.model.License;
@@ -37,8 +37,8 @@ import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataInvalidException;
 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataNotFoundException;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.repository.RepositoryRegistry;
 import org.apache.archiva.repository.base.RepositoryHandlerDependencies;
 import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
index 07ee62ea5d30aebed6a005dd829d3d87ecd8a6c0..fd0b92f36c2a641dd2180eb4679ee2ac2914703a 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.metadata.storage;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.Plugin;
 import org.apache.archiva.repository.metadata.RepositoryMetadataException;
index 1aeaefb14e2e530a834aca861babe29ec441caf7..0cfdc8b01e060dd5819c725e0290993a2a503e89 100644 (file)
@@ -28,9 +28,9 @@ import org.apache.archiva.indexer.IndexCreationFailedException;
 import org.apache.archiva.indexer.IndexUpdateFailedException;
 import org.apache.archiva.indexer.UnsupportedBaseContextException;
 import org.apache.archiva.proxy.ProxyRegistry;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryException;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryException;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.repository.EditableRepository;
 import org.apache.archiva.repository.ManagedRepository;
index 452ea65fd5b0141152b322202d3d7263b3fa0d94..0dc90447c6bb6c062181875f30822893167573e0 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.archiva.configuration.ArchivaConfiguration;
 import org.apache.archiva.configuration.ConfigurationEvent;
 import org.apache.archiva.configuration.ConfigurationListener;
 import org.apache.archiva.indexer.UnsupportedBaseContextException;
-import org.apache.archiva.proxy.maven.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactory;
 import org.apache.archiva.repository.RepositoryRegistry;
 import org.apache.archiva.repository.features.RemoteIndexFeature;
 import org.apache.commons.lang3.StringUtils;
index c678c3cb7789d25746d310a8c4bbbef05bd9ca19..e682fa06e467f76892d8c6d652c66a468e5881f3 100644 (file)
@@ -18,8 +18,8 @@ package org.apache.archiva.scheduler.indexing.maven;
  * under the License.
  */
 
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.repository.base.PasswordCredentials;
 import org.apache.archiva.repository.RemoteRepository;
index 784709345f232f7271e26813367549500efdfdba..5cf12d93bfee67c6b8381c60afcffebb06c5f88f 100644 (file)
@@ -18,7 +18,7 @@ package org.apache.archiva.scheduler.indexing.maven;
  * under the License.
  */
 
-import org.apache.archiva.proxy.maven.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactory;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.repository.RemoteRepository;
 import org.apache.maven.index.packer.IndexPacker;
index 76199e1e2b80813c241d24c68c329dadd2a7977b..8ee7748de71e9141c068db7ffb50dc9c9b3d9166 100644 (file)
@@ -28,9 +28,9 @@ import org.apache.archiva.indexer.ArchivaIndexingContext;
 import org.apache.archiva.indexer.IndexCreationFailedException;
 import org.apache.archiva.indexer.IndexUpdateFailedException;
 import org.apache.archiva.indexer.UnsupportedBaseContextException;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryException;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryException;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.repository.EditableRepository;
 import org.apache.archiva.repository.ManagedRepository;
index 1e9a39c270be6e2db8d82081c95ae3c23b05aee0..e7d5b85b3e92f57ac266cd0cb3615ec4bbb4c8aa 100644 (file)
@@ -23,8 +23,8 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
 import org.apache.archiva.proxy.ProxyRegistry;
-import org.apache.archiva.proxy.maven.WagonFactory;
-import org.apache.archiva.proxy.maven.WagonFactoryRequest;
+import org.apache.archiva.maven.proxy.WagonFactory;
+import org.apache.archiva.maven.proxy.WagonFactoryRequest;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
index 1df79ed6c59ceed52cccaeb4d8dae7f3e7f67dc1..d5bec92fb9c4f16aa4dccfc25542130a36a4c770 100644 (file)
@@ -29,7 +29,7 @@ import org.apache.archiva.components.cache.Cache;
 import org.apache.archiva.components.taskqueue.TaskQueueException;
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.metadata.audit.RepositoryListener;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.metadata.repository.MetadataRepository;
index 46ffbd60d2462663afde41774b6b34166d43c466..5c4a0b8e518c7e4c43e606d0091545a64f70f158 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.rest.services.utils;
 
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.repository.content.BaseRepositoryContentLayout;
 import org.apache.archiva.repository.ManagedRepositoryContent;
 import org.apache.archiva.repository.content.LayoutException;
index 9f7c5518f27553fa11cac45995bc7976649075d5..b8beffe36871c6c026f1366bc4323eaa18448485 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.webdav;
  * under the License.
  */
 
-import org.apache.archiva.proxy.maven.MavenRepositoryProxyHandler;
+import org.apache.archiva.maven.proxy.MavenRepositoryProxyHandler;
 import org.apache.archiva.proxy.model.ProxyFetchResult;
 import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.storage.StorageAsset;
index a3d0b677247f2ed298aeebbbd0f042749f2fe502..8ec608b2f1079f60897d14f8222b8b13d22f4e10 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.archiva.common.utils.FileUtils;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.archiva.configuration.RepositoryGroupConfiguration;
-import org.apache.archiva.metadata.maven.MavenMetadataReader;
+import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.commons.lang3.StringUtils;
 import org.junit.After;
index 788afb8959adae990258b0cf35f98ea9d9309221..7bb5580fc6115a5c26d689adb0754f7d3eb8ca77 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.metadata.repository.stats.model;
  */
 
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.MetadataResolutionException;
index 811fb0733e610bee126dde1e236f528be407a0f0..970c0144357406502dd6872c426bd9212fce8675 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.metadata.repository.jcr;
 
 import org.apache.archiva.checksum.ChecksumAlgorithm;
 import org.apache.archiva.metadata.QueryParameter;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.CiManagement;
 import org.apache.archiva.metadata.model.Dependency;
index ac3f1ebdae1f8b3f20fd80e40a445efa6a70315f..f12a17ae8af18ac48581181bd042581b1ddb2ca8 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.metadata.repository.stats;
 
 import junit.framework.TestCase;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
+import org.apache.archiva.maven.metadata.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.RepositorySession;
 import org.apache.archiva.metadata.repository.RepositorySessionFactory;