1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  package org.apache.maven.plugins.javadoc;
20  
21  import javax.inject.Inject;
22  
23  import java.util.Collections;
24  import java.util.LinkedList;
25  import java.util.List;
26  
27  import org.apache.maven.artifact.DependencyResolutionRequiredException;
28  import org.apache.maven.plugin.MojoExecutionException;
29  import org.apache.maven.plugin.MojoFailureException;
30  import org.apache.maven.plugins.annotations.Execute;
31  import org.apache.maven.plugins.annotations.LifecyclePhase;
32  import org.apache.maven.plugins.annotations.Mojo;
33  import org.apache.maven.plugins.annotations.ResolutionScope;
34  import org.apache.maven.project.MavenProject;
35  import org.codehaus.plexus.components.interactivity.InputHandler;
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 extends AbstractFixJavadocMojo {
47  
48      @Inject
49      public TestFixJavadocMojo(InputHandler inputHandler) {
50          super(inputHandler);
51      }
52  
53      
54      @Override
55      protected List<String> getProjectSourceRoots(MavenProject p) {
56          return (p.getTestCompileSourceRoots() == null
57                  ? Collections.<String>emptyList()
58                  : new LinkedList<>(p.getTestCompileSourceRoots()));
59      }
60  
61      
62      @Override
63      protected List<String> getCompileClasspathElements(MavenProject p) throws DependencyResolutionRequiredException {
64          return (p.getTestClasspathElements() == null
65                  ? Collections.<String>emptyList()
66                  : new LinkedList<>(p.getTestClasspathElements()));
67      }
68  
69      
70      @Override
71      protected String getArtifactType(MavenProject p) {
72          return "test-jar";
73      }
74  
75      
76      @Override
77      public void execute() throws MojoExecutionException, MojoFailureException {
78          
79          ignoreClirr = true;
80  
81          super.execute();
82      }
83  }