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
44 @Mojo( name = "test-fix", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )
45 @Execute( phase = LifecyclePhase.TEST_COMPILE )
46 public class TestFixJavadocMojo
47 extends AbstractFixJavadocMojo
48 {
49
50 @Override
51 protected List<String> getProjectSourceRoots( MavenProject p )
52 {
53 return ( p.getTestCompileSourceRoots() == null ? Collections.<String>emptyList()
54 : new LinkedList<>( p.getTestCompileSourceRoots() ) );
55 }
56
57
58 @Override
59 protected List<String> getCompileClasspathElements( MavenProject p )
60 throws DependencyResolutionRequiredException
61 {
62 return ( p.getTestClasspathElements() == null ? Collections.<String>emptyList()
63 : new LinkedList<>( p.getTestClasspathElements() ) );
64 }
65
66
67 @Override
68 protected String getArtifactType( MavenProject p )
69 {
70 return "test-jar";
71 }
72
73
74 @Override
75 public void execute()
76 throws MojoExecutionException, MojoFailureException
77 {
78
79 ignoreClirr = true;
80
81 super.execute();
82 }
83 }