1 package org.apache.maven.plugin.dependency;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.plugin.MojoFailureException;
23
24 import java.io.File;
25 import java.io.IOException;
26 import java.util.HashSet;
27 import java.util.Set;
28
29 import org.apache.maven.artifact.Artifact;
30 import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
31 import org.apache.maven.plugin.MojoExecutionException;
32 import org.apache.maven.plugin.dependency.testUtils.DependencyTestUtils;
33 import org.apache.maven.plugin.dependency.utils.DependencyUtil;
34 import org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler;
35 import org.apache.maven.plugin.testing.stubs.StubArtifactRepository;
36 import org.apache.maven.plugin.testing.stubs.StubArtifactResolver;
37 import org.apache.maven.project.MavenProject;
38 import org.codehaus.plexus.util.StringUtils;
39
40 public class TestCopyDependenciesMojo
41 extends AbstractDependencyMojoTestCase
42 {
43
44 CopyDependenciesMojo mojo;
45
46 protected void setUp()
47 throws Exception
48 {
49
50 super.setUp( "copy-dependencies", true );
51
52 File testPom = new File( getBasedir(), "target/test-classes/unit/copy-dependencies-test/plugin-config.xml" );
53 mojo = (CopyDependenciesMojo) lookupMojo( "copy-dependencies", testPom );
54 mojo.outputDirectory = new File( this.testDir, "outputDirectory" );
55
56
57 assertNotNull( mojo );
58 assertNotNull( mojo.getProject() );
59 MavenProject project = mojo.getProject();
60
61 Set<Artifact> artifacts = this.stubFactory.getScopedArtifacts();
62 Set<Artifact> directArtifacts = this.stubFactory.getReleaseAndSnapshotArtifacts();
63 artifacts.addAll( directArtifacts );
64
65 project.setArtifacts( artifacts );
66 project.setDependencyArtifacts( directArtifacts );
67 mojo.markersDirectory = new File( this.testDir, "markers" );
68
69 }
70
71 public void assertNoMarkerFile( Artifact artifact )
72 {
73 DefaultFileMarkerHandler handle = new DefaultFileMarkerHandler( artifact, mojo.markersDirectory );
74 try
75 {
76 assertFalse( handle.isMarkerSet() );
77 }
78 catch ( MojoExecutionException e )
79 {
80 fail( e.getLongMessage() );
81 }
82
83 }
84
85 public void testCopyFile()
86 throws MojoExecutionException, IOException
87 {
88 File src = File.createTempFile( "copy", null );
89
90 File dest = new File( mojo.outputDirectory, "toMe.jar" );
91
92 assertFalse( dest.exists() );
93
94 mojo.copyFile( src, dest );
95 assertTrue( dest.exists() );
96 }
97
98
99
100
101
102
103 public void testMojo()
104 throws Exception
105 {
106 mojo.execute();
107 Set<Artifact> artifacts = mojo.project.getArtifacts();
108 for ( Artifact artifact : artifacts )
109 {
110 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
111 File file = new File( mojo.outputDirectory, fileName );
112 assertTrue( file.exists() );
113
114
115 assertNoMarkerFile( artifact );
116 }
117 }
118
119 public void testStripVersion()
120 throws Exception
121 {
122 mojo.stripVersion = true;
123 mojo.execute();
124
125 Set<Artifact> artifacts = mojo.project.getArtifacts();
126 for ( Artifact artifact : artifacts )
127 {
128 String fileName = DependencyUtil.getFormattedFileName( artifact, true );
129 File file = new File( mojo.outputDirectory, fileName );
130 assertTrue( file.exists() );
131 }
132 }
133
134 public void testUseBaseVersion()
135 throws Exception
136 {
137 mojo.useBaseVersion = true;
138 mojo.execute();
139
140 Set<Artifact> artifacts = mojo.project.getArtifacts();
141 for ( Artifact artifact : artifacts )
142 {
143 String fileName = DependencyUtil.getFormattedFileName( artifact, false, false, true );
144 File file = new File( mojo.outputDirectory, fileName );
145 assertTrue( file.exists() );
146 }
147 }
148
149 public void testNoTransitive()
150 throws Exception
151 {
152 mojo.excludeTransitive = true;
153 mojo.execute();
154
155 Set<Artifact> artifacts = mojo.project.getDependencyArtifacts();
156 for ( Artifact artifact : artifacts )
157 {
158 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
159 File file = new File( mojo.outputDirectory, fileName );
160 assertTrue( file.exists() );
161 }
162 }
163
164 public void testExcludeType()
165 throws Exception
166 {
167 mojo.project.setArtifacts( stubFactory.getTypedArtifacts() );
168 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
169 mojo.excludeTypes = "jar";
170 mojo.execute();
171
172 Set<Artifact> artifacts = mojo.project.getArtifacts();
173 for ( Artifact artifact : artifacts )
174 {
175 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
176 File file = new File( mojo.outputDirectory, fileName );
177 assertEquals( artifact.getType().equalsIgnoreCase( "jar" ), !file.exists() );
178 }
179 }
180
181 public void testIncludeType()
182 throws Exception
183 {
184 mojo.project.setArtifacts( stubFactory.getTypedArtifacts() );
185 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
186
187 mojo.includeTypes = "jar";
188 mojo.excludeTypes = "jar";
189
190
191 mojo.execute();
192
193 Set<Artifact> artifacts = mojo.project.getArtifacts();
194 for ( Artifact artifact : artifacts )
195 {
196 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
197 File file = new File( mojo.outputDirectory, fileName );
198 assertFalse( file.exists() );
199 }
200
201 mojo.excludeTypes = "";
202 mojo.execute();
203
204 artifacts = mojo.project.getArtifacts();
205 for ( Artifact artifact : artifacts )
206 {
207 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
208 File file = new File( mojo.outputDirectory, fileName );
209 assertEquals( artifact.getType().equalsIgnoreCase( "jar" ), file.exists() );
210 }
211 }
212
213
214 public void testExcludeArtifactId()
215 throws Exception
216 {
217 mojo.project.setArtifacts( stubFactory.getArtifactArtifacts() );
218 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
219 mojo.excludeArtifactIds = "one";
220 mojo.execute();
221
222 Set<Artifact> artifacts = mojo.project.getArtifacts();
223 for ( Artifact artifact : artifacts )
224 {
225 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
226 File file = new File( mojo.outputDirectory, fileName );
227 assertEquals( artifact.getArtifactId().equals( "one" ), !file.exists() );
228 }
229 }
230
231 public void testIncludeArtifactId()
232 throws Exception
233 {
234 mojo.project.setArtifacts( stubFactory.getArtifactArtifacts() );
235 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
236
237 mojo.includeArtifactIds = "one";
238 mojo.excludeArtifactIds = "one";
239
240
241 mojo.execute();
242
243 Set<Artifact> artifacts = mojo.project.getArtifacts();
244 for ( Artifact artifact : artifacts )
245 {
246 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
247 File file = new File( mojo.outputDirectory, fileName );
248 assertFalse( file.exists() );
249 }
250
251 mojo.excludeArtifactIds = "";
252 mojo.execute();
253
254 artifacts = mojo.project.getArtifacts();
255 for ( Artifact artifact : artifacts )
256 {
257 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
258 File file = new File( mojo.outputDirectory, fileName );
259 assertEquals( artifact.getArtifactId().equals( "one" ), file.exists() );
260 }
261 }
262
263 public void testIncludeGroupId()
264 throws Exception
265 {
266 mojo.project.setArtifacts( stubFactory.getGroupIdArtifacts() );
267 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
268 mojo.includeGroupIds = "one";
269 mojo.excludeGroupIds = "one";
270
271
272 mojo.execute();
273
274 Set<Artifact> artifacts = mojo.project.getArtifacts();
275 for ( Artifact artifact : artifacts )
276 {
277 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
278 File file = new File( mojo.outputDirectory, fileName );
279 assertFalse( file.exists() );
280 }
281
282 mojo.excludeGroupIds = "";
283 mojo.execute();
284
285 artifacts = mojo.project.getArtifacts();
286 for ( Artifact artifact : artifacts )
287 {
288 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
289 File file = new File( mojo.outputDirectory, fileName );
290 assertEquals( artifact.getGroupId().equals( "one" ), file.exists() );
291 }
292
293 }
294
295 public void testExcludeGroupId()
296 throws Exception
297 {
298 mojo.project.setArtifacts( stubFactory.getGroupIdArtifacts() );
299 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
300 mojo.excludeGroupIds = "one";
301 mojo.execute();
302
303 Set<Artifact> artifacts = mojo.project.getArtifacts();
304 for ( Artifact artifact : artifacts )
305 {
306 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
307 File file = new File( mojo.outputDirectory, fileName );
308
309 assertEquals( artifact.getGroupId().equals( "one" ), !file.exists() );
310 }
311 }
312 public void testExcludeMultipleGroupIds()
313 throws Exception
314 {
315 mojo.project.setArtifacts( stubFactory.getGroupIdArtifacts() );
316 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
317 mojo.excludeGroupIds = "one,two";
318 mojo.execute();
319
320 Set<Artifact> artifacts = mojo.project.getArtifacts();
321 for ( Artifact artifact : artifacts )
322 {
323 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
324 File file = new File( mojo.outputDirectory, fileName );
325
326 assertEquals( artifact.getGroupId().equals( "one" ) || artifact.getGroupId().equals( "two" ), !file.exists() );
327 }
328 }
329
330 public void testExcludeClassifier()
331 throws Exception
332 {
333 mojo.project.setArtifacts( stubFactory.getClassifiedArtifacts() );
334 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
335 mojo.excludeClassifiers = "one";
336 mojo.execute();
337
338 Set<Artifact> artifacts = mojo.project.getArtifacts();
339 for ( Artifact artifact : artifacts )
340 {
341 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
342 File file = new File( mojo.outputDirectory, fileName );
343 assertEquals( artifact.getClassifier().equals( "one" ), !file.exists() );
344 }
345 }
346
347 public void testIncludeClassifier()
348 throws Exception
349 {
350 mojo.project.setArtifacts( stubFactory.getClassifiedArtifacts() );
351 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
352
353 mojo.includeClassifiers = "one";
354 mojo.excludeClassifiers = "one";
355
356
357 mojo.execute();
358
359 Set<Artifact> artifacts = mojo.project.getArtifacts();
360 for ( Artifact artifact : artifacts )
361 {
362 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
363 File file = new File( mojo.outputDirectory, fileName );
364 assertFalse( file.exists() );
365 }
366
367 mojo.excludeClassifiers = "";
368 mojo.execute();
369
370 artifacts = mojo.project.getArtifacts();
371 for ( Artifact artifact : artifacts )
372 {
373 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
374 File file = new File( mojo.outputDirectory, fileName );
375 assertEquals( artifact.getClassifier().equals( "one" ), file.exists() );
376 }
377
378 }
379
380 public void testSubPerType()
381 throws Exception
382 {
383 mojo.project.setArtifacts( stubFactory.getTypedArtifacts() );
384 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
385 mojo.useSubDirectoryPerType = true;
386 mojo.execute();
387
388 Set<Artifact> artifacts = mojo.project.getArtifacts();
389 for ( Artifact artifact : artifacts )
390 {
391 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
392 File folder = DependencyUtil.getFormattedOutputDirectory( false, true, false, false, false, mojo.outputDirectory,
393 artifact );
394 File file = new File( folder, fileName );
395 assertTrue( file.exists() );
396 }
397 }
398
399 public void testCDMClassifier()
400 throws Exception
401 {
402 dotestClassifierType( "jdk14", null );
403 }
404
405 public void testCDMType()
406 throws Exception
407 {
408 dotestClassifierType( null, "sources" );
409 }
410
411 public void testCDMClassifierType()
412 throws Exception
413 {
414 dotestClassifierType( "jdk14", "sources" );
415 }
416
417 public void dotestClassifierType( String testClassifier, String testType )
418 throws Exception
419 {
420 mojo.classifier = testClassifier;
421 mojo.type = testType;
422
423
424 mojo.setFactory( DependencyTestUtils.getArtifactFactory() );
425 mojo.setResolver( new StubArtifactResolver( stubFactory, false, false ) );
426 mojo.setLocal( new StubArtifactRepository( this.testDir.getAbsolutePath() ) );
427
428 mojo.execute();
429
430 Set<Artifact> artifacts = mojo.project.getArtifacts();
431 for ( Artifact artifact : artifacts )
432 {
433 String useClassifier = artifact.getClassifier();
434 String useType = artifact.getType();
435
436 if ( StringUtils.isNotEmpty( testClassifier ) )
437 {
438 useClassifier = "-" + testClassifier;
439
440 if ( StringUtils.isNotEmpty( testType ) )
441 {
442 useType = testType;
443 }
444 }
445 String fileName = artifact.getArtifactId() + "-" + artifact.getVersion() + useClassifier + "." + useType;
446 File file = new File( mojo.outputDirectory, fileName );
447
448 if ( !file.exists() )
449 {
450 fail( "Can't find:" + file.getAbsolutePath() );
451 }
452
453
454 assertNoMarkerFile( artifact );
455 }
456 }
457
458 public void testArtifactNotFound()
459 throws Exception
460 {
461 dotestArtifactExceptions( false, true );
462 }
463
464 public void testArtifactResolutionException()
465 throws Exception
466 {
467 dotestArtifactExceptions( true, false );
468 }
469
470 public void dotestArtifactExceptions( boolean are, boolean anfe )
471 throws Exception
472 {
473 mojo.classifier = "jdk";
474 mojo.type = "java-sources";
475
476
477 mojo.factory = DependencyTestUtils.getArtifactFactory();
478 mojo.resolver = new StubArtifactResolver( null, are, anfe );
479 mojo.setLocal( new StubArtifactRepository( this.testDir.getAbsolutePath() ) );
480
481 try
482 {
483 mojo.execute();
484 fail( "ExpectedException" );
485 }
486 catch ( MojoExecutionException e )
487 {
488
489 }
490 }
491
492
493
494
495
496
497
498
499
500 public void testDontOverWriteRelease()
501 throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
502 {
503
504 Set<Artifact> artifacts = new HashSet<Artifact>();
505 Artifact release = stubFactory.getReleaseArtifact();
506 release.getFile().setLastModified( System.currentTimeMillis() - 2000 );
507
508 artifacts.add( release );
509
510 mojo.project.setArtifacts( artifacts );
511 mojo.project.setDependencyArtifacts( artifacts );
512
513 mojo.overWriteIfNewer = false;
514
515 mojo.execute();
516
517 File copiedFile = new File( mojo.outputDirectory, DependencyUtil.getFormattedFileName( release, false ) );
518
519 Thread.sleep( 100 );
520
521 long time = System.currentTimeMillis() + 1000;
522 time = time - ( time % 1000 );
523 copiedFile.setLastModified( time );
524 Thread.sleep( 100 );
525
526 mojo.execute();
527
528 assertEquals( time, copiedFile.lastModified() );
529 }
530
531 public void testOverWriteRelease()
532 throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
533 {
534
535 Set<Artifact> artifacts = new HashSet<Artifact>();
536 Artifact release = stubFactory.getReleaseArtifact();
537 release.getFile().setLastModified( System.currentTimeMillis() - 2000 );
538
539 artifacts.add( release );
540
541 mojo.project.setArtifacts( artifacts );
542 mojo.project.setDependencyArtifacts( artifacts );
543
544 mojo.overWriteReleases = true;
545 mojo.overWriteIfNewer = false;
546
547 mojo.execute();
548
549 File copiedFile = new File( mojo.outputDirectory, DependencyUtil.getFormattedFileName( release, false ) );
550
551 Thread.sleep( 100 );
552
553 long time = System.currentTimeMillis();
554 time = time - ( time % 1000 );
555 copiedFile.setLastModified( time );
556
557
558 Thread.sleep( 1000 );
559
560 mojo.execute();
561
562 assertTrue( time < copiedFile.lastModified() );
563 }
564
565 public void testDontOverWriteSnap()
566 throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
567 {
568
569 Set<Artifact> artifacts = new HashSet<Artifact>();
570 Artifact snap = stubFactory.getSnapshotArtifact();
571 snap.getFile().setLastModified( System.currentTimeMillis() - 2000 );
572
573 artifacts.add( snap );
574
575 mojo.project.setArtifacts( artifacts );
576 mojo.project.setDependencyArtifacts( artifacts );
577
578 mojo.overWriteReleases = false;
579 mojo.overWriteSnapshots = false;
580 mojo.overWriteIfNewer = false;
581
582 mojo.execute();
583
584 File copiedFile = new File( mojo.outputDirectory, DependencyUtil.getFormattedFileName( snap, false ) );
585
586 Thread.sleep( 100 );
587
588 long time = System.currentTimeMillis() + 1000;
589 time = time - ( time % 1000 );
590 copiedFile.setLastModified( time );
591 Thread.sleep( 100 );
592
593 mojo.execute();
594
595 assertEquals( time, copiedFile.lastModified() );
596 }
597
598 public void testOverWriteSnap()
599 throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
600 {
601
602 Set<Artifact> artifacts = new HashSet<Artifact>();
603 Artifact snap = stubFactory.getSnapshotArtifact();
604 snap.getFile().setLastModified( System.currentTimeMillis() - 2000 );
605
606 artifacts.add( snap );
607
608 mojo.project.setArtifacts( artifacts );
609 mojo.project.setDependencyArtifacts( artifacts );
610
611 mojo.overWriteReleases = false;
612 mojo.overWriteSnapshots = true;
613 mojo.overWriteIfNewer = false;
614
615 mojo.execute();
616
617 File copiedFile = new File( mojo.outputDirectory, DependencyUtil.getFormattedFileName( snap, false ) );
618
619 Thread.sleep( 100 );
620
621 long time = System.currentTimeMillis();
622 time = time - ( time % 1000 );
623 copiedFile.setLastModified( time );
624
625
626 Thread.sleep( 1000 );
627
628 mojo.execute();
629
630 assertTrue( time < copiedFile.lastModified() );
631 }
632
633 public void testGetDependencies()
634 throws MojoExecutionException
635 {
636 assertEquals( mojo.getResolvedDependencies( true ).toString(), mojo.getDependencySets( true )
637 .getResolvedDependencies().toString() );
638 }
639
640 public void testExcludeProvidedScope()
641 throws Exception
642 {
643 mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
644 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
645 mojo.excludeScope = "provided";
646
647
648 mojo.execute();
649
650 Set<Artifact> artifacts = mojo.project.getArtifacts();
651 for ( Artifact artifact : artifacts )
652 {
653 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
654 File file = new File( mojo.outputDirectory, fileName );
655 assertEquals( artifact.getScope().equals( "provided" ), !file.exists() );
656 file.delete();
657 assertFalse( file.exists() );
658 }
659
660 }
661
662 public void testExcludeSystemScope()
663 throws Exception
664 {
665 mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
666 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
667 mojo.excludeScope = "system";
668
669
670 mojo.execute();
671
672 Set<Artifact> artifacts = mojo.project.getArtifacts();
673 for ( Artifact artifact : artifacts )
674 {
675 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
676 File file = new File( mojo.outputDirectory, fileName );
677 assertEquals( artifact.getScope().equals( "system" ), !file.exists() );
678 file.delete();
679 assertFalse( file.exists() );
680 }
681
682 }
683
684 public void testExcludeCompileScope()
685 throws Exception
686 {
687 mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
688 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
689 mojo.excludeScope = "compile";
690 mojo.execute();
691 ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.excludeScope );
692
693 Set<Artifact> artifacts = mojo.project.getArtifacts();
694 for ( Artifact artifact : artifacts )
695 {
696 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
697 File file = new File( mojo.outputDirectory, fileName );
698
699 assertEquals( !saf.include( artifact ), file.exists() );
700 }
701 }
702
703 public void testExcludeTestScope()
704 throws IOException, MojoFailureException
705 {
706 mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
707 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
708 mojo.excludeScope = "test";
709
710 try
711 {
712 mojo.execute();
713 fail( "expected an exception" );
714 }
715 catch ( MojoExecutionException e )
716 {
717
718 }
719
720 }
721
722 public void testExcludeRuntimeScope()
723 throws Exception
724 {
725 mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
726 mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
727 mojo.excludeScope = "runtime";
728 mojo.execute();
729 ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.excludeScope );
730
731 Set<Artifact> artifacts = mojo.project.getArtifacts();
732 for ( Artifact artifact : artifacts )
733 {
734 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
735 File file = new File( mojo.outputDirectory, fileName );
736
737 assertEquals( !saf.include( artifact ), file.exists() );
738 }
739 }
740
741 public void testCopyPom()
742 throws Exception
743 {
744 mojo.setCopyPom( true );
745 mojo.setResolver( new StubArtifactResolver( stubFactory, false, false ) );
746 mojo.setLocal( new StubArtifactRepository( this.testDir.getAbsolutePath() ) );
747
748 Set<Artifact> set = new HashSet<Artifact>();
749 set.add( stubFactory.createArtifact( "org.apache.maven", "maven-artifact", "2.0.7", Artifact.SCOPE_COMPILE ) );
750 mojo.project.setArtifacts( set );
751 mojo.execute();
752
753 Set<Artifact> artifacts = mojo.project.getArtifacts();
754 for ( Artifact artifact : artifacts )
755 {
756 String fileName = DependencyUtil.getFormattedFileName( artifact, false );
757 File file = new File( mojo.outputDirectory, fileName.substring( 0, fileName.length() - 4 ) + ".pom" );
758 assertTrue( file.exists() );
759 }
760 }
761
762 public void testPrependGroupId()
763 throws Exception
764 {
765 mojo.prependGroupId = true;
766 mojo.execute();
767
768 Set<Artifact> artifacts = mojo.project.getArtifacts();
769 for ( Artifact artifact : artifacts )
770 {
771 String fileName = DependencyUtil.getFormattedFileName( artifact, false, true );
772 File file = new File( mojo.outputDirectory, fileName );
773 assertTrue( file.exists() );
774 }
775 }
776 }