import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.api.services.MergeRepositoriesService;
import org.apache.archiva.stagerepository.merge.Maven2RepositoryMerger;
+import org.springframework.stereotype.Service;
import javax.inject.Inject;
import javax.inject.Named;
* @author Olivier Lamy
* @since 1.4-M3
*/
+@Service ( "mergeRepositoriesService#rest" )
public class DefaultMergeRepositoriesService
extends AbstractRestService
implements MergeRepositoriesService
* under the License.
*/
+import org.apache.archiva.metadata.model.ArtifactMetadata;
import org.apache.archiva.rest.api.services.MergeRepositoriesService;
import org.junit.Test;
import java.io.File;
+import java.util.List;
/**
* @author Olivier Lamy
public void mergeConflictedArtifacts()
throws Exception
{
- String testRepoId = "test-repo";
- createStagedNeededAndIndexRepo( testRepoId, new File( "target/target-repo" ).getAbsolutePath() );
+ try
+ {
+ String testRepoId = "test-repo";
+ createStagedNeededAndIndexRepo( testRepoId, new File( "target/target-repo" ).getAbsolutePath() );
- MergeRepositoriesService service = getMergeRepositoriesService();
+ MergeRepositoriesService service = getMergeRepositoriesService();
- service.getMergeConflictedArtifacts( testRepoId );
+ List<ArtifactMetadata> artifactMetadatas = service.getMergeConflictedArtifacts( testRepoId );
- deleteTestRepo( testRepoId );
+ log.info( "conflicts: {}", artifactMetadatas );
+
+ deleteTestRepo( testRepoId );
+ } catch( Exception e)
+ {
+ log.error( e.getMessage(), e );
+ throw e;
+ }
}
}