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.nio.charset.Charset;
50 import java.util.ArrayList;
51 import java.util.Collections;
52 import java.util.List;
55 import static org.junit.Assert.*;
60 @ContextConfiguration (
61 locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-metadata-tools-test.xml" } )
62 public class MetadataToolsTest
63 extends AbstractRepositoryLayerTestCase
66 @Named ( value = "metadataTools#test" )
67 private MetadataTools tools;
70 @Named ( value = "archivaConfiguration#mock" )
71 protected MockConfiguration config;
74 public void testGatherSnapshotVersionsA()
77 removeProxyConnector( "test-repo", "apache-snapshots" );
78 removeProxyConnector( "test-repo", "internal-snapshots" );
79 removeProxyConnector( "test-repo", "snapshots.codehaus.org" );
81 assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT",
82 new String[]{ "1.0-alpha-11-SNAPSHOT", "1.0-alpha-11-20070221.194724-2",
83 "1.0-alpha-11-20070302.212723-3", "1.0-alpha-11-20070303.152828-4",
84 "1.0-alpha-11-20070305.215149-5", "1.0-alpha-11-20070307.170909-6",
85 "1.0-alpha-11-20070314.211405-9", "1.0-alpha-11-20070316.175232-11" } );
89 public void testGatherSnapshotVersionsAWithProxies()
92 // These proxied repositories do not need to exist for the purposes of this unit test,
93 // just the repository ids are important.
94 createProxyConnector( "test-repo", "apache-snapshots" );
95 createProxyConnector( "test-repo", "internal-snapshots" );
96 createProxyConnector( "test-repo", "snapshots.codehaus.org" );
98 assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT",
99 new String[]{ "1.0-alpha-11-SNAPSHOT", "1.0-alpha-11-20070221.194724-2",
100 "1.0-alpha-11-20070302.212723-3", "1.0-alpha-11-20070303.152828-4",
101 "1.0-alpha-11-20070305.215149-5", "1.0-alpha-11-20070307.170909-6",
102 "1.0-alpha-11-20070314.211405-9", "1.0-alpha-11-20070315.033030-10"
103 /* Arrives in via snapshots.codehaus.org proxy */,
104 "1.0-alpha-11-20070316.175232-11" } );
108 public void testGetRepositorySpecificName()
111 RemoteRepositoryContent repoJavaNet =
112 createRemoteRepositoryContent( "maven2-repository.dev.java.net", "Java.net Repository for Maven 2",
113 "http://download.java.net/maven/2/", "default" );
114 RemoteRepositoryContent repoCentral =
115 createRemoteRepositoryContent( "central", "Central Global Repository", "http://repo1.maven.org/maven2/",
118 String convertedName =
119 tools.getRepositorySpecificName( repoJavaNet, "commons-lang/commons-lang/maven-metadata.xml" );
120 assertMetadataPath( "commons-lang/commons-lang/maven-metadata-maven2-repository.dev.java.net.xml",
123 convertedName = tools.getRepositorySpecificName( repoCentral, "commons-lang/commons-lang/maven-metadata.xml" );
124 assertMetadataPath( "commons-lang/commons-lang/maven-metadata-central.xml", convertedName );
127 // TODO: replace with group tests
128 // public void testUpdateProjectBadArtifact()
133 // assertUpdatedProjectMetadata( "bad_artifact", null );
134 // fail( "Should have thrown an IOException on a bad artifact." );
136 // catch ( IOException e )
143 public void testUpdateProjectNonExistingVersion()
146 ManagedRepositoryContent testRepo = createTestRepoContent();
147 ProjectReference reference = new ProjectReference();
148 reference.setGroupId( "org.apache.archiva.metadata.tests" );
149 reference.setArtifactId( "missing_artifact" );
151 prepTestRepo( testRepo, reference );
153 // check metadata prior to update -- should contain the non-existing artifact version
154 assertProjectMetadata( testRepo, reference, "missing_artifact",
155 new String[]{ "1.0-SNAPSHOT", "1.1-SNAPSHOT", "1.2-SNAPSHOT" }, "1.2-SNAPSHOT", null );
157 tools.updateMetadata( testRepo, reference );
159 // metadata should not contain the non-existing artifact version -- 1.1-SNAPSHOT
160 assertProjectMetadata( testRepo, reference, "missing_artifact", new String[]{ "1.0-SNAPSHOT", "1.2-SNAPSHOT" },
161 "1.2-SNAPSHOT", null );
165 public void testUpdateProjectMissingMultipleVersions()
168 assertUpdatedProjectMetadata( "missing_metadata_b",
169 new String[]{ "1.0", "1.0.1", "2.0", "2.0.1", "2.0-20070821-dev" },
170 "2.0-20070821-dev", "2.0-20070821-dev" );
174 public void testUpdateProjectMissingMultipleVersionsWithProxies()
177 // Attach the (bogus) proxies to the managed repo.
178 // These proxied repositories do not need to exist for the purposes of this unit test,
179 // just the repository ids are important.
180 createProxyConnector( "test-repo", "central" );
181 createProxyConnector( "test-repo", "java.net" );
183 assertUpdatedProjectMetadata( "proxied_multi",
184 new String[]{ "1.0-spec" /* in java.net */, "1.0" /* in managed, and central */,
185 "1.0.1" /* in central */, "1.1" /* in managed */, "2.0-proposal-beta"
186 /* in java.net */, "2.0-spec" /* in java.net */, "2.0"
187 /* in central, and java.net */, "2.0.1" /* in java.net */, "2.1"
188 /* in managed */, "3.0" /* in central */, "3.1" /* in central */ }, "3.1",
193 public void testUpdateProjectSimpleYetIncomplete()
196 assertUpdatedProjectMetadata( "incomplete_metadata_a", new String[]{ "1.0" }, "1.0", "1.0" );
200 public void testUpdateProjectSimpleYetMissing()
203 assertUpdatedProjectMetadata( "missing_metadata_a", new String[]{ "1.0" }, "1.0", "1.0" );
207 public void testUpdateVersionSimple10()
210 assertUpdatedReleaseVersionMetadata( "missing_metadata_a", "1.0" );
214 public void testUpdateVersionSimple20()
217 assertUpdatedReleaseVersionMetadata( "missing_metadata_b", "2.0" );
221 public void testUpdateVersionSimple20NotSnapshot()
224 assertUpdatedReleaseVersionMetadata( "missing_metadata_b", "2.0-20070821-dev" );
228 public void testUpdateVersionSnapshotA()
231 assertUpdatedSnapshotVersionMetadata( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", "20070316", "175232", "11" );
235 public void testToPathFromVersionReference()
237 VersionedReference reference = new VersionedReference();
238 reference.setGroupId( "com.foo" );
239 reference.setArtifactId( "foo-tool" );
240 reference.setVersion( "1.0" );
242 assertEquals( "com/foo/foo-tool/1.0/maven-metadata.xml", tools.toPath( reference ) );
246 public void testToPathFromProjectReference()
248 ProjectReference reference = new ProjectReference();
249 reference.setGroupId( "com.foo" );
250 reference.setArtifactId( "foo-tool" );
252 assertEquals( "com/foo/foo-tool/maven-metadata.xml", tools.toPath( reference ) );
256 public void testToProjectReferenceFooTools()
257 throws RepositoryMetadataException
259 assertProjectReference( "com.foo", "foo-tools", "com/foo/foo-tools/maven-metadata.xml" );
263 public void testToProjectReferenceAReallyLongPath()
264 throws RepositoryMetadataException
266 String groupId = "net.i.have.a.really.long.path.just.for.the.hell.of.it";
267 String artifactId = "a";
268 String path = "net/i/have/a/really/long/path/just/for/the/hell/of/it/a/maven-metadata.xml";
270 assertProjectReference( groupId, artifactId, path );
274 public void testToProjectReferenceCommonsLang()
275 throws RepositoryMetadataException
277 String groupId = "commons-lang";
278 String artifactId = "commons-lang";
279 String path = "commons-lang/commons-lang/maven-metadata.xml";
281 assertProjectReference( groupId, artifactId, path );
284 private void assertProjectReference( String groupId, String artifactId, String path )
285 throws RepositoryMetadataException
287 ProjectReference reference = tools.toProjectReference( path );
289 assertNotNull( "Reference should not be null.", reference );
290 assertEquals( "ProjectReference.groupId", groupId, reference.getGroupId() );
291 assertEquals( "ProjectReference.artifactId", artifactId, reference.getArtifactId() );
295 public void testToVersionedReferenceFooTool()
296 throws RepositoryMetadataException
298 String groupId = "com.foo";
299 String artifactId = "foo-tool";
300 String version = "1.0";
301 String path = "com/foo/foo-tool/1.0/maven-metadata.xml";
303 assertVersionedReference( groupId, artifactId, version, path );
307 public void testToVersionedReferenceAReallyLongPath()
308 throws RepositoryMetadataException
310 String groupId = "net.i.have.a.really.long.path.just.for.the.hell.of.it";
311 String artifactId = "a";
312 String version = "1.1-alpha-1";
313 String path = "net/i/have/a/really/long/path/just/for/the/hell/of/it/a/1.1-alpha-1/maven-metadata.xml";
315 assertVersionedReference( groupId, artifactId, version, path );
319 public void testToVersionedReferenceCommonsLang()
320 throws RepositoryMetadataException
322 String groupId = "commons-lang";
323 String artifactId = "commons-lang";
324 String version = "2.1";
325 String path = "commons-lang/commons-lang/2.1/maven-metadata.xml";
327 assertVersionedReference( groupId, artifactId, version, path );
331 public void testToVersionedReferenceSnapshot()
332 throws RepositoryMetadataException
334 String groupId = "com.foo";
335 String artifactId = "foo-connector";
336 String version = "2.1-SNAPSHOT";
337 String path = "com/foo/foo-connector/2.1-SNAPSHOT/maven-metadata.xml";
339 assertVersionedReference( groupId, artifactId, version, path );
342 private void assertVersionedReference( String groupId, String artifactId, String version, String path )
343 throws RepositoryMetadataException
345 VersionedReference reference = tools.toVersionedReference( path );
346 assertNotNull( "Reference should not be null.", reference );
348 assertEquals( "VersionedReference.groupId", groupId, reference.getGroupId() );
349 assertEquals( "VersionedReference.artifactId", artifactId, reference.getArtifactId() );
350 assertEquals( "VersionedReference.version", version, reference.getVersion() );
353 private void assertSnapshotVersions( String artifactId, String version, String[] expectedVersions )
356 File repoRootDir = new File( "src/test/repositories/metadata-repository" );
358 VersionedReference reference = new VersionedReference();
359 reference.setGroupId( "org.apache.archiva.metadata.tests" );
360 reference.setArtifactId( artifactId );
361 reference.setVersion( version );
363 ManagedRepository repo =
364 createRepository( "test-repo", "Test Repository: " + name.getMethodName(), repoRootDir );
365 ManagedRepositoryContent repoContent =
366 applicationContext.getBean( "managedRepositoryContent#default", ManagedRepositoryContent.class );
367 repoContent.setRepository( repo );
369 Set<String> testedVersionSet = tools.gatherSnapshotVersions( repoContent, reference );
371 // Sort the list (for asserts)
372 List<String> testedVersions = new ArrayList<String>();
373 testedVersions.addAll( testedVersionSet );
374 Collections.sort( testedVersions, new VersionComparator() );
376 // Test the expected array of versions, to the actual tested versions
377 assertEquals( "Assert Snapshot Versions: length/size", expectedVersions.length, testedVersions.size() );
379 for ( int i = 0; i < expectedVersions.length; i++ )
381 String actualVersion = testedVersions.get( i );
382 assertEquals( "Snapshot Versions[" + i + "]", expectedVersions[i], actualVersion );
386 private void assertMetadata( String expectedMetadata, ManagedRepositoryContent repository,
387 ProjectReference reference )
388 throws LayoutException, IOException, SAXException, ParserConfigurationException
390 File metadataFile = new File( repository.getRepoRoot(), tools.toPath( reference ) );
391 String actualMetadata = FileUtils.readFileToString( metadataFile, Charset.defaultCharset() );
393 DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) );
394 if ( !detailedDiff.similar() )
396 // If it isn't similar, dump the difference.
397 assertEquals( expectedMetadata, actualMetadata );
401 private void assertMetadata( String expectedMetadata, ManagedRepositoryContent repository,
402 VersionedReference reference )
403 throws LayoutException, IOException, SAXException, ParserConfigurationException
405 File metadataFile = new File( repository.getRepoRoot(), tools.toPath( reference ) );
406 String actualMetadata = FileUtils.readFileToString( metadataFile, Charset.defaultCharset() );
408 DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) );
409 if ( !detailedDiff.similar() )
411 // If it isn't similar, dump the difference.
412 assertEquals( expectedMetadata, actualMetadata );
416 private void assertMetadataPath( String expected, String actual )
418 assertEquals( "Repository Specific Metadata Path", expected, actual );
421 private void assertUpdatedProjectMetadata( String artifactId, String[] expectedVersions, String latestVersion,
422 String releaseVersion )
425 ManagedRepositoryContent testRepo = createTestRepoContent();
426 ProjectReference reference = new ProjectReference();
427 reference.setGroupId( "org.apache.archiva.metadata.tests" );
428 reference.setArtifactId( artifactId );
430 prepTestRepo( testRepo, reference );
432 tools.updateMetadata( testRepo, reference );
434 StringBuilder buf = new StringBuilder();
435 buf.append( "<metadata>\n" );
436 buf.append( " <groupId>" ).append( reference.getGroupId() ).append( "</groupId>\n" );
437 buf.append( " <artifactId>" ).append( reference.getArtifactId() ).append( "</artifactId>\n" );
438 // buf.append( " <version>1.0</version>\n" );
440 if ( expectedVersions != null )
442 buf.append( " <versioning>\n" );
443 if ( latestVersion != null )
445 buf.append( " <latest>" ).append( latestVersion ).append( "</latest>\n" );
447 if ( releaseVersion != null )
449 buf.append( " <release>" ).append( releaseVersion ).append( "</release>\n" );
452 buf.append( " <versions>\n" );
453 for ( int i = 0; i < expectedVersions.length; i++ )
455 buf.append( " <version>" ).append( expectedVersions[i] ).append( "</version>\n" );
457 buf.append( " </versions>\n" );
458 buf.append( " </versioning>\n" );
460 buf.append( "</metadata>" );
462 assertMetadata( buf.toString(), testRepo, reference );
465 private void assertProjectMetadata( ManagedRepositoryContent testRepo, ProjectReference reference,
466 String artifactId, String[] expectedVersions, String latestVersion,
467 String releaseVersion )
470 StringBuilder buf = new StringBuilder();
471 buf.append( "<metadata>\n" );
472 buf.append( " <groupId>" ).append( reference.getGroupId() ).append( "</groupId>\n" );
473 buf.append( " <artifactId>" ).append( reference.getArtifactId() ).append( "</artifactId>\n" );
475 if ( expectedVersions != null )
477 buf.append( " <versioning>\n" );
478 if ( latestVersion != null )
480 buf.append( " <latest>" ).append( latestVersion ).append( "</latest>\n" );
482 if ( releaseVersion != null )
484 buf.append( " <release>" ).append( releaseVersion ).append( "</release>\n" );
487 buf.append( " <versions>\n" );
488 for ( int i = 0; i < expectedVersions.length; i++ )
490 buf.append( " <version>" ).append( expectedVersions[i] ).append( "</version>\n" );
492 buf.append( " </versions>\n" );
493 buf.append( " </versioning>\n" );
495 buf.append( "</metadata>" );
497 assertMetadata( buf.toString(), testRepo, reference );
500 private void assertUpdatedReleaseVersionMetadata( String artifactId, String version )
503 ManagedRepositoryContent testRepo = createTestRepoContent();
504 VersionedReference reference = new VersionedReference();
505 reference.setGroupId( "org.apache.archiva.metadata.tests" );
506 reference.setArtifactId( artifactId );
507 reference.setVersion( version );
509 prepTestRepo( testRepo, reference );
511 tools.updateMetadata( testRepo, reference );
513 StringBuilder buf = new StringBuilder();
514 buf.append( "<metadata>\n" );
515 buf.append( " <groupId>" ).append( reference.getGroupId() ).append( "</groupId>\n" );
516 buf.append( " <artifactId>" ).append( reference.getArtifactId() ).append( "</artifactId>\n" );
517 buf.append( " <version>" ).append( reference.getVersion() ).append( "</version>\n" );
518 buf.append( "</metadata>" );
520 assertMetadata( buf.toString(), testRepo, reference );
523 private void assertUpdatedSnapshotVersionMetadata( String artifactId, String version, String expectedDate,
524 String expectedTime, String expectedBuildNumber )
527 ManagedRepositoryContent testRepo = createTestRepoContent();
528 VersionedReference reference = new VersionedReference();
529 reference.setGroupId( "org.apache.archiva.metadata.tests" );
530 reference.setArtifactId( artifactId );
531 reference.setVersion( version );
533 prepTestRepo( testRepo, reference );
535 tools.updateMetadata( testRepo, reference );
537 StringBuilder buf = new StringBuilder();
538 buf.append( "<metadata>\n" );
539 buf.append( " <groupId>" ).append( reference.getGroupId() ).append( "</groupId>\n" );
540 buf.append( " <artifactId>" ).append( reference.getArtifactId() ).append( "</artifactId>\n" );
541 buf.append( " <version>" ).append( reference.getVersion() ).append( "</version>\n" );
542 buf.append( " <versioning>\n" );
543 buf.append( " <snapshot>\n" );
544 buf.append( " <buildNumber>" ).append( expectedBuildNumber ).append( "</buildNumber>\n" );
545 buf.append( " <timestamp>" );
546 buf.append( expectedDate ).append( "." ).append( expectedTime );
547 buf.append( "</timestamp>\n" );
548 buf.append( " </snapshot>\n" );
549 buf.append( " <lastUpdated>" ).append( expectedDate ).append( expectedTime ).append( "</lastUpdated>\n" );
550 buf.append( " </versioning>\n" );
551 buf.append( "</metadata>" );
553 assertMetadata( buf.toString(), testRepo, reference );
556 private void removeProxyConnector( String sourceRepoId, String targetRepoId )
558 ProxyConnectorConfiguration toRemove = null;
559 for ( ProxyConnectorConfiguration pcc : config.getConfiguration().getProxyConnectors() )
561 if ( pcc.getTargetRepoId().equals( targetRepoId ) && pcc.getSourceRepoId().equals( sourceRepoId ) )
566 if ( toRemove != null )
568 config.getConfiguration().removeProxyConnector( toRemove );
569 String prefix = "proxyConnectors.proxyConnector(" + "1" + ")"; // XXX
570 config.triggerChange( prefix + ".sourceRepoId", toRemove.getSourceRepoId() );
571 config.triggerChange( prefix + ".targetRepoId", toRemove.getTargetRepoId() );
572 config.triggerChange( prefix + ".proxyId", toRemove.getProxyId() );
573 config.triggerChange( prefix + ".policies.releases", toRemove.getPolicy( "releases", "" ) );
574 config.triggerChange( prefix + ".policies.checksum", toRemove.getPolicy( "checksum", "" ) );
575 config.triggerChange( prefix + ".policies.snapshots", toRemove.getPolicy( "snapshots", "" ) );
576 config.triggerChange( prefix + ".policies.cache-failures", toRemove.getPolicy( "cache-failures", "" ) );
580 private void createProxyConnector( String sourceRepoId, String targetRepoId )
582 ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration();
583 connectorConfig.setSourceRepoId( sourceRepoId );
584 connectorConfig.setTargetRepoId( targetRepoId );
585 connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.IGNORE );
586 connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS );
587 connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.ALWAYS );
588 connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.NO );
590 int count = config.getConfiguration().getProxyConnectors().size();
591 config.getConfiguration().addProxyConnector( connectorConfig );
593 // Proper Triggering ...
594 String prefix = "proxyConnectors.proxyConnector(" + count + ")";
595 config.triggerChange( prefix + ".sourceRepoId", connectorConfig.getSourceRepoId() );
596 config.triggerChange( prefix + ".targetRepoId", connectorConfig.getTargetRepoId() );
597 config.triggerChange( prefix + ".proxyId", connectorConfig.getProxyId() );
598 config.triggerChange( prefix + ".policies.releases", connectorConfig.getPolicy( "releases", "" ) );
599 config.triggerChange( prefix + ".policies.checksum", connectorConfig.getPolicy( "checksum", "" ) );
600 config.triggerChange( prefix + ".policies.snapshots", connectorConfig.getPolicy( "snapshots", "" ) );
601 config.triggerChange( prefix + ".policies.cache-failures", connectorConfig.getPolicy( "cache-failures", "" ) );
604 private ManagedRepositoryContent createTestRepoContent()
607 File repoRoot = new File( "target/metadata-tests/" + name.getMethodName() );
608 if ( repoRoot.exists() )
610 FileUtils.deleteDirectory( repoRoot );
615 ManagedRepository repoConfig =
616 createRepository( "test-repo", "Test Repository: " + name.getMethodName(), repoRoot );
618 ManagedRepositoryContent repoContent =
619 applicationContext.getBean( "managedRepositoryContent#default", ManagedRepositoryContent.class );
620 repoContent.setRepository( repoConfig );
624 private void prepTestRepo( ManagedRepositoryContent repo, ProjectReference reference )
627 String groupDir = StringUtils.replaceChars( reference.getGroupId(), '.', '/' );
628 String path = groupDir + "/" + reference.getArtifactId();
630 File srcRepoDir = new File( "src/test/repositories/metadata-repository" );
631 File srcDir = new File( srcRepoDir, path );
632 File destDir = new File( repo.getRepoRoot(), path );
634 assertTrue( "Source Dir exists: " + srcDir, srcDir.exists() );
637 FileUtils.copyDirectory( srcDir, destDir );
640 private void prepTestRepo( ManagedRepositoryContent repo, VersionedReference reference )
643 ProjectReference projectRef = new ProjectReference();
644 projectRef.setGroupId( reference.getGroupId() );
645 projectRef.setArtifactId( reference.getArtifactId() );
647 prepTestRepo( repo, projectRef );