From: Maria Odea B. Ching Date: Sun, 18 Jul 2010 05:05:40 +0000 (+0000) Subject: [MRM-980] UI integration for staging repos X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4af6b292e4dc07af8d4db8c938e6e4675944a9b0;p=archiva.git [MRM-980] UI integration for staging repos 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 --- diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml index f3b190a8e..b1b925f61 100644 --- a/archiva-modules/archiva-web/archiva-webapp/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml @@ -18,7 +18,8 @@ ~ under the License. --> - + 4.0.0 org.apache.archiva @@ -82,6 +83,11 @@ org.apache.archiva archiva-lucene-consumers + + org.apache.archiva + stage-repository-merge + 1.4-MRM-980-SNAPSHOT + org.apache.archiva archiva-signature-consumers @@ -272,7 +278,8 @@ runtime - org.apache.archiva + org.apache.archiva + maven2-repository @@ -301,7 +308,7 @@ - --> + --> maven-antrun-plugin @@ -314,9 +321,9 @@ compile - + - + @@ -329,7 +336,7 @@ - + @@ -342,21 +349,21 @@ unpack-redback-war - unpack + unpack compile - - - org.codehaus.redback - redback-struts2-content - ${redback.version} - war - false - ${project.build.directory}/redback - **/struts-security.xml - - + + + org.codehaus.redback + redback-struts2-content + ${redback.version} + war + false + ${project.build.directory}/redback + **/struts-security.xml + + @@ -369,9 +376,12 @@ false - META-INF/**,WEB-INF/web.xml,WEB-INF/classes/xwork.xml,WEB-INF/lib/** - 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 - + META-INF/**,WEB-INF/web.xml,WEB-INF/classes/xwork.xml,WEB-INF/lib/** + + + 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 + + org.mortbay.jetty 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 index 000000000..34725b45c --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java @@ -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 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; + } +} diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java index 156e084bd..922a689bc 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java @@ -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() { diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java index d27eea503..b38e4830f 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java @@ -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; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java index 0aa427452..3d0a739d6 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java @@ -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 getManagedRepositories() { - return managedRepositories; + List managedRepositoriesList = new ArrayList(); + for ( ManagedRepositoryConfiguration repoConfig : managedRepositories ) + { + if ( !repoConfig.getId().contains( "stage" ) ) + { + managedRepositoriesList.add( repoConfig ); + } + } + return managedRepositoriesList; } public List getRemoteRepositories() diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml index fa127d095..64d3760cb 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml @@ -19,7 +19,7 @@ --> + "http://struts.apache.org/dtds/struts-2.0.dtd"> @@ -124,10 +124,10 @@ include a result for 'error' --> /WEB-INF/jsp/generalError.jsp /WEB-INF/jsp/accessToNoRepos.jsp - + - + @@ -147,7 +147,7 @@ /WEB-INF/jsp/results.jsp /WEB-INF/jsp/quickSearch.jsp - + /WEB-INF/jsp/quickSearch.jsp /WEB-INF/jsp/results.jsp @@ -158,7 +158,7 @@ /WEB-INF/jsp/findArtifact.jsp - + /WEB-INF/jsp/upload.jsp /WEB-INF/jsp/upload.jsp /WEB-INF/jsp/upload.jsp @@ -166,7 +166,7 @@ - + /WEB-INF/jsp/deleteArtifact.jsp /WEB-INF/jsp/deleteArtifact.jsp /WEB-INF/jsp/deleteArtifact.jsp @@ -179,7 +179,7 @@ /browse/${databaseResults.get(0).getNamespace()}/${databaseResults.get(0).getProject()}/${databaseResults.get(0).getVersion()} - + /WEB-INF/jsp/browse.jsp @@ -222,7 +222,7 @@ /WEB-INF/jsp/showArtifact.jsp - + /WEB-INF/jsp/showArtifact.jsp /WEB-INF/jsp/showArtifact.jsp @@ -247,53 +247,53 @@ /WEB-INF/jsp/admin/repositories.jsp - + - + /WEB-INF/jsp/admin/repositoryGroups.jsp - + /WEB-INF/jsp/admin/repositoryGroups.jsp /WEB-INF/jsp/admin/repositoryGroups.jsp repositoryGroups - + /WEB-INF/jsp/admin/deleteRepositoryGroup.jsp - + /WEB-INF/jsp/admin/deleteRepositoryGroup.jsp /WEB-INF/jsp/admin/deleteRepositoryGroup.jsp repositoryGroups - + /WEB-INF/jsp/admin/repositoryGroups.jsp /WEB-INF/jsp/admin/repositoryGroups.jsp repositoryGroups - + /WEB-INF/jsp/admin/repositoryGroups.jsp /WEB-INF/jsp/admin/repositoryGroups.jsp repositoryGroups - + /WEB-INF/jsp/admin/repositoryGroups.jsp /WEB-INF/jsp/admin/repositoryGroups.jsp repositoryGroups - + /WEB-INF/jsp/admin/repositoryGroups.jsp /WEB-INF/jsp/admin/repositoryGroups.jsp @@ -311,7 +311,7 @@ repositories - + /WEB-INF/jsp/admin/addRepository.jsp /WEB-INF/jsp/admin/addRepository.jsp @@ -359,7 +359,20 @@ - + + /WEB-INF/jsp/mergeActionResults.jsp + + + + + + + /WEB-INF/jsp/mergeActionResults.jsp + + + + + /WEB-INF/jsp/admin/deleteRemoteRepository.jsp /WEB-INF/jsp/admin/deleteRemoteRepository.jsp repositories @@ -401,7 +414,7 @@ proxyConnectors - + /WEB-INF/jsp/admin/enableProxyConnector.jsp proxyConnectors @@ -507,13 +520,13 @@ /WEB-INF/jsp/reports/blankReport.jsp /WEB-INF/jsp/reports/basicReport.jsp - + /WEB-INF/jsp/reports/pickReport.jsp /WEB-INF/jsp/reports/blankReport.jsp /WEB-INF/jsp/reports/statisticsReport.jsp - + /WEB-INF/jsp/reports/pickReport.jsp @@ -523,17 +536,17 @@ attachment; filename="archiva_statistics_report.csv" - + /WEB-INF/jsp/reports/auditLogReport.jsp - + /WEB-INF/jsp/reports/auditLogReport.jsp /WEB-INF/jsp/reports/auditLogReport.jsp - + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp index 158159490..faa295ec5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp @@ -36,6 +36,7 @@ <%@ include file="/WEB-INF/jsp/admin/include/repositoryForm.jspf" %> + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp index 5a0b482a0..561dc30fd 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp @@ -39,6 +39,7 @@ <%@ include file="/WEB-INF/jsp/admin/include/repositoryForm.jspf" %> + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf index bce43bc2b..ad015f654 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf @@ -34,5 +34,3 @@ - - diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp index f09d2442d..dd65ea461 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp @@ -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" %> @@ -29,15 +29,17 @@ @@ -102,7 +104,7 @@ - + @@ -114,41 +116,57 @@ - + - - + + - - + + + + + + - - - - - - - - + + - - <%-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this --%> + @@ -158,23 +176,23 @@ - + - + - + @@ -187,7 +205,7 @@ - + @@ -201,19 +219,19 @@ - + + + + + + + + + + + + + + + + +
IdentifierGroups - ${repository.id} + + ${group}, +
Name - ${repository.name} - Delete Released Snapshots
Directory${repository.location}Repository Purge By Days Older Than${repository.daysOlder}
Repository Purge By Retention Count${repository.retentionCount}
Index Directory${repository.indexDir}
WebDAV URL${baseUrl}/${repository.id}/Scanning Cron${repository.refreshCronExpression}
Type + Actions + - - Maven 2.x Repository + + No Statistics Available. - Maven 1.x Repository + + + + + + + + + + + + + + + +
Last Scanned${stats.scanStartTime}
Duration${stats.duration} ms
Total File Count${stats.totalFileCount} +
New Files Found${stats.newFileCount} +
Groups - ${group}, + ${group},
Releases Included
Snapshots Included
Delete Released Snapshots
Repository Purge By Days Older Than
Scanned
- - - - - - - - -
Process All Artifacts
+ + + + + + + + +
Process All Artifacts
Stats @@ -249,9 +267,49 @@
POM Snippet - +
Merge Actions + + + + + + + + +
+
+
+
+ + + + + + + + +
+
+
+
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 index 000000000..93e20dc9c --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/mergeActionForm.jspf @@ -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" %> + + + + + + + + + + + + + + + + \ 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 index 000000000..2b9c4d60b --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeAction.jsp @@ -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" %> + + + + Merge Repositories + + + + +

Merge Repositories

+ +
+ + + + + + <%----%> + <%--<%@ include file="/WEB-INF/jsp/include/mergeActionForm.jspf" %>--%> + + + +
+ + + 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 index 000000000..2e400a40f --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeActionResults.jsp @@ -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" %> + + + + Merge Repositories + + + + +

Merge Repositories

+ +
+ + + +

successfully done the merging

+
+ + + 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 index 000000000..e1d7a3bd4 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeExcludeConflicts.jsp @@ -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" %> + + + + Admin: Add Managed Repository + + + + + +

Admin: Add Managed Repository

+ +
+

+ WARNING: There Are some conflicts Artifacts. +

+
+ +

+ Are you sure you want to merge the Repository + <%----%> + <%--add--%> + <%--update--%> + <%----%> + +

+ +
+ + + + + + + + + + + + + + + + + + + + <%--td>${repository.layout} + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID:${repository.id}
Name:${repository.name}
Directory:${repository.location}
Index Directory:${repository.indexDir}
Type: + + + Maven 2.x Repository + + + Maven 1.x Repository + + +
Cron:${repository.refreshCronExpression}
Repository Purge By Days Older Than:${repository.daysOlder}
Repository Purge By Retention Count:${repository.retentionCount}
Releases Included: +
Snapshots Included: +
Scannable: +
Delete Released Snapshots: +
+
+ + +
+ + + + + + + + + + + + + + <%----%> + + + <%----%> + <%----%> + <%----%> + <%----%> + <%----%> + <%----%> + <%----%> + + +
+
+ + + diff --git a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java index c1028137e..51cfb469e 100644 --- a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java +++ b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java @@ -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 filter ) + throws Exception { - + List 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 mergeWithOutConflictArtifacts( String sourceRepo, String targetRepo ) + throws Exception + { + + List targetArtifacts = metadataRepository.getArtifacts( targetRepo ); + List sourceArtifacts = metadataRepository.getArtifacts( sourceRepo ); + List conflictsArtifacts = new ArrayList(); + + for ( ArtifactMetadata targerArtifact : targetArtifacts ) + { + + for ( ArtifactMetadata sourceArtifact : sourceArtifacts ) + { + + if ( isEquals( targerArtifact, sourceArtifact ) ) + { + if ( !conflictsArtifacts.contains( sourceArtifact ) ) + { + conflictsArtifacts.add( sourceArtifact ); + + } + + } + + } + } + + sourceArtifacts.removeAll( conflictsArtifacts ); + Filter artifactsWithOutConflicts = new IncludesFilter( 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; + } } diff --git a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/RepositoryMerger.java b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/RepositoryMerger.java index c19bc3881..44fb3a172 100644 --- a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/RepositoryMerger.java +++ b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/RepositoryMerger.java @@ -27,5 +27,5 @@ public interface RepositoryMerger void merge( String sourceRepoId, String targetRepoId ) throws Exception; - void merge( String sourceRepoId, String targetRepoId, Filter filter ); + void merge( String sourceRepoId, String targetRepoId, Filter filter ) throws Exception; } diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java b/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java index 6cf2e1e2a..916af4038 100644 --- a/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java +++ b/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java @@ -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 getArtifacts() + { + List metadata = new ArrayList(); + 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 getArtifacts() + public void testMergeWithOutConflictArtifacts() + throws Exception { - List metadata = new ArrayList(); + 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 sourceRepoArtifactsList = getArtifacts(); + sourceRepoArtifactsList.add( artifact1 ); + List 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 knownContentConsumers = new ArrayList(); + 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 index 000000000..acfe11318 --- /dev/null +++ b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/invalid-artifact.txt @@ -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 index 000000000..dee64e3fe --- /dev/null +++ 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 @@ -0,0 +1,13 @@ + + + com.example.test + test-artifact + 1.0-SNAPSHOT + + + 20100310.014828 + 2 + + 20100310014828 + + 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 index 000000000..4ce347dc1 --- /dev/null +++ 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 @@ -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 index 000000000..9318aa84b --- /dev/null +++ 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 @@ -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 index 000000000..e98bc51e4 --- /dev/null +++ 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 @@ -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 index 000000000..2d7e3840f --- /dev/null +++ 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 @@ -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 index 000000000..69a7d1689 --- /dev/null +++ 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 @@ -0,0 +1,24 @@ + + 4.0.0 + com.example.test + test-artifact + jar + 1.0-SNAPSHOT + test-artifact + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + + test-repo + file:${basedir}/repository + + + 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 index 000000000..531fc330c --- /dev/null +++ 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 @@ -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 index 000000000..c0edca2a1 --- /dev/null +++ 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 @@ -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 index 000000000..f6be27c2b --- /dev/null +++ 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 @@ -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 index 000000000..56fd634ce --- /dev/null +++ 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 @@ -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 index 000000000..35b216fdb --- /dev/null +++ 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 @@ -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 index 000000000..818b1e1df --- /dev/null +++ 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 @@ -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 index 000000000..3a6bb7df7 --- /dev/null +++ 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 @@ -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 index 000000000..0e08bb630 --- /dev/null +++ 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 @@ -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 index 000000000..65ed8cf24 --- /dev/null +++ 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 @@ -0,0 +1,24 @@ + + 4.0.0 + com.example.test + test-artifact + jar + 1.0-SNAPSHOT + test-artifact + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + + test + file:${basedir}/repository + + + 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 index 000000000..78a9c2695 --- /dev/null +++ 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 @@ -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 index 000000000..f2385b6e2 --- /dev/null +++ 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 @@ -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 index 000000000..dee64e3fe --- /dev/null +++ b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml @@ -0,0 +1,13 @@ + + + com.example.test + test-artifact + 1.0-SNAPSHOT + + + 20100310.014828 + 2 + + 20100310014828 + + 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 index 000000000..c92cd8c2d --- /dev/null +++ b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml.md5 @@ -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 index 000000000..5835051b4 --- /dev/null +++ b/archiva-modules/plugins/stage-repository-merge/src/test/resources/test-repository-with-conflict-artifacts/com/example/test/test-artifact/maven-metadata.xml.sha1 @@ -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 index 000000000..31ef718e7 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 index 000000000..58eaa4599 --- /dev/null +++ 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 @@ -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 index 000000000..4e7b53b08 --- /dev/null +++ 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 @@ -0,0 +1,58 @@ + + + 4.0.0 + org.testng + testng + TestNG + 5.8 + TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionalities that make it more powerful and easier to use. + http://testng.org + + + + Apache License, Version 2.0 + http://apache.org/licenses/LICENSE-2.0 + + + + + scm:svn:http://testng.googlecode.com/svn/trunk/ + scm:svn:http://testng.googlecode.com/svn/trunk/ + http://testng.googlecode.com/svn/trunk + + + + + ant + ant + 1.6.5 + true + + + junit + junit + 3.8.1 + + + qdox + qdox + 1.6.1 + provided + + + org.beanshell + bsh + 2.0b4 + provided + + + + 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 index 000000000..60f422fa3 --- /dev/null +++ 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 @@ -0,0 +1 @@ +71df4387b8c96e5d2226cfa1e36acaebb96ba0f2 /home/maven/repository-staging/to-ibiblio/maven2/org/testng/testng/5.8/testng-5.8.pom