]> source.dussan.org Git - archiva.git/commitdiff
[MRM-980] UI integration for staging repos
authorMaria Odea B. Ching <oching@apache.org>
Sun, 18 Jul 2010 05:05:40 +0000 (05:05 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Sun, 18 Jul 2010 05:05:40 +0000 (05:05 +0000)
submitted by Patti Arachchige Eshan Sudharaka

git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-980@965157 13f79535-47bb-0310-9956-ffa450edef68

42 files changed:
archiva-modules/archiva-web/archiva-webapp/pom.xml
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/mergeActionForm.jspf [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeAction.jsp [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeActionResults.jsp [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeExcludeConflicts.jsp [new file with mode: 0644]
archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java
archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/RepositoryMerger.java
archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/invalid-artifact.txt [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-javadoc.jar.md5 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-javadoc.jar.sha1 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-sources.jar.md5 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-sources.jar.sha1 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.jar.md5 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.jar.sha1 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.pom [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.pom.md5 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.pom.sha1 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml.md5 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml.sha1 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.jar [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.jar.sha1 [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.pom [new file with mode: 0755]
archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8.pom.sha1 [new file with mode: 0755]

index f3b190a8ecc4d2911dd985c6819f4f576793343c..b1b925f61eca83fdca98c6654cba56a34de9d0ba 100644 (file)
@@ -18,7 +18,8 @@
   ~ under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.archiva</groupId>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-lucene-consumers</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>stage-repository-merge</artifactId>
+      <version>1.4-MRM-980-SNAPSHOT</version>
+    </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-signature-consumers</artifactId>
       <scope>runtime</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>  <!--  FIXME: temporary coupling to plugin, should be runtime -->
+      <groupId>org.apache.archiva</groupId>
+      <!--  FIXME: temporary coupling to plugin, should be runtime -->
       <artifactId>maven2-repository</artifactId>
     </dependency>
   </dependencies>
           </excludes>
         </configuration>
       </plugin>
-       -->     
+       -->
       <!-- hack for jetty:run, archiva web config files are checked in /WEB-INF/ dir -->
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
             <phase>compile</phase>
             <configuration>
               <tasks>
-                <mkdir dir="${basedir}/target/archiva/WEB-INF/" />
+                <mkdir dir="${basedir}/target/archiva/WEB-INF/"/>
                 <copy todir="${basedir}/target/archiva/WEB-INF/">
-                  <fileset dir="${basedir}/target" includes="classes/" excludes="**/struts.xml" />
+                  <fileset dir="${basedir}/target" includes="classes/" excludes="**/struts.xml"/>
                 </copy>
               </tasks>
             </configuration>
             <configuration>
               <tasks>
                 <copy todir="${basedir}/appserver-base">
-                  <fileset dir="src/appserver-base" />
+                  <fileset dir="src/appserver-base"/>
                 </copy>
               </tasks>
             </configuration>
           <execution>
             <id>unpack-redback-war</id>
             <goals>
-             <goal>unpack</goal>
+              <goal>unpack</goal>
             </goals>
             <phase>compile</phase>
             <configuration>
-               <artifactItems>
-                 <artifactItem>
-                   <groupId>org.codehaus.redback</groupId>
-                   <artifactId>redback-struts2-content</artifactId>
-                   <version>${redback.version}</version>
-                   <type>war</type>
-                   <overWrite>false</overWrite>
-                   <outputDirectory>${project.build.directory}/redback</outputDirectory>
-                   <excludes>**/struts-security.xml</excludes>
-                 </artifactItem>
-               </artifactItems>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.codehaus.redback</groupId>
+                  <artifactId>redback-struts2-content</artifactId>
+                  <version>${redback.version}</version>
+                  <type>war</type>
+                  <overWrite>false</overWrite>
+                  <outputDirectory>${project.build.directory}/redback</outputDirectory>
+                  <excludes>**/struts-security.xml</excludes>
+                </artifactItem>
+              </artifactItems>
             </configuration>
           </execution>
         </executions>
           <!-- Some versions of maven-war-plugin (snapshots) have this incorrectly defaulted to true.
                Specifically setting this to false to avoid accidental jar file creation. -->
           <archiveClasses>false</archiveClasses>
-          <dependentWarExcludes>META-INF/**,WEB-INF/web.xml,WEB-INF/classes/xwork.xml,WEB-INF/lib/**</dependentWarExcludes>
-          <warSourceExcludes>WEB-INF/lib/xalan-*.jar,WEB-INF/lib/velocity-dep-*.jar,WEB-INF/lib/xml-apis-*.jar,WEB-INF/lib/wstx-asl-*.jar,WEB-INF/lib/stax-utils-*.jar,WEB-INF/lib/xercesImpl-*.jar</warSourceExcludes>
-        </configuration>        
+          <dependentWarExcludes>META-INF/**,WEB-INF/web.xml,WEB-INF/classes/xwork.xml,WEB-INF/lib/**
+          </dependentWarExcludes>
+          <warSourceExcludes>
+            WEB-INF/lib/xalan-*.jar,WEB-INF/lib/velocity-dep-*.jar,WEB-INF/lib/xml-apis-*.jar,WEB-INF/lib/wstx-asl-*.jar,WEB-INF/lib/stax-utils-*.jar,WEB-INF/lib/xercesImpl-*.jar
+          </warSourceExcludes>
+        </configuration>
       </plugin>
       <plugin>
         <groupId>org.mortbay.jetty</groupId>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java
new file mode 100644 (file)
index 0000000..34725b4
--- /dev/null
@@ -0,0 +1,129 @@
+package org.apache.maven.archiva.web.action;
+
+/*
+ * 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 com.opensymphony.xwork2.Validateable;
+import com.opensymphony.xwork2.Preparable;
+import org.apache.archiva.audit.Auditable;
+import org.apache.archiva.stagerepository.merge.Maven2RepositoryMerger;
+import org.apache.archiva.metadata.model.ArtifactMetadata;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="mergeAction" instantiation-strategy="per-lookup"
+ */
+public class MergeAction
+    extends PlexusActionSupport
+    implements Validateable, Preparable, Auditable
+
+{
+    /**
+     * @plexus.requirement role="org.apache.archiva.stagerepository.merge.RepositoryMerger" role-hint="maven2"
+     */
+    private Maven2RepositoryMerger repositoryMerger;
+
+    /**
+     * @plexus.requirement role-hint="default"
+     */
+    private ArchivaConfiguration configuration;
+
+    private ManagedRepositoryConfiguration repository;
+
+    private String repoid;
+
+    private String targetRepoId;
+
+    private final String action = "merge";
+
+    List<ArtifactMetadata> conflictList;
+
+    public String doMerge()
+    {
+        targetRepoId = repoid + "-stage";
+        Configuration config = configuration.getConfiguration();
+        ManagedRepositoryConfiguration targetRepoConfig = config.findManagedRepositoryById( targetRepoId );
+
+        if ( targetRepoConfig != null )
+        {
+
+            try
+            {
+                repositoryMerger.merge( repoid, targetRepoId );
+            }
+            catch ( Exception e )
+            {
+                return ERROR;
+            }
+            return SUCCESS;
+        }
+        else
+        {
+            return ERROR;
+        }
+    }
+
+    public String mergeWithOutConlficts()
+    {
+
+        targetRepoId = repoid + "-stage";
+
+        try
+        {
+            conflictList = repositoryMerger.mergeWithOutConflictArtifacts( repoid, targetRepoId );
+        }
+        catch ( Exception e )
+        {
+            return ERROR;
+        }
+
+        return SUCCESS;
+    }
+
+    public void prepare()
+        throws Exception
+    {
+        this.repository = new ManagedRepositoryConfiguration();
+    }
+
+    public ManagedRepositoryConfiguration getRepository()
+    {
+        return repository;
+    }
+
+    public void setRepository( ManagedRepositoryConfiguration repository )
+    {
+        this.repository = repository;
+    }
+
+    public String getRepoid()
+    {
+        return repoid;
+    }
+
+    public void setRepoid( String repoid )
+    {
+        this.repoid = repoid;
+    }
+}
index 156e084bd58c61c045941b5ad770d5e5ed2b4efb..922a689bcfef99664c836dd659571577693e73bc 100644 (file)
@@ -45,7 +45,9 @@ public class AddManagedRepositoryAction
      * The model for this action.
      */
     private ManagedRepositoryConfiguration repository;
-    
+
+    private boolean stageNeeded;
+
     private String action = "addRepository";
 
     public void prepare()
@@ -64,42 +66,53 @@ public class AddManagedRepositoryAction
 
         return INPUT;
     }
-     
+
     public String confirmAdd()
     {
         return save();
     }
-    
+
     public String commit()
     {
         File location = new File( repository.getLocation() );
         if( location.exists() )
-        {   
+        {
             return CONFIRM;
         }
-        
+
         return save();
     }
-    
+
     private String save()
     {
         Configuration configuration = archivaConfiguration.getConfiguration();
-                
+
         String result;
         try
         {
             addRepository( repository, configuration );
             triggerAuditEvent( repository.getId(), null, AuditEvent.ADD_MANAGED_REPO );
             addRepositoryRoles( repository );
+
+            if ( stageNeeded )
+            {
+                ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig();
+
+                addRepository( stagingRepository, configuration );
+                triggerAuditEvent( stagingRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO );
+                addRepositoryRoles( stagingRepository );
+
+            }
+
             result = saveConfiguration( configuration );
         }
         catch ( RoleManagerException e )
-        {            
+        {
             addActionError( "Role Manager Exception: " + e.getMessage() );
             result = INPUT;
         }
         catch ( IOException e )
-        {         
+        {
             addActionError( "Role Manager Exception: " + e.getMessage() );
             result = INPUT;
         }
@@ -107,6 +120,27 @@ public class AddManagedRepositoryAction
         return result;
     }
 
+    private ManagedRepositoryConfiguration getStageRepoConfig()
+    {
+        ManagedRepositoryConfiguration stagingRepository = new ManagedRepositoryConfiguration();
+        stagingRepository.setId( repository.getId() + "-stage" );
+        stagingRepository.setLayout( repository.getLayout() );
+        stagingRepository.setName( repository.getName() + "-stage" );
+        stagingRepository.setBlockRedeployments( repository.isBlockRedeployments() );
+        stagingRepository.setDaysOlder( repository.getDaysOlder() );
+        stagingRepository.setDeleteReleasedSnapshots( repository.isDeleteReleasedSnapshots() );
+        stagingRepository.setIndexDir( repository.getIndexDir() );
+        String path = repository.getLocation();
+        int lastIndex = path.lastIndexOf( '/' );
+        stagingRepository.setLocation( path.substring( 0, lastIndex ) + "/" + stagingRepository.getId() );
+        stagingRepository.setRefreshCronExpression( repository.getRefreshCronExpression() );
+        stagingRepository.setReleases( repository.isReleases() );
+        stagingRepository.setRetentionCount( repository.getRetentionCount() );
+        stagingRepository.setScanned( repository.isScanned() );
+        stagingRepository.setSnapshots( repository.isSnapshots() );
+        return stagingRepository;
+    }
+
     @Override
     public void validate()
     {
@@ -130,7 +164,12 @@ public class AddManagedRepositoryAction
             addFieldError( "repository.id", "Unable to add new repository with id [" + repoId
                + "], that id already exists as a repository group." );
         }
-        
+        else if ( repoId.toLowerCase().contains( "stage" ) )
+        {
+            addFieldError( "repository.id", "Unable to add new repository with id [" + repoId +
+                "], rpository  id cannot contains word stage" );
+        }
+
         if ( !validator.validate( repository.getRefreshCronExpression() ) )
         {
             addFieldError( "repository.refreshCronExpression", "Invalid cron expression." );
@@ -146,6 +185,12 @@ public class AddManagedRepositoryAction
     {
         this.repository = repository;
     }
+
+
+    public void setStageNeeded( boolean stageNeeded )
+    {
+        this.stageNeeded = stageNeeded;
+    }
     
     public String getAction()
     {
index d27eea503cced2919dccfc625bd1e096cc5ffa95..b38e4830f1d00b4aef0be59a03f5b771bd3e675e 100644 (file)
@@ -51,6 +51,8 @@ public class EditManagedRepositoryAction
 
     private final String action = "editRepository";
 
+    private boolean stageNeeded;
+
     /**
      * @plexus.requirement
      */
@@ -123,6 +125,17 @@ public class EditManagedRepositoryAction
             addRepository( repository, configuration );
             triggerAuditEvent( repository.getId(), null, AuditEvent.MODIFY_MANAGED_REPO );
             addRepositoryRoles( repository );
+
+            if ( stageNeeded )
+            {
+                ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig();
+//                if(new File( stagingRepository.getLocation()).exists())
+                addRepository( stagingRepository, configuration );
+                triggerAuditEvent( stagingRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO );
+                addRepositoryRoles( stagingRepository );
+
+            }
+
             result = saveConfiguration( configuration );
             if ( resetStats )
             {
@@ -143,6 +156,27 @@ public class EditManagedRepositoryAction
         return result;
     }
 
+    private ManagedRepositoryConfiguration getStageRepoConfig()
+    {
+        ManagedRepositoryConfiguration stagingRepository = new ManagedRepositoryConfiguration();
+        stagingRepository.setId( repository.getId() + "-stage" );
+        stagingRepository.setLayout( repository.getLayout() );
+        stagingRepository.setName( repository.getName() + "-stage" );
+        stagingRepository.setBlockRedeployments( repository.isBlockRedeployments() );
+        stagingRepository.setDaysOlder( repository.getDaysOlder() );
+        stagingRepository.setDeleteReleasedSnapshots( repository.isDeleteReleasedSnapshots() );
+        stagingRepository.setIndexDir( repository.getIndexDir() );
+        String path = repository.getLocation();
+        int lastIndex = path.lastIndexOf( '/' );
+        stagingRepository.setLocation( path.substring( 0, lastIndex ) + "/" + stagingRepository.getId() );
+        stagingRepository.setRefreshCronExpression( repository.getRefreshCronExpression() );
+        stagingRepository.setReleases( repository.isReleases() );
+        stagingRepository.setRetentionCount( repository.getRetentionCount() );
+        stagingRepository.setScanned( repository.isScanned() );
+        stagingRepository.setSnapshots( repository.isSnapshots() );
+        return stagingRepository;
+    }
+    
     @Override
     public void validate()
     {
@@ -179,6 +213,16 @@ public class EditManagedRepositoryAction
         this.repository = repository;
     }
 
+    public boolean isStageNeeded()
+    {
+        return stageNeeded;
+    }
+
+    public void setStageNeeded( boolean stageNeeded )
+    {
+        this.stageNeeded = stageNeeded;
+    }
+
     public String getAction()
     {
         return action;
index 0aa4274528d9b92fdcd2fbebec1db10b5df83191..3d0a739d6cb821a49d17933077b046f5a0e7f021 100644 (file)
@@ -93,7 +93,7 @@ public class RepositoriesAction
         return bundle;
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings( "unchecked" )
     public void prepare()
     {
         Configuration config = archivaConfiguration.getConfiguration();
@@ -118,7 +118,15 @@ public class RepositoriesAction
 
     public List<ManagedRepositoryConfiguration> getManagedRepositories()
     {
-        return managedRepositories;
+        List<ManagedRepositoryConfiguration> managedRepositoriesList = new ArrayList<ManagedRepositoryConfiguration>();
+        for ( ManagedRepositoryConfiguration repoConfig : managedRepositories )
+        {
+            if ( !repoConfig.getId().contains( "stage" ) )
+            {
+                managedRepositoriesList.add( repoConfig );
+            }
+        }
+        return managedRepositoriesList;
     }
 
     public List<RemoteRepositoryConfiguration> getRemoteRepositories()
index fa127d095e3b0c3e202b90184ce97405ae263b45..64d3760cbd96418fa3de62eeee476c30673350db 100644 (file)
@@ -19,7 +19,7 @@
   -->
 
 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
-    "http://struts.apache.org/dtds/struts-2.0.dtd"> 
+    "http://struts.apache.org/dtds/struts-2.0.dtd">
 
 <struts>
   <!-- Include plexus-security xwork configurations. -->
            include a result for 'error' -->
       <result name="error">/WEB-INF/jsp/generalError.jsp</result>
       <result name="access_to_no_repos">/WEB-INF/jsp/accessToNoRepos.jsp</result>
-      
+
     </global-results>
   </package>
-  
+
   <!-- Configuration for the default package. -->
   <package name="default" extends="base" namespace="/">
 
       <result>/WEB-INF/jsp/results.jsp</result>
       <result name="error">/WEB-INF/jsp/quickSearch.jsp</result>
     </action>
-       
+
     <action name="quickSearch" class="searchAction" method="quickSearch">
       <result name="input">/WEB-INF/jsp/quickSearch.jsp</result>
       <result>/WEB-INF/jsp/results.jsp</result>
       <result name="input">/WEB-INF/jsp/findArtifact.jsp</result>
     </action>
 
-       <action name="upload" class="uploadAction" method="input">      
+    <action name="upload" class="uploadAction" method="input">
       <result name="input">/WEB-INF/jsp/upload.jsp</result>
       <result name="error">/WEB-INF/jsp/upload.jsp</result>
       <result name="success">/WEB-INF/jsp/upload.jsp</result>
       <interceptor-ref name="fileUpload"/>
     </action>
 
-       <action name="deleteArtifact" class="deleteArtifactAction" method="input">      
+    <action name="deleteArtifact" class="deleteArtifactAction" method="input">
       <result name="input">/WEB-INF/jsp/deleteArtifact.jsp</result>
       <result name="error">/WEB-INF/jsp/deleteArtifact.jsp</result>
       <result name="success">/WEB-INF/jsp/deleteArtifact.jsp</result>
       <result name="artifact" type="redirect">
         /browse/${databaseResults.get(0).getNamespace()}/${databaseResults.get(0).getProject()}/${databaseResults.get(0).getVersion()}
       </result>
-    </action>    
+    </action>
 
     <action name="browse" class="browseAction" method="browse">
       <result>/WEB-INF/jsp/browse.jsp</result>
       <result>/WEB-INF/jsp/showArtifact.jsp</result>
     </action>
 
-    <action name="addMetadataProperty" class="showArtifactAction" method="addMetadataProperty">      
+    <action name="addMetadataProperty" class="showArtifactAction" method="addMetadataProperty">
       <result name="input">/WEB-INF/jsp/showArtifact.jsp</result>
       <result name="success">/WEB-INF/jsp/showArtifact.jsp</result>
     </action>
     <action name="index" class="repositoriesAction" method="input">
       <result name="input">/WEB-INF/jsp/admin/repositories.jsp</result>
     </action>
-    
+
     <!-- .\ REPOSITORY GROUPS \._______________________________________ -->
-    
+
     <action name="repositoryGroups" class="repositoryGroupsAction" method="input">
       <result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
     </action>
-    
+
     <action name="addRepositoryGroup" class="repositoryGroupsAction" method="addRepositoryGroup">
       <result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
       <result name="success" type="redirect-action">repositoryGroups</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
     </action>
-    
+
     <action name="confirmDeleteRepositoryGroup" class="deleteRepositoryGroupAction" method="confirmDelete">
       <result name="input">/WEB-INF/jsp/admin/deleteRepositoryGroup.jsp</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
     </action>
-    
+
     <action name="deleteRepositoryGroup" class="deleteRepositoryGroupAction" method="delete">
       <result name="input">/WEB-INF/jsp/admin/deleteRepositoryGroup.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/deleteRepositoryGroup.jsp</result>
       <result name="success" type="redirect-action">repositoryGroups</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
     </action>
-       
+
     <action name="addRepositoryToGroup" class="repositoryGroupsAction" method="addRepositoryToGroup">
       <result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
       <result name="success" type="redirect-action">repositoryGroups</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
     </action>
-       
+
     <action name="removeRepositoryFromGroup" class="repositoryGroupsAction" method="removeRepositoryFromGroup">
       <result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
       <result name="success" type="redirect-action">repositoryGroups</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
     </action>
-       
+
     <action name="sortDownRepositoryFromGroup" class="sortRepositoriesAction" method="sortDown">
       <result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
       <result name="success" type="redirect-action">repositoryGroups</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
     </action>
-       
+
     <action name="sortUpRepositoryFromGroup" class="sortRepositoriesAction" method="sortUp">
       <result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
     <action name="indexRepository" class="schedulerAction" method="scanRepository">
       <result type="redirect-action">repositories</result>
     </action>
-    
+
     <action name="addRepository" class="addManagedRepositoryAction" method="input">
       <result name="input">/WEB-INF/jsp/admin/addRepository.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/addRepository.jsp</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
     </action>
 
-    <action name="deleteRemoteRepository" class="deleteRemoteRepositoryAction" method="delete">
+    <action name="conflictsArtifacts" class="mergeAction" method="mergeWithOutConlficts" >
+       <result name="success"> /WEB-INF/jsp/mergeActionResults.jsp</result>
+       <interceptor-ref name="configuredPrepareParamsStack"/>
+     </action>
+
+     <action name="merge" class="mergeAction" method="doMerge" >
+       <!--<result name="input"> /WEB-INF/jsp/mergeAction.jsp</result>-->
+        <!--<result name="conflictsAvailable"> /WEB-INF/jsp/mergeExcludeConflicts.jsp</result>-->
+       <result name="success"> /WEB-INF/jsp/mergeActionResults.jsp</result>
+       <interceptor-ref name="configuredPrepareParamsStack"/>
+     </action>
+
+
+    <action name="deleteRemoteRepository" class="deleteRemoteRepositoryAction" method="input">
       <result name="input">/WEB-INF/jsp/admin/deleteRemoteRepository.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/deleteRemoteRepository.jsp</result>
       <result name="success" type="redirect-action">repositories</result>
       <result name="success" type="redirect-action">proxyConnectors</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
     </action>
-    
+
     <action name="enableProxyConnector" class="enableProxyConnectorAction" method="confirm">
       <result name="input">/WEB-INF/jsp/admin/enableProxyConnector.jsp</result>
       <result name="success" type="redirect-action">proxyConnectors</result>
       <result name="blank">/WEB-INF/jsp/reports/blankReport.jsp</result>
       <result>/WEB-INF/jsp/reports/basicReport.jsp</result>
     </action>
-    
+
     <action name="generateStatisticsReport" class="generateReport" method="generateStatistics">
       <result name="input">/WEB-INF/jsp/reports/pickReport.jsp</result>
       <result name="blank">/WEB-INF/jsp/reports/blankReport.jsp</result>
       <result>/WEB-INF/jsp/reports/statisticsReport.jsp</result>
     </action>
-    
+
     <!-- TODO: make report filename dynamic -->
     <action name="downloadStatsReport" class="generateReport" method="downloadStatisticsReport">
       <result name="input">/WEB-INF/jsp/reports/pickReport.jsp</result>
         <param name="contentDisposition">attachment; filename="archiva_statistics_report.csv"</param>
       </result>
     </action>
-    
+
     <!--  audit logs -->
     <action name="queryAuditLogReport" class="viewAuditLogReport" method="input">
       <result name="input">/WEB-INF/jsp/reports/auditLogReport.jsp</result>
     </action>
-    
+
     <action name="viewAuditLogReport" class="viewAuditLogReport">
       <result name="input">/WEB-INF/jsp/reports/auditLogReport.jsp</result>
       <result>/WEB-INF/jsp/reports/auditLogReport.jsp</result>
     </action>
-    
+
   </package>
 </struts>
 
index 1581594901c372fb54c25486ecb8227e4990b9f3..faa295ec5a965ea5d3f46e88160003a3c8a4fd29 100644 (file)
@@ -36,6 +36,7 @@
   <s:form method="post" action="addRepository!commit" namespace="/admin" validate="true">
     <s:textfield name="repository.id" label="Identifier" size="10" required="true"/>
     <%@ include file="/WEB-INF/jsp/admin/include/repositoryForm.jspf" %>
+    <s:checkbox name="stageNeeded" value="stageNeeded" label="Create stage repository"/>
     <s:submit value="Add Repository"/>
   </s:form>
 
index 5a0b482a040047b7968945218f946af3dfb14338..561dc30fdfd8ad95d3dcbe7dcf94482b51bd0ab4 100644 (file)
@@ -39,6 +39,7 @@
     <s:hidden name="repository.id"/>
     <s:label label="ID" name="repository.id" />
     <%@ include file="/WEB-INF/jsp/admin/include/repositoryForm.jspf" %>
+    <s:checkbox name="stageNeeded" value="stageNeeded" label="Create stage repository"/>
     <s:submit value="Update Repository"/>
   </s:form>
 
index bce43bc2b8f43f99c5ab10c8ca560d1ecf42ce1e..ad015f654394e51753284ed7fa7cb62d2813fa09 100644 (file)
@@ -34,5 +34,3 @@
 <s:checkbox name="repository.scanned" value="repository.scanned" label="Scannable"/>
 <s:checkbox name="repository.deleteReleasedSnapshots" value="repository.deleteReleasedSnapshots"
              label="Delete Released Snapshots"/>
-
index f09d2442da6af14cc7ff9100e8ad8e3ac1adb239..dd65ea4616bc761c2463dc7c9e79fd2e0d30f9da 100644 (file)
@@ -21,7 +21,7 @@
 <%@ taglib prefix="s" uri="/struts-tags" %>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %>
-<%@ taglib prefix="archiva"   uri="/WEB-INF/taglib.tld" %>
+<%@ taglib prefix="archiva" uri="/WEB-INF/taglib.tld" %>
 
 <html>
 <head>
   <s:head/>
   <script type="text/javascript" src="<c:url value='/js/jquery-1.3.2.min.js'/>"></script>
   <script type="text/javascript">
-  $(document).ready(function(){
-    
- $(".pom").hide();
- $("a.expand").click(function(event){
-   event.preventDefault();
-   $(this).siblings("pre").toggle("slow");
- });
-
-  });
+    $(document).ready(function()
+    {
+
+      $(".pom").hide();
+      $("a.expand").click(function( event )
+      {
+        event.preventDefault();
+        $(this).siblings("pre").toggle("slow");
+      });
+
+    });
   </script>
 </head>
 
   </redback:ifAnyAuthorized>
   <c:url var="rssFeedIconUrl" value="/images/icons/rss-feed.png"/>
   <a href="/archiva/feeds/${repository.id}">
-       <img src="${rssFeedIconUrl}" />
+    <img src="${rssFeedIconUrl}"/>
   </a>
 </div>
 
 
 <table class="infoTable">
 <tr>
-  <th>Identifier</th>
+  <th>Groups</th>
   <td>
-    <code>${repository.id}</code>
+    <c:forEach items="${repositoryToGroupMap[repository.id]}" varStatus="i" var="group">
+      ${group}<c:if test="${!i.last}">,</c:if>
+    </c:forEach>
   </td>
 </tr>
 <tr>
-  <th>Name</th>
-  <td>
-    <code>${repository.name}</code>
-  </td>
+  <th>Delete Released Snapshots</th>
+  <td class="${repository.deleteReleasedSnapshots ? 'donemark' : 'errormark'} booleanIcon"></td>
 </tr>
 <tr>
-  <th>Directory</th>
-  <td>${repository.location}</td>
+  <th>Repository Purge By Days Older Than</th>
+  <td>${repository.daysOlder}</td>
+</tr>
+<tr>
+  <th>Repository Purge By Retention Count</th>
+  <td>${repository.retentionCount}</td>
 </tr>
-<c:if test="${!empty (repository.indexDir)}">
-       <tr>
-         <th>Index Directory</th>
-         <td>${repository.indexDir}</td>
-       </tr>
-</c:if>
 <tr>
-  <th>WebDAV URL</th>
-  <td><a href="${baseUrl}/${repository.id}/">${baseUrl}/${repository.id}/</a></td>
+  <th>Scanning Cron</th>
+  <td>${repository.refreshCronExpression}</td>
 </tr>
 <tr>
-  <th>Type</th>
-    <%-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this --%>
+  <th>
+    Actions
+  </th>
   <td>
     <c:choose>
-      <c:when test="${repository.layout == 'default'}">
-        Maven 2.x Repository
+      <c:when test="${empty (stats)}">
+        No Statistics Available.
       </c:when>
       <c:otherwise>
-        Maven 1.x Repository
+        <table>
+          <tr>
+            <th>Last Scanned</th>
+            <td>${stats.scanStartTime}</td>
+          </tr>
+          <tr>
+            <th>Duration</th>
+            <td>${stats.duration} ms</td>
+          </tr>
+          <tr>
+            <th>Total File Count</th>
+            <td>${stats.totalFileCount}
+          </tr>
+          <tr>
+            <th>New Files Found</th>
+            <td>${stats.newFileCount}
+          </tr>
+        </table>
       </c:otherwise>
     </c:choose>
   </td>
     <th>Groups</th>
     <td>
       <c:forEach items="${repositoryToGroupMap[repository.id]}" varStatus="i" var="group">
-        ${group}<c:if test="${!i.last}">,</c:if>        
+        ${group}<c:if test="${!i.last}">,</c:if>
       </c:forEach>
     </td>
   </tr>
 </c:if>
 <tr>
   <th>Releases Included</th>
-  <td class="${repository.releases ? 'donemark' : 'errormark'} booleanIcon"> </td>
+  <td class="${repository.releases ? 'donemark' : 'errormark'} booleanIcon"></td>
 </tr>
 <tr>
   <th>Snapshots Included</th>
-  <td class="${repository.snapshots ? 'donemark' : 'errormark'} booleanIcon"> </td>
+  <td class="${repository.snapshots ? 'donemark' : 'errormark'} booleanIcon"></td>
 </tr>
 <c:if test="${repository.snapshots}">
   <tr>
     <th>Delete Released Snapshots</th>
-    <td class="${repository.deleteReleasedSnapshots ? 'donemark' : 'errormark'} booleanIcon"> </td>
+    <td class="${repository.deleteReleasedSnapshots ? 'donemark' : 'errormark'} booleanIcon"></td>
   </tr>
   <tr>
     <th>Repository Purge By Days Older Than</th>
 </c:if>
 <tr>
   <th>Scanned</th>
-  <td class="${repository.scanned ? 'donemark' : 'errormark'} booleanIcon"> </td>
+  <td class="${repository.scanned ? 'donemark' : 'errormark'} booleanIcon"></td>
 </tr>
 <c:if test="${repository.scanned}">
   <tr>
     <td>
       <redback:ifAuthorized permission="archiva-run-indexer">
         <s:form action="indexRepository" theme="simple">
-        <s:hidden name="repoid" value="%{#attr.repository.id}"/>
-        <table>
-          <tr>
-            <td><s:checkbox name="scanAll" value="scanAll"/>Process All Artifacts</td>
-          </tr>
-          <tr>
-            <td><s:submit value="Scan Repository Now"/></td>
-          </tr>
-        </table>
+          <s:hidden name="repoid" value="%{#attr.repository.id}"/>
+          <table>
+            <tr>
+              <td><s:checkbox name="scanAll" value="scanAll"/>Process All Artifacts</td>
+            </tr>
+            <tr>
+              <td><s:submit value="Scan Repository Now"/></td>
+            </tr>
+          </table>
         </s:form>
       </redback:ifAuthorized>
     </td>
-  </tr>  
+  </tr>
   <tr>
     <th>Stats</th>
     <td>
 <tr>
   <th>POM Snippet</th>
   <td>
-    <archiva:copy-paste-snippet object="${repository}" wrapper="toggle" />
+    <archiva:copy-paste-snippet object="${repository}" wrapper="toggle"/>
   </td>
+
 </tr>
+
+
+<c:set var="str" value="${repository.id}"/>
+<jsp:useBean id="str" type="java.lang.String"/>
+<c:if test='<%= !( (str.equalsIgnoreCase("internal") ) || (str.equalsIgnoreCase( "snapshots" )) )%>'>
+ <tr>
+  <th>Merge Actions</th>
+  <td >
+    <redback:ifAuthorized permission="archiva-run-indexer">
+      <s:form action="merge" theme="simple">
+        <s:hidden name="repoid" value="%{#attr.repository.id}"/>
+        <table>
+          <tr>
+            <td><s:submit value="Merge All"/></td>
+          </tr>
+
+        </table>
+      </s:form>
+    </redback:ifAuthorized>
+  </td>
+  <td align="left">
+    <redback:ifAuthorized permission="archiva-run-indexer">
+      <s:form action="conflictsArtifacts" theme="simple">
+        <s:hidden name="repoid" value="%{#attr.repository.id}"/>
+        <table>
+          <tr>
+            <td align="left" ><s:submit value="Merge With skip"/></td>
+          </tr>
+
+        </table>
+      </s:form>
+    </redback:ifAuthorized>
+  </td>
+</tr>
+
+</c:if>
+
+
+
 </table>
 
 </div>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/mergeActionForm.jspf b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/mergeActionForm.jspf
new file mode 100644 (file)
index 0000000..93e20dc
--- /dev/null
@@ -0,0 +1,42 @@
+<%--
+  ~ 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.
+  --%>
+
+<%-- http://www.opensymphony.com/webwork/wikidocs/File%20Upload%20Interceptor.html --%>
+
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<s:hidden name="repository.id"/>
+    <s:label label="ID" name="repository.id" />
+
+<s:textfield name="repository.name" label="Name" size="50" required="true"/>
+<s:textfield name="repository.location" label="Directory" size="50" required="true"/>
+<s:textfield name="repository.indexDir" label="Index Directory" size="50"/>
+<s:select list="#@java.util.LinkedHashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}"
+           name="repository.layout" label="Type"/>
+<s:textfield name="repository.refreshCronExpression" label="Cron" size="40" required="true"/>
+<s:textfield name="repository.daysOlder" label="Repository Purge By Days Older Than" size="5"/>
+<s:textfield name="repository.retentionCount" label="Repository Purge By Retention Count" size="5"/>
+<s:checkbox name="repository.releases" value="repository.releases" label="Releases Included"/>
+<s:checkbox name="repository.blockRedeployments" value="repository.blockRedeployments" label="Block Re-deployment of Released Artifacts"/>
+<s:checkbox name="repository.snapshots" value="repository.snapshots" label="Snapshots Included"/>
+<s:checkbox name="repository.scanned" value="repository.scanned" label="Scannable"/>
+<s:checkbox name="repository.deleteReleasedSnapshots" value="repository.deleteReleasedSnapshots"
+             label="Delete Released Snapshots"/>
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeAction.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeAction.jsp
new file mode 100644 (file)
index 0000000..2b9c4d6
--- /dev/null
@@ -0,0 +1,49 @@
+<%--
+  ~ 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.
+  --%>
+
+<%-- http://www.opensymphony.com/webwork/wikidocs/File%20Upload%20Interceptor.html --%>
+
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>Merge Repositories</title>
+  <s:head/>
+</head>
+
+<body>
+<h1>Merge Repositories</h1>
+
+<div id="contentArea">
+
+  <s:actionerror/>
+  <s:actionmessage/>
+  <s:form action="merge!doMerge" method="post" namespace="/admin" validate="false">
+    <s:hidden name="repository.id"/>
+    <%--<s:label label="ID" name="repoid"  value="repository.id"/>--%>
+    <%--<%@ include file="/WEB-INF/jsp/include/mergeActionForm.jspf" %>--%>
+
+    <s:submit/>
+  </s:form>
+</div>
+
+</body>
+</html>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeActionResults.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeActionResults.jsp
new file mode 100644 (file)
index 0000000..2e400a4
--- /dev/null
@@ -0,0 +1,43 @@
+<%--
+  ~ 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.
+  --%>
+
+<%-- http://www.opensymphony.com/webwork/wikidocs/File%20Upload%20Interceptor.html --%>
+
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>Merge Repositories</title>
+  <s:head/>
+</head>
+
+<body>
+<h1>Merge Repositories</h1>
+
+<div id="contentArea">
+
+  <s:actionerror/>
+  <s:actionmessage/>
+  <h1>successfully done the merging</h1>
+</div>
+
+</body>
+</html>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeExcludeConflicts.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeExcludeConflicts.jsp
new file mode 100644 (file)
index 0000000..e1d7a3b
--- /dev/null
@@ -0,0 +1,143 @@
+<%--
+  ~ 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.
+  --%>
+
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>Admin: Add Managed Repository</title>
+  <s:head/>
+</head>
+
+<body>
+
+<h1>Admin: Add Managed Repository</h1>
+
+  <div class="warningbox">
+    <p>
+      <strong>WARNING: There Are some conflicts Artifacts.</strong>
+    </p>
+  </div>
+
+  <p>
+    Are you sure you want to  merge the Repository
+    <%--<c:choose>--%>
+      <%--<c:when test="${action == 'merge'}">add</c:when>--%>
+      <%--<c:otherwise>update</c:otherwise>--%>
+    <%--</c:choose>--%>
+
+  </p>
+
+  <div class="infobox">
+    <table class="infotable">
+      <tr>
+        <td>ID:</td>
+        <td><code>${repository.id}</code></td>
+      </tr>
+      <tr>
+        <td>Name:</td>
+        <td>${repository.name}</td>
+      </tr>
+      <tr>
+        <td>Directory:</td>
+        <td>${repository.location}</td>
+      </tr>
+      <tr>
+        <td>Index Directory:</td>
+        <td>${repository.indexDir}</td>
+      </tr>
+      <tr>
+        <td>Type:</td>
+        <%--td>${repository.layout}</td--%>
+        <td>
+          <c:choose>
+               <c:when test="${repository.layout == 'default'}">
+                 Maven 2.x Repository
+               </c:when>
+               <c:otherwise>
+                 Maven 1.x Repository
+               </c:otherwise>
+             </c:choose>
+           </td>
+      </tr>
+      <tr>
+        <td>Cron:</td>
+        <td>${repository.refreshCronExpression}</td>
+      </tr>
+      <tr>
+        <td>Repository Purge By Days Older Than:</td>
+        <td>${repository.daysOlder}</td>
+      </tr>
+      <tr>
+        <td>Repository Purge By Retention Count:</td>
+        <td>${repository.retentionCount}</td>
+      </tr>
+      <tr>
+        <td>Releases Included:</td>
+        <td class="${repository.releases ? 'donemark' : 'errormark'} booleanIcon">
+      </tr>
+      <tr>
+        <td>Snapshots Included:</td>
+        <td class="${repository.snapshots ? 'donemark' : 'errormark'} booleanIcon">
+      </tr>
+      <tr>
+        <td>Scannable:</td>
+        <td class="${repository.scanned ? 'donemark' : 'errormark'} booleanIcon">
+      </tr>
+      <tr>
+        <td>Delete Released Snapshots:</td>
+        <td class="${repository.deleteReleasedSnapshots ? 'donemark' : 'errormark'} booleanIcon">
+      </tr>
+    </table>
+  </div>
+
+  <s:form method="post" action="%{action}" namespace="/admin" validate="true" theme="simple">
+    <div class="buttons">
+      <s:hidden name="repository.id" value="%{#attr.repository.id}"/>
+      <s:hidden name="repository.name" value="%{#attr.repository.name}"/>
+      <s:hidden name="repository.location" value="%{#attr.repository.location}"/>
+      <s:hidden name="repository.indexDir" value="%{#attr.repository.indexDir}"/>
+      <s:hidden name="repository.layout" value="%{#attr.repository.layout}"/>
+      <s:hidden name="repository.refreshCronExpression" value="%{#attr.repository.refreshCronExpression}"/>
+      <s:hidden name="repository.daysOlder" value="%{#attr.repository.daysOlder}"/>
+      <s:hidden name="repository.retentionCount" value="%{#attr.repository.retentionCount}"/>
+      <s:hidden name="repository.releases" value="%{#attr.repository.releases}"/>
+      <s:hidden name="repository.snapshots" value="%{#attr.repository.snapshots}"/>
+      <s:hidden name="repository.scanned" value="%{#attr.repository.scanned}"/>
+      <s:hidden name="repository.deleteReleasedSnapshots" value="%{#attr.repository.deleteReleasedSnapshots}"/>
+
+      <%--<c:choose>--%>
+
+        <s:submit value="Save" method="merge"/>
+        <%--<c:when test="${action == 'addRepository'}">--%>
+         <%--<s:submit value="Save" method="confirmAdd"/>--%>
+       <%--</c:when>--%>
+       <%--<c:otherwise>--%>
+         <%--<s:submit value="Save" method="confirmUpdate"/>--%>
+       <%--</c:otherwise>--%>
+     <%--</c:choose>--%>
+
+      <s:submit value="Cancel" method="execute"/>
+    </div>
+  </s:form>
+
+</body>
+</html>
index c1028137ebcb7550537ad87574a6010adb5a77a9..51cfb469ea9a2b17718ce9229040ef6f645ea2c1 100644 (file)
@@ -24,9 +24,6 @@ import org.apache.archiva.metadata.repository.filter.Filter;
 import org.apache.archiva.metadata.repository.filter.IncludesFilter;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
-import org.apache.maven.archiva.repository.RepositoryContentFactory;
-import org.apache.maven.archiva.repository.ManagedRepositoryContent;
-import org.apache.maven.archiva.repository.RepositoryNotFoundException;
 import org.apache.maven.archiva.repository.RepositoryException;
 import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException;
 import org.apache.maven.archiva.repository.metadata.RepositoryMetadataWriter;
@@ -34,7 +31,6 @@ import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.maven.archiva.common.utils.VersionComparator;
 import org.apache.maven.archiva.common.utils.VersionUtil;
@@ -81,7 +77,7 @@ public class Maven2RepositoryMerger
         this.configuration = configuration;
     }
 
-     public void setMetadataRepository( MetadataRepository metadataRepository )
+    public void setMetadataRepository( MetadataRepository metadataRepository )
     {
         this.metadataRepository = metadataRepository;
     }
@@ -99,8 +95,16 @@ public class Maven2RepositoryMerger
 
     // TODO when UI needs a subset to merge
     public void merge( String sourceRepoId, String targetRepoId, Filter<ArtifactMetadata> filter )
+        throws Exception
     {
-
+        List<ArtifactMetadata> sourceArtifacts = metadataRepository.getArtifacts( sourceRepoId );
+        for ( ArtifactMetadata metadata : sourceArtifacts )
+        {
+            if ( filter.accept( metadata ) )
+            {
+                createFolderStructure( sourceRepoId, targetRepoId, metadata );
+            }
+        }
     }
 
     private void createFolderStructure( String sourceRepoId, String targetRepoId, ArtifactMetadata artifactMetadata )
@@ -126,9 +130,8 @@ public class Maven2RepositoryMerger
 
         String sourceRepoPath = sourceRepoConfig.getLocation();
 
-        String artifactPath =
-            pathTranslator.toPath( artifactMetadata.getNamespace(), artifactMetadata.getProject(),
-                                   artifactMetadata.getProjectVersion(), artifactMetadata.getId() );
+        String artifactPath = pathTranslator.toPath( artifactMetadata.getNamespace(), artifactMetadata.getProject(),
+                                                     artifactMetadata.getProjectVersion(), artifactMetadata.getId() );
 
         File sourceArtifactFile = new File( sourceRepoPath, artifactPath );
 
@@ -149,7 +152,7 @@ public class Maven2RepositoryMerger
         // pom file copying
         String fileName = artifactMetadata.getProject() + "-" + artifactMetadata.getVersion() + ".pom";
 
-         // pom file copying
+        // pom file copying
         // TODO need to use path translator to get the pom file path
 //        String fileName = artifactMetadata.getProject() + "-" + artifactMetadata.getVersion() + ".pom";
 //
@@ -181,7 +184,8 @@ public class Maven2RepositoryMerger
             // updating version metadata files
             File versionMetaDataFileInSourceRepo =
                 pathTranslator.toFile( new File( sourceRepoPath ), artifactMetadata.getNamespace(),
-                                       artifactMetadata.getProject(), artifactMetadata.getVersion(), METADATA_FILENAME );
+                                       artifactMetadata.getProject(), artifactMetadata.getVersion(),
+                                       METADATA_FILENAME );
             String relativePathToVersionMetadataFile =
                 versionMetaDataFileInSourceRepo.getAbsolutePath().split( sourceRepoPath )[1];
             File versionMetaDataFileInTargetRepo = new File( targetRepoPath, relativePathToVersionMetadataFile );
@@ -320,4 +324,57 @@ public class Maven2RepositoryMerger
         }
         return metadata;
     }
+
+    public List<ArtifactMetadata> mergeWithOutConflictArtifacts( String sourceRepo, String targetRepo )
+        throws Exception
+    {
+
+        List<ArtifactMetadata> targetArtifacts = metadataRepository.getArtifacts( targetRepo );
+        List<ArtifactMetadata> sourceArtifacts = metadataRepository.getArtifacts( sourceRepo );
+        List<ArtifactMetadata> conflictsArtifacts = new ArrayList<ArtifactMetadata>();
+
+        for ( ArtifactMetadata targerArtifact : targetArtifacts )
+        {
+
+            for ( ArtifactMetadata sourceArtifact : sourceArtifacts )
+            {
+
+                if ( isEquals( targerArtifact, sourceArtifact ) )
+                {
+                    if ( !conflictsArtifacts.contains( sourceArtifact ) )
+                    {
+                        conflictsArtifacts.add( sourceArtifact );
+
+                    }
+
+                }
+
+            }
+        }
+
+        sourceArtifacts.removeAll( conflictsArtifacts );
+        Filter<ArtifactMetadata> artifactsWithOutConflicts = new IncludesFilter<ArtifactMetadata>( sourceArtifacts );
+        merge( sourceRepo, targetRepo, artifactsWithOutConflicts );
+        return conflictsArtifacts;
+    }
+
+    private boolean isEquals( ArtifactMetadata sourceArtifact, ArtifactMetadata targetArtifact )
+    {
+        boolean isSame = false;
+
+        if ( ( sourceArtifact.getNamespace().equals( targetArtifact.getNamespace() ) ) &&
+            ( sourceArtifact.getProject().equals( targetArtifact.getProject() ) ) &&
+            ( sourceArtifact.getVersion().equals( targetArtifact.getVersion() ) ) &&
+            ( sourceArtifact.getId().equals( targetArtifact.getId() ) ) &&
+            ( sourceArtifact.getProjectVersion().equals( targetArtifact.getProjectVersion() ) ) )
+
+        {
+            if ( sourceArtifact.getId().equals( targetArtifact.getId() ) )
+            {
+                isSame = true;
+            }
+        }
+
+        return isSame;
+    }
 }
index c19bc38811c62575099630846346e65f20d31d38..44fb3a1729165adbafc4742308597075bed542ae 100644 (file)
@@ -27,5 +27,5 @@ public interface RepositoryMerger
     void merge( String sourceRepoId, String targetRepoId )
         throws Exception;
 
-    void merge( String sourceRepoId, String targetRepoId, Filter<ArtifactMetadata> filter );
+    void merge( String sourceRepoId, String targetRepoId, Filter<ArtifactMetadata> filter ) throws Exception;
 }
index 6cf2e1e2a54169aba767b71c6744bf2421ae3491..916af4038cd39ba66b2fb8e47433a8f6b87a1cd4 100644 (file)
@@ -35,6 +35,7 @@ import org.junit.Before;
 
 import java.util.List;
 import java.util.ArrayList;
+import java.io.File;
 
 public class Maven2RepositoryMergerTest
     extends PlexusInSpringTestCase
@@ -64,7 +65,27 @@ public class Maven2RepositoryMergerTest
         super.setUp();
         MockitoAnnotations.initMocks( this );
         metadataRepository = mock( MetadataRepository.class );
+        repositoryMerger = (Maven2RepositoryMerger) lookup( RepositoryMerger.class, "maven2" );
+        repositoryMerger.setMetadataRepository( metadataRepository );
+    }
+
+    private List<ArtifactMetadata> getArtifacts()
+    {
+        List<ArtifactMetadata> metadata = new ArrayList<ArtifactMetadata>();
+        ArtifactMetadata artifact1 = new ArtifactMetadata();
+        artifact1.setNamespace( "com.example.test" );
+        artifact1.setProject( "test-artifact" );
+        artifact1.setVersion( "1.0-SNAPSHOT" );
+        artifact1.setProjectVersion( "1.0-SNAPSHOT" );
+        artifact1.setId( "test-artifact-1.0-20100308.230825-1.jar" );
+
+        metadata.add( artifact1 );
+        return metadata;
+    }
 
+    public void testMerge()
+        throws Exception
+    {
         ArchivaConfiguration configuration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class );
         Configuration c = new Configuration();
         ManagedRepositoryConfiguration testRepo = new ManagedRepositoryConfiguration();
@@ -84,29 +105,57 @@ public class Maven2RepositoryMergerTest
         c.addManagedRepository( targetRepo );
         configuration.save( c );
 
-        repositoryMerger = (Maven2RepositoryMerger) lookup( RepositoryMerger.class, "maven2" );
-        repositoryMerger.setMetadataRepository( metadataRepository );
+        when( metadataRepository.getArtifacts( TEST_REPO_ID ) ).thenReturn( getArtifacts() );
+        repositoryMerger.merge( TEST_REPO_ID, "target-rep" );
+        verify( metadataRepository ).getArtifacts( TEST_REPO_ID );
     }
 
-    private List<ArtifactMetadata> getArtifacts()
+    public void testMergeWithOutConflictArtifacts()
+        throws Exception
     {
-        List<ArtifactMetadata> metadata = new ArrayList<ArtifactMetadata>();
+        String sourceRepoId = "source-repo";
         ArtifactMetadata artifact1 = new ArtifactMetadata();
-        artifact1.setNamespace( "com.example.test" );
-        artifact1.setProject( "test-artifact" );
-        artifact1.setVersion( "1.0-SNAPSHOT" );
-        artifact1.setProjectVersion( "1.0-SNAPSHOT" );
-        artifact1.setId( "test-artifact-1.0-20100308.230825-1.jar" );
+        artifact1.setNamespace( "org.testng" );
+        artifact1.setProject( "testng" );
+        artifact1.setVersion( "5.8" );
+        artifact1.setProjectVersion( "5.8" );
+        artifact1.setId( "testng-5.8-jdk15.jar" );
+        artifact1.setRepositoryId( sourceRepoId );
 
-        metadata.add( artifact1 );
-        return metadata;
-    }
+        List<ArtifactMetadata> sourceRepoArtifactsList = getArtifacts();
+        sourceRepoArtifactsList.add( artifact1 );
+        List<ArtifactMetadata> targetRepoArtifactsList = getArtifacts();
 
-    public void testMerge()
-        throws Exception
-    {
-        when( metadataRepository.getArtifacts( TEST_REPO_ID ) ).thenReturn( getArtifacts() );
-        repositoryMerger.merge( TEST_REPO_ID, "target-rep" );
+        ArchivaConfiguration configuration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class );
+        Configuration c = new Configuration();
+        ManagedRepositoryConfiguration testRepo = new ManagedRepositoryConfiguration();
+        testRepo.setId( TEST_REPO_ID );
+        testRepo.setLocation( getTestPath( "target/test-repository" ) );
+
+        String sourceRepo = "src/test/resources/test-repository-with-conflict-artifacts";
+        ManagedRepositoryConfiguration testRepoWithConflicts = new ManagedRepositoryConfiguration();
+        testRepoWithConflicts.setId( sourceRepoId );
+        testRepoWithConflicts.setLocation( getTestPath( sourceRepo ) );
+
+        RepositoryScanningConfiguration repoScanConfig = new RepositoryScanningConfiguration();
+        List<String> knownContentConsumers = new ArrayList<String>();
+        knownContentConsumers.add( "metadata-updater" );
+        repoScanConfig.setKnownContentConsumers( knownContentConsumers );
+        c.setRepositoryScanning( repoScanConfig );
+
+        c.addManagedRepository( testRepo );
+        c.addManagedRepository( testRepoWithConflicts );
+        configuration.save( c );
+
+        File targetRepoFile = new File( getTestPath(
+            "/target/test-repository/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar" ) );
+        targetRepoFile.setReadOnly();
+
+        when( metadataRepository.getArtifacts( sourceRepoId ) ).thenReturn( sourceRepoArtifactsList );
+        when( metadataRepository.getArtifacts( TEST_REPO_ID ) ).thenReturn( targetRepoArtifactsList );
+
+        assertEquals( 1, repositoryMerger.mergeWithOutConflictArtifacts( sourceRepoId, TEST_REPO_ID ).size() );
         verify( metadataRepository ).getArtifacts( TEST_REPO_ID );
     }
+
 }
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/invalid-artifact.txt b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/invalid-artifact.txt
new file mode 100755 (executable)
index 0000000..acfe113
--- /dev/null
@@ -0,0 +1 @@
+invalid path
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml
new file mode 100755 (executable)
index 0000000..dee64e3
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>com.example.test</groupId>
+  <artifactId>test-artifact</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <versioning>
+    <snapshot>
+      <timestamp>20100310.014828</timestamp>
+      <buildNumber>2</buildNumber>
+    </snapshot>
+    <lastUpdated>20100310014828</lastUpdated>
+  </versioning>
+</metadata>
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5
new file mode 100755 (executable)
index 0000000..4ce347d
--- /dev/null
@@ -0,0 +1 @@
+aad6835e3e7a4a9de5318ce9183eab54
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1
new file mode 100755 (executable)
index 0000000..9318aa8
--- /dev/null
@@ -0,0 +1 @@
+73669371dc2fdae2fa9a129932ed0932d62d9e6b
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5
new file mode 100755 (executable)
index 0000000..e98bc51
--- /dev/null
@@ -0,0 +1 @@
+cc2236dd70af3667080a786c7dcb4a9b
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1
new file mode 100755 (executable)
index 0000000..2d7e384
--- /dev/null
@@ -0,0 +1 @@
+edf5938e646956f445c6ecb719d44579cdeed974
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom
new file mode 100755 (executable)
index 0000000..69a7d16
--- /dev/null
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>com.example.test</groupId>
+  <artifactId>test-artifact</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>test-artifact</name>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <distributionManagement>
+    <repository>
+      <id>test-repo</id>
+      <url>file:${basedir}/repository</url>
+    </repository>
+  </distributionManagement>
+</project>
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5
new file mode 100755 (executable)
index 0000000..531fc33
--- /dev/null
@@ -0,0 +1 @@
+ce7eeb9586dc4992dc961d9f3a28006b
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1
new file mode 100755 (executable)
index 0000000..c0edca2
--- /dev/null
@@ -0,0 +1 @@
+be040c8462fd31d4e03749e3586afbb21f43594e
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-javadoc.jar.md5 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-javadoc.jar.md5
new file mode 100755 (executable)
index 0000000..f6be27c
--- /dev/null
@@ -0,0 +1 @@
+e034e44b0d9f3968ebfbc66c71b41ba0
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-javadoc.jar.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-javadoc.jar.sha1
new file mode 100755 (executable)
index 0000000..56fd634
--- /dev/null
@@ -0,0 +1 @@
+ca8d1408b05d125d0307dbd23063e5aa04235d35
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-sources.jar.md5 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-sources.jar.md5
new file mode 100755 (executable)
index 0000000..35b216f
--- /dev/null
@@ -0,0 +1 @@
+a47f0edab0271fc55a3db38098f5f78a
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-sources.jar.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2-sources.jar.sha1
new file mode 100755 (executable)
index 0000000..818b1e1
--- /dev/null
@@ -0,0 +1 @@
+af4c914ef8f80be2a8241fb4d40cff11f4348c0f
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.jar.md5 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.jar.md5
new file mode 100755 (executable)
index 0000000..3a6bb7d
--- /dev/null
@@ -0,0 +1 @@
+37786de9e272ed6db8541855e0e2d5dc
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.jar.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.jar.sha1
new file mode 100755 (executable)
index 0000000..0e08bb6
--- /dev/null
@@ -0,0 +1 @@
+bb1ca7834422926d0cb79ef303b715bc17f41661
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.pom b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.pom
new file mode 100755 (executable)
index 0000000..65ed8cf
--- /dev/null
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>com.example.test</groupId>
+  <artifactId>test-artifact</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>test-artifact</name>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <distributionManagement>
+    <repository>
+      <id>test</id>
+      <url>file:${basedir}/repository</url>
+    </repository>
+  </distributionManagement>
+</project>
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.pom.md5 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.pom.md5
new file mode 100755 (executable)
index 0000000..78a9c26
--- /dev/null
@@ -0,0 +1 @@
+0612c49b1ac80983bfda08616330a4b8
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.pom.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100310.014828-2.pom.sha1
new file mode 100755 (executable)
index 0000000..f2385b6
--- /dev/null
@@ -0,0 +1 @@
+156d6062060743bf28df306e067914d3d692b571
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml
new file mode 100755 (executable)
index 0000000..dee64e3
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>com.example.test</groupId>
+  <artifactId>test-artifact</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <versioning>
+    <snapshot>
+      <timestamp>20100310.014828</timestamp>
+      <buildNumber>2</buildNumber>
+    </snapshot>
+    <lastUpdated>20100310014828</lastUpdated>
+  </versioning>
+</metadata>
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml.md5 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml.md5
new file mode 100755 (executable)
index 0000000..c92cd8c
--- /dev/null
@@ -0,0 +1 @@
+4c0a7072d66cfe2deebd3eb998332ccb
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml.sha1
new file mode 100755 (executable)
index 0000000..5835051
--- /dev/null
@@ -0,0 +1 @@
+64c28127c4923ff352021bdfdad448d2d881ef3b
\ No newline at end of file
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.jar b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.jar
new file mode 100755 (executable)
index 0000000..31ef718
Binary files /dev/null and b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.jar differ
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.jar.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.jar.sha1
new file mode 100755 (executable)
index 0000000..58eaa45
--- /dev/null
@@ -0,0 +1 @@
+e20c52f8ef51c1cbd52348d40d22422da649578b  testng-5.8-jdk15.jar
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.pom b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8-jdk15.pom
new file mode 100755 (executable)
index 0000000..4e7b53b
--- /dev/null
@@ -0,0 +1,58 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <!--
+    This POM cannot be used to build TestNG; it should only be used as part of a Maven
+    repository upload bundle.
+    
+    See the guide to creating a bundle here:
+    http://maven.apache.org/guides/mini/guide-central-repository-upload.html
+    -->
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.testng</groupId>
+    <artifactId>testng</artifactId>
+    <name>TestNG</name>
+    <version>5.8</version>
+    <description>TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionalities that make it more powerful and easier to use.</description>
+    <url>http://testng.org</url>
+    
+    <licenses>
+        <license>
+            <name>Apache License, Version 2.0</name>
+            <url>http://apache.org/licenses/LICENSE-2.0</url>
+        </license>
+    </licenses>
+
+    <scm>
+        <connection>scm:svn:http://testng.googlecode.com/svn/trunk/</connection>
+        <developerConnection>scm:svn:http://testng.googlecode.com/svn/trunk/</developerConnection>
+        <url>http://testng.googlecode.com/svn/trunk</url>
+    </scm>
+    
+    <dependencies>
+        <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.6.5</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+        </dependency>
+        <dependency>
+            <groupId>qdox</groupId>
+            <artifactId>qdox</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.beanshell</groupId>
+            <artifactId>bsh</artifactId>
+            <version>2.0b4</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>    
+    
+</project>
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8.pom.sha1 b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/org/testng/testng/5.8/testng-5.8.pom.sha1
new file mode 100755 (executable)
index 0000000..60f422f
--- /dev/null
@@ -0,0 +1 @@
+71df4387b8c96e5d2226cfa1e36acaebb96ba0f2  /home/maven/repository-staging/to-ibiblio/maven2/org/testng/testng/5.8/testng-5.8.pom