1 package org.apache.maven.plugins.javadoc;
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.artifact.DependencyResolutionRequiredException;
23 import org.apache.maven.plugin.MojoExecutionException;
24 import org.apache.maven.plugin.MojoFailureException;
25 import org.apache.maven.plugins.annotations.Execute;
26 import org.apache.maven.plugins.annotations.LifecyclePhase;
27 import org.apache.maven.plugins.annotations.Mojo;
28 import org.apache.maven.plugins.annotations.ResolutionScope;
29 import org.apache.maven.project.MavenProject;
30
31 import java.util.Collections;
32 import java.util.LinkedList;
33 import java.util.List;
34
35
36
37
38
39
40
41
42
43 @Mojo( name = "test-fix", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )
44 @Execute( phase = LifecyclePhase.TEST_COMPILE )
45 public class TestFixJavadocMojo
46 extends AbstractFixJavadocMojo
47 {
48
49 @Override
50 protected List<String> getProjectSourceRoots( MavenProject p )
51 {
52 return ( p.getTestCompileSourceRoots() == null ? Collections.<String>emptyList()
53 : new LinkedList<>( p.getTestCompileSourceRoots() ) );
54 }
55
56
57 @Override
58 protected List<String> getCompileClasspathElements( MavenProject p )
59 throws DependencyResolutionRequiredException
60 {
61 return ( p.getTestClasspathElements() == null ? Collections.<String>emptyList()
62 : new LinkedList<>( p.getTestClasspathElements() ) );
63 }
64
65
66 @Override
67 protected String getArtifactType( MavenProject p )
68 {
69 return "test-jar";
70 }
71
72
73 @Override
74 public void execute()
75 throws MojoExecutionException, MojoFailureException
76 {
77
78 ignoreClirr = true;
79
80 super.execute();
81 }
82 }