1 package org.apache.archiva.repository.metadata;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.admin.model.beans.ManagedRepository;
23 import org.apache.archiva.common.utils.VersionComparator;
24 import org.apache.archiva.configuration.ProxyConnectorConfiguration;
25 import org.apache.archiva.model.ProjectReference;
26 import org.apache.archiva.model.VersionedReference;
27 import org.apache.archiva.policies.CachedFailuresPolicy;
28 import org.apache.archiva.policies.ChecksumPolicy;
29 import org.apache.archiva.policies.ReleasesPolicy;
30 import org.apache.archiva.policies.SnapshotsPolicy;
31 import org.apache.archiva.repository.AbstractRepositoryLayerTestCase;
32 import org.apache.archiva.repository.ManagedRepositoryContent;
33 import org.apache.archiva.repository.MockConfiguration;
34 import org.apache.archiva.repository.RemoteRepositoryContent;
35 import org.apache.archiva.repository.layout.LayoutException;
36 import org.apache.commons.io.FileUtils;
37 import org.apache.commons.lang.StringUtils;
38 import org.custommonkey.xmlunit.DetailedDiff;
39 import org.custommonkey.xmlunit.Diff;
40 import org.junit.Test;
41 import org.springframework.test.context.ContextConfiguration;
42 import org.xml.sax.SAXException;
44 import javax.inject.Inject;
45 import javax.inject.Named;
46 import javax.xml.parsers.ParserConfigurationException;
48 import java.io.IOException;
49 import java.util.ArrayList;
50 import java.util.Collections;
51 import java.util.List;
54 import static org.junit.Assert.*;
61 @ContextConfiguration(
62 locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-metadata-tools-test.xml" } )
63 public class MetadataToolsTest
64 extends AbstractRepositoryLayerTestCase
67 @Named( value = "metadataTools#test" )
68 private MetadataTools tools;
71 @Named( value = "archivaConfiguration#mock" )
72 protected MockConfiguration config;
75 public void testGatherSnapshotVersionsA()
78 removeProxyConnector( "test-repo", "apache-snapshots" );
79 removeProxyConnector( "test-repo", "internal-snapshots" );
80 removeProxyConnector( "test-repo", "snapshots.codehaus.org" );
82 assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT",
83 new String[]{ "1.0-alpha-11-SNAPSHOT", "1.0-alpha-11-20070221.194724-2",
84 "1.0-alpha-11-20070302.212723-3", "1.0-alpha-11-20070303.152828-4",
85 "1.0-alpha-11-20070305.215149-5", "1.0-alpha-11-20070307.170909-6",
86 "1.0-alpha-11-20070314.211405-9", "1.0-alpha-11-20070316.175232-11" } );
90 public void testGatherSnapshotVersionsAWithProxies()
93 // These proxied repositories do not need to exist for the purposes of this unit test,
94 // just the repository ids are important.
95 createProxyConnector( "test-repo", "apache-snapshots" );
96 createProxyConnector( "test-repo", "internal-snapshots" );
97 createProxyConnector( "test-repo", "snapshots.codehaus.org" );
99 assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT",
100 new String[]{ "1.0-alpha-11-SNAPSHOT", "1.0-alpha-11-20070221.194724-2",
101 "1.0-alpha-11-20070302.212723-3", "1.0-alpha-11-20070303.152828-4",
102 "1.0-alpha-11-20070305.215149-5", "1.0-alpha-11-20070307.170909-6",
103 "1.0-alpha-11-20070314.211405-9", "1.0-alpha-11-20070315.033030-10"
104 /* Arrives in via snapshots.codehaus.org proxy */,
105 "1.0-alpha-11-20070316.175232-11" } );
109 public void testGetRepositorySpecificName()
112 RemoteRepositoryContent repoJavaNet =
113 createRemoteRepositoryContent( "maven2-repository.dev.java.net", "Java.net Repository for Maven 2",
114 "http://download.java.net/maven/2/", "default" );
115 RemoteRepositoryContent repoCentral =
116 createRemoteRepositoryContent( "central", "Central Global Repository", "http://repo1.maven.org/maven2/",
119 String convertedName =
120 tools.getRepositorySpecificName( repoJavaNet, "commons-lang/commons-lang/maven-metadata.xml" );
121 assertMetadataPath( "commons-lang/commons-lang/maven-metadata-maven2-repository.dev.java.net.xml",
124 convertedName = tools.getRepositorySpecificName( repoCentral, "commons-lang/commons-lang/maven-metadata.xml" );
125 assertMetadataPath( "commons-lang/commons-lang/maven-metadata-central.xml", convertedName );
128 // TODO: replace with group tests
129 // public void testUpdateProjectBadArtifact()
134 // assertUpdatedProjectMetadata( "bad_artifact", null );
135 // fail( "Should have thrown an IOException on a bad artifact." );
137 // catch ( IOException e )
144 public void testUpdateProjectNonExistingVersion()
147 ManagedRepositoryContent testRepo = createTestRepoContent();
148 ProjectReference reference = new ProjectReference();
149 reference.setGroupId( "org.apache.archiva.metadata.tests" );
150 reference.setArtifactId( "missing_artifact" );
152 prepTestRepo( testRepo, reference );
154 // check metadata prior to update -- should contain the non-existing artifact version
155 assertProjectMetadata( testRepo, reference, "missing_artifact",
156 new String[]{ "1.0-SNAPSHOT", "1.1-SNAPSHOT", "1.2-SNAPSHOT" }, "1.2-SNAPSHOT", null );
158 tools.updateMetadata( testRepo, reference );
160 // metadata should not contain the non-existing artifact version -- 1.1-SNAPSHOT
161 assertProjectMetadata( testRepo, reference, "missing_artifact", new String[]{ "1.0-SNAPSHOT", "1.2-SNAPSHOT" },
162 "1.2-SNAPSHOT", null );
166 public void testUpdateProjectMissingMultipleVersions()
169 assertUpdatedProjectMetadata( "missing_metadata_b",
170 new String[]{ "1.0", "1.0.1", "2.0", "2.0.1", "2.0-20070821-dev" },
171 "2.0-20070821-dev", "2.0-20070821-dev" );
175 public void testUpdateProjectMissingMultipleVersionsWithProxies()
178 // Attach the (bogus) proxies to the managed repo.
179 // These proxied repositories do not need to exist for the purposes of this unit test,
180 // just the repository ids are important.
181 createProxyConnector( "test-repo", "central" );
182 createProxyConnector( "test-repo", "java.net" );
184 assertUpdatedProjectMetadata( "proxied_multi",
185 new String[]{ "1.0-spec" /* in java.net */, "1.0" /* in managed, and central */,
186 "1.0.1" /* in central */, "1.1" /* in managed */, "2.0-proposal-beta"
187 /* in java.net */, "2.0-spec" /* in java.net */, "2.0"
188 /* in central, and java.net */, "2.0.1" /* in java.net */, "2.1"
189 /* in managed */, "3.0" /* in central */, "3.1" /* in central */ }, "3.1",
194 public void testUpdateProjectSimpleYetIncomplete()
197 assertUpdatedProjectMetadata( "incomplete_metadata_a", new String[]{ "1.0" }, "1.0", "1.0" );
201 public void testUpdateProjectSimpleYetMissing()
204 assertUpdatedProjectMetadata( "missing_metadata_a", new String[]{ "1.0" }, "1.0", "1.0" );
208 public void testUpdateVersionSimple10()
211 assertUpdatedReleaseVersionMetadata( "missing_metadata_a", "1.0" );
215 public void testUpdateVersionSimple20()
218 assertUpdatedReleaseVersionMetadata( "missing_metadata_b", "2.0" );
222 public void testUpdateVersionSimple20NotSnapshot()
225 assertUpdatedReleaseVersionMetadata( "missing_metadata_b", "2.0-20070821-dev" );
229 public void testUpdateVersionSnapshotA()
232 assertUpdatedSnapshotVersionMetadata( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", "20070316", "175232", "11" );
236 public void testToPathFromVersionReference()
238 VersionedReference reference = new VersionedReference();
239 reference.setGroupId( "com.foo" );
240 reference.setArtifactId( "foo-tool" );
241 reference.setVersion( "1.0" );
243 assertEquals( "com/foo/foo-tool/1.0/maven-metadata.xml", tools.toPath( reference ) );
247 public void testToPathFromProjectReference()
249 ProjectReference reference = new ProjectReference();
250 reference.setGroupId( "com.foo" );
251 reference.setArtifactId( "foo-tool" );
253 assertEquals( "com/foo/foo-tool/maven-metadata.xml", tools.toPath( reference ) );
257 public void testToProjectReferenceFooTools()
258 throws RepositoryMetadataException
260 assertProjectReference( "com.foo", "foo-tools", "com/foo/foo-tools/maven-metadata.xml" );
264 public void testToProjectReferenceAReallyLongPath()
265 throws RepositoryMetadataException
267 String groupId = "net.i.have.a.really.long.path.just.for.the.hell.of.it";
268 String artifactId = "a";
269 String path = "net/i/have/a/really/long/path/just/for/the/hell/of/it/a/maven-metadata.xml";
271 assertProjectReference( groupId, artifactId, path );
275 public void testToProjectReferenceCommonsLang()
276 throws RepositoryMetadataException
278 String groupId = "commons-lang";
279 String artifactId = "commons-lang";
280 String path = "commons-lang/commons-lang/maven-metadata.xml";
282 assertProjectReference( groupId, artifactId, path );
285 private void assertProjectReference( String groupId, String artifactId, String path )
286 throws RepositoryMetadataException
288 ProjectReference reference = tools.toProjectReference( path );
290 assertNotNull( "Reference should not be null.", reference );
291 assertEquals( "ProjectReference.groupId", groupId, reference.getGroupId() );
292 assertEquals( "ProjectReference.artifactId", artifactId, reference.getArtifactId() );
296 public void testToVersionedReferenceFooTool()
297 throws RepositoryMetadataException
299 String groupId = "com.foo";
300 String artifactId = "foo-tool";
301 String version = "1.0";
302 String path = "com/foo/foo-tool/1.0/maven-metadata.xml";
304 assertVersionedReference( groupId, artifactId, version, path );
308 public void testToVersionedReferenceAReallyLongPath()
309 throws RepositoryMetadataException
311 String groupId = "net.i.have.a.really.long.path.just.for.the.hell.of.it";
312 String artifactId = "a";
313 String version = "1.1-alpha-1";
314 String path = "net/i/have/a/really/long/path/just/for/the/hell/of/it/a/1.1-alpha-1/maven-metadata.xml";
316 assertVersionedReference( groupId, artifactId, version, path );
320 public void testToVersionedReferenceCommonsLang()
321 throws RepositoryMetadataException
323 String groupId = "commons-lang";
324 String artifactId = "commons-lang";
325 String version = "2.1";
326 String path = "commons-lang/commons-lang/2.1/maven-metadata.xml";
328 assertVersionedReference( groupId, artifactId, version, path );
332 public void testToVersionedReferenceSnapshot()
333 throws RepositoryMetadataException
335 String groupId = "com.foo";
336 String artifactId = "foo-connector";
337 String version = "2.1-SNAPSHOT";
338 String path = "com/foo/foo-connector/2.1-SNAPSHOT/maven-metadata.xml";
340 assertVersionedReference( groupId, artifactId, version, path );
343 private void assertVersionedReference( String groupId, String artifactId, String version, String path )
344 throws RepositoryMetadataException
346 VersionedReference reference = tools.toVersionedReference( path );
347 assertNotNull( "Reference should not be null.", reference );
349 assertEquals( "VersionedReference.groupId", groupId, reference.getGroupId() );
350 assertEquals( "VersionedReference.artifactId", artifactId, reference.getArtifactId() );
351 assertEquals( "VersionedReference.version", version, reference.getVersion() );
354 private void assertSnapshotVersions( String artifactId, String version, String[] expectedVersions )
357 File repoRootDir = new File( "src/test/repositories/metadata-repository" );
359 VersionedReference reference = new VersionedReference();
360 reference.setGroupId( "org.apache.archiva.metadata.tests" );
361 reference.setArtifactId( artifactId );
362 reference.setVersion( version );
364 ManagedRepository repo =
365 createRepository( "test-repo", "Test Repository: " + name.getMethodName(), repoRootDir );
366 ManagedRepositoryContent repoContent =
367 applicationContext.getBean( "managedRepositoryContent#default", ManagedRepositoryContent.class );
368 repoContent.setRepository( repo );
370 Set<String> testedVersionSet = tools.gatherSnapshotVersions( repoContent, reference );
372 // Sort the list (for asserts)
373 List<String> testedVersions = new ArrayList<String>();
374 testedVersions.addAll( testedVersionSet );
375 Collections.sort( testedVersions, new VersionComparator() );
377 // Test the expected array of versions, to the actual tested versions
378 assertEquals( "Assert Snapshot Versions: length/size", expectedVersions.length, testedVersions.size() );
380 for ( int i = 0; i < expectedVersions.length; i++ )
382 String actualVersion = testedVersions.get( i );
383 assertEquals( "Snapshot Versions[" + i + "]", expectedVersions[i], actualVersion );
387 private void assertMetadata( String expectedMetadata, ManagedRepositoryContent repository,
388 ProjectReference reference )
389 throws LayoutException, IOException, SAXException, ParserConfigurationException
391 File metadataFile = new File( repository.getRepoRoot(), tools.toPath( reference ) );
392 String actualMetadata = FileUtils.readFileToString( metadataFile, null );
394 DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) );
395 if ( !detailedDiff.similar() )
397 // If it isn't similar, dump the difference.
398 assertEquals( expectedMetadata, actualMetadata );
402 private void assertMetadata( String expectedMetadata, ManagedRepositoryContent repository,
403 VersionedReference reference )
404 throws LayoutException, IOException, SAXException, ParserConfigurationException
406 File metadataFile = new File( repository.getRepoRoot(), tools.toPath( reference ) );
407 String actualMetadata = FileUtils.readFileToString( metadataFile, null );
409 DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) );
410 if ( !detailedDiff.similar() )
412 // If it isn't similar, dump the difference.
413 assertEquals( expectedMetadata, actualMetadata );
417 private void assertMetadataPath( String expected, String actual )
419 assertEquals( "Repository Specific Metadata Path", expected, actual );
422 private void assertUpdatedProjectMetadata( String artifactId, String[] expectedVersions, String latestVersion,
423 String releaseVersion )
426 ManagedRepositoryContent testRepo = createTestRepoContent();
427 ProjectReference reference = new ProjectReference();
428 reference.setGroupId( "org.apache.archiva.metadata.tests" );
429 reference.setArtifactId( artifactId );
431 prepTestRepo( testRepo, reference );
433 tools.updateMetadata( testRepo, reference );
435 StringBuilder buf = new StringBuilder();
436 buf.append( "<metadata>\n" );
437 buf.append( " <groupId>" ).append( reference.getGroupId() ).append( "</groupId>\n" );
438 buf.append( " <artifactId>" ).append( reference.getArtifactId() ).append( "</artifactId>\n" );
439 // buf.append( " <version>1.0</version>\n" );
441 if ( expectedVersions != null )
443 buf.append( " <versioning>\n" );
444 if ( latestVersion != null )
446 buf.append( " <latest>" ).append( latestVersion ).append( "</latest>\n" );
448 if ( releaseVersion != null )
450 buf.append( " <release>" ).append( releaseVersion ).append( "</release>\n" );
453 buf.append( " <versions>\n" );
454 for ( int i = 0; i < expectedVersions.length; i++ )
456 buf.append( " <version>" ).append( expectedVersions[i] ).append( "</version>\n" );
458 buf.append( " </versions>\n" );
459 buf.append( " </versioning>\n" );
461 buf.append( "</metadata>" );
463 assertMetadata( buf.toString(), testRepo, reference );
466 private void assertProjectMetadata( ManagedRepositoryContent testRepo, ProjectReference reference,
467 String artifactId, String[] expectedVersions, String latestVersion,
468 String releaseVersion )
471 StringBuilder buf = new StringBuilder();
472 buf.append( "<metadata>\n" );
473 buf.append( " <groupId>" ).append( reference.getGroupId() ).append( "</groupId>\n" );
474 buf.append( " <artifactId>" ).append( reference.getArtifactId() ).append( "</artifactId>\n" );
476 if ( expectedVersions != null )
478 buf.append( " <versioning>\n" );
479 if ( latestVersion != null )
481 buf.append( " <latest>" ).append( latestVersion ).append( "</latest>\n" );
483 if ( releaseVersion != null )
485 buf.append( " <release>" ).append( releaseVersion ).append( "</release>\n" );
488 buf.append( " <versions>\n" );
489 for ( int i = 0; i < expectedVersions.length; i++ )
491 buf.append( " <version>" ).append( expectedVersions[i] ).append( "</version>\n" );
493 buf.append( " </versions>\n" );
494 buf.append( " </versioning>\n" );
496 buf.append( "</metadata>" );
498 assertMetadata( buf.toString(), testRepo, reference );
501 private void assertUpdatedReleaseVersionMetadata( String artifactId, String version )
504 ManagedRepositoryContent testRepo = createTestRepoContent();
505 VersionedReference reference = new VersionedReference();
506 reference.setGroupId( "org.apache.archiva.metadata.tests" );
507 reference.setArtifactId( artifactId );
508 reference.setVersion( version );
510 prepTestRepo( testRepo, reference );
512 tools.updateMetadata( testRepo, reference );
514 StringBuilder buf = new StringBuilder();
515 buf.append( "<metadata>\n" );
516 buf.append( " <groupId>" ).append( reference.getGroupId() ).append( "</groupId>\n" );
517 buf.append( " <artifactId>" ).append( reference.getArtifactId() ).append( "</artifactId>\n" );
518 buf.append( " <version>" ).append( reference.getVersion() ).append( "</version>\n" );
519 buf.append( "</metadata>" );
521 assertMetadata( buf.toString(), testRepo, reference );
524 private void assertUpdatedSnapshotVersionMetadata( String artifactId, String version, String expectedDate,
525 String expectedTime, String expectedBuildNumber )
528 ManagedRepositoryContent testRepo = createTestRepoContent();
529 VersionedReference reference = new VersionedReference();
530 reference.setGroupId( "org.apache.archiva.metadata.tests" );
531 reference.setArtifactId( artifactId );
532 reference.setVersion( version );
534 prepTestRepo( testRepo, reference );
536 tools.updateMetadata( testRepo, reference );
538 StringBuilder buf = new StringBuilder();
539 buf.append( "<metadata>\n" );
540 buf.append( " <groupId>" ).append( reference.getGroupId() ).append( "</groupId>\n" );
541 buf.append( " <artifactId>" ).append( reference.getArtifactId() ).append( "</artifactId>\n" );
542 buf.append( " <version>" ).append( reference.getVersion() ).append( "</version>\n" );
543 buf.append( " <versioning>\n" );
544 buf.append( " <snapshot>\n" );
545 buf.append( " <buildNumber>" ).append( expectedBuildNumber ).append( "</buildNumber>\n" );
546 buf.append( " <timestamp>" );
547 buf.append( expectedDate ).append( "." ).append( expectedTime );
548 buf.append( "</timestamp>\n" );
549 buf.append( " </snapshot>\n" );
550 buf.append( " <lastUpdated>" ).append( expectedDate ).append( expectedTime ).append( "</lastUpdated>\n" );
551 buf.append( " </versioning>\n" );
552 buf.append( "</metadata>" );
554 assertMetadata( buf.toString(), testRepo, reference );
557 private void removeProxyConnector( String sourceRepoId, String targetRepoId )
559 ProxyConnectorConfiguration toRemove = null;
560 for ( ProxyConnectorConfiguration pcc : config.getConfiguration().getProxyConnectors() )
562 if ( pcc.getTargetRepoId().equals( targetRepoId ) && pcc.getSourceRepoId().equals( sourceRepoId ) )
567 if ( toRemove != null )
569 config.getConfiguration().removeProxyConnector( toRemove );
570 String prefix = "proxyConnectors.proxyConnector(" + "1" + ")"; // XXX
571 config.triggerChange( prefix + ".sourceRepoId", toRemove.getSourceRepoId() );
572 config.triggerChange( prefix + ".targetRepoId", toRemove.getTargetRepoId() );
573 config.triggerChange( prefix + ".proxyId", toRemove.getProxyId() );
574 config.triggerChange( prefix + ".policies.releases", toRemove.getPolicy( "releases", "" ) );
575 config.triggerChange( prefix + ".policies.checksum", toRemove.getPolicy( "checksum", "" ) );
576 config.triggerChange( prefix + ".policies.snapshots", toRemove.getPolicy( "snapshots", "" ) );
577 config.triggerChange( prefix + ".policies.cache-failures", toRemove.getPolicy( "cache-failures", "" ) );
581 private void createProxyConnector( String sourceRepoId, String targetRepoId )
583 ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration();
584 connectorConfig.setSourceRepoId( sourceRepoId );
585 connectorConfig.setTargetRepoId( targetRepoId );
586 connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.IGNORE );
587 connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS );
588 connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.ALWAYS );
589 connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.NO );
591 int count = config.getConfiguration().getProxyConnectors().size();
592 config.getConfiguration().addProxyConnector( connectorConfig );
594 // Proper Triggering ...
595 String prefix = "proxyConnectors.proxyConnector(" + count + ")";
596 config.triggerChange( prefix + ".sourceRepoId", connectorConfig.getSourceRepoId() );
597 config.triggerChange( prefix + ".targetRepoId", connectorConfig.getTargetRepoId() );
598 config.triggerChange( prefix + ".proxyId", connectorConfig.getProxyId() );
599 config.triggerChange( prefix + ".policies.releases", connectorConfig.getPolicy( "releases", "" ) );
600 config.triggerChange( prefix + ".policies.checksum", connectorConfig.getPolicy( "checksum", "" ) );
601 config.triggerChange( prefix + ".policies.snapshots", connectorConfig.getPolicy( "snapshots", "" ) );
602 config.triggerChange( prefix + ".policies.cache-failures", connectorConfig.getPolicy( "cache-failures", "" ) );
605 private ManagedRepositoryContent createTestRepoContent()
608 File repoRoot = new File( "target/metadata-tests/" + name.getMethodName() );
609 if ( repoRoot.exists() )
611 FileUtils.deleteDirectory( repoRoot );
616 ManagedRepository repoConfig =
617 createRepository( "test-repo", "Test Repository: " + name.getMethodName(), repoRoot );
619 ManagedRepositoryContent repoContent =
620 applicationContext.getBean( "managedRepositoryContent#default", ManagedRepositoryContent.class );
621 repoContent.setRepository( repoConfig );
625 private void prepTestRepo( ManagedRepositoryContent repo, ProjectReference reference )
628 String groupDir = StringUtils.replaceChars( reference.getGroupId(), '.', '/' );
629 String path = groupDir + "/" + reference.getArtifactId();
631 File srcRepoDir = new File( "src/test/repositories/metadata-repository" );
632 File srcDir = new File( srcRepoDir, path );
633 File destDir = new File( repo.getRepoRoot(), path );
635 assertTrue( "Source Dir exists: " + srcDir, srcDir.exists() );
638 FileUtils.copyDirectory( srcDir, destDir );
641 private void prepTestRepo( ManagedRepositoryContent repo, VersionedReference reference )
644 ProjectReference projectRef = new ProjectReference();
645 projectRef.setGroupId( reference.getGroupId() );
646 projectRef.setArtifactId( reference.getArtifactId() );
648 prepTestRepo( repo, projectRef );