View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.plugins.checkstyle.stubs;
20  
21  import java.io.File;
22  import java.util.Collections;
23  import java.util.List;
24  
25  import org.apache.maven.artifact.DependencyResolutionRequiredException;
26  import org.apache.maven.model.Build;
27  import org.apache.maven.model.Organization;
28  import org.apache.maven.model.ReportPlugin;
29  import org.apache.maven.project.MavenProject;
30  
31  /**
32   *
33   */
34  public class MultiMavenProjectStub extends CheckstyleProjectStub {
35  
36      public MultiMavenProjectStub() {
37          setExecutionRoot(true);
38      }
39  
40      @Override
41      public MavenProject getExecutionProject() {
42          return this;
43      }
44  
45      /** {@inheritDoc} */
46      public List<String> getCompileClasspathElements() throws DependencyResolutionRequiredException {
47          return Collections.emptyList();
48      }
49  
50      /** {@inheritDoc} */
51      public List<String> getTestClasspathElements() throws DependencyResolutionRequiredException {
52          return Collections.emptyList();
53      }
54  
55      /** {@inheritDoc} */
56      public List<String> getCompileSourceRoots() {
57          return Collections.emptyList();
58      }
59  
60      /** {@inheritDoc} */
61      public List<String> getTestCompileSourceRoots() {
62          return Collections.emptyList();
63      }
64  
65      /** {@inheritDoc} */
66      public List<ReportPlugin> getReportPlugins() {
67          ReportPlugin jxrPlugin = new ReportPlugin();
68  
69          jxrPlugin.setArtifactId("maven-jxr-plugin");
70  
71          return Collections.singletonList(jxrPlugin);
72      }
73  
74      /** {@inheritDoc} */
75      public Organization getOrganization() {
76          Organization organization = new Organization();
77  
78          organization.setName("maven-plugin-tests");
79  
80          return organization;
81      }
82  
83      /** {@inheritDoc} */
84      public String getInceptionYear() {
85          return "2006";
86      }
87  
88      /** {@inheritDoc} */
89      public Build getBuild() {
90          Build build = new Build();
91  
92          build.setDirectory("target/test-harness/checkstyle/multi");
93  
94          return build;
95      }
96  
97      /** {@inheritDoc} */
98      public File getFile() {
99          File file = new File(getBasedir(), "pom.xml");
100 
101         return file;
102     }
103 }