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.util.Collections;
22  import java.util.List;
23  
24  import org.apache.maven.artifact.DependencyResolutionRequiredException;
25  import org.apache.maven.model.Build;
26  import org.apache.maven.model.Organization;
27  import org.apache.maven.model.ReportPlugin;
28  import org.apache.maven.project.MavenProject;
29  
30  /**
31   *
32   */
33  public class MultiMavenProjectStub extends CheckstyleProjectStub {
34  
35      public MultiMavenProjectStub() {
36          setExecutionRoot(true);
37      }
38  
39      @Override
40      public MavenProject getExecutionProject() {
41          return this;
42      }
43  
44      /** {@inheritDoc} */
45      public List<String> getCompileClasspathElements() throws DependencyResolutionRequiredException {
46          return Collections.emptyList();
47      }
48  
49      /** {@inheritDoc} */
50      public List<String> getTestClasspathElements() throws DependencyResolutionRequiredException {
51          return Collections.emptyList();
52      }
53  
54      /** {@inheritDoc} */
55      public List<String> getCompileSourceRoots() {
56          return Collections.emptyList();
57      }
58  
59      /** {@inheritDoc} */
60      public List<String> getTestCompileSourceRoots() {
61          return Collections.emptyList();
62      }
63  
64      /** {@inheritDoc} */
65      public List<ReportPlugin> getReportPlugins() {
66          ReportPlugin jxrPlugin = new ReportPlugin();
67  
68          jxrPlugin.setArtifactId("maven-jxr-plugin");
69  
70          return Collections.singletonList(jxrPlugin);
71      }
72  
73      /** {@inheritDoc} */
74      public Organization getOrganization() {
75          Organization organization = new Organization();
76  
77          organization.setName("maven-plugin-tests");
78  
79          return organization;
80      }
81  
82      /** {@inheritDoc} */
83      public String getInceptionYear() {
84          return "2006";
85      }
86  
87      /** {@inheritDoc} */
88      public Build getBuild() {
89          Build build = new Build();
90  
91          build.setDirectory(getBasedir() + "/target/test-harness/checkstyle/multi");
92  
93          return build;
94      }
95  
96      @Override
97      protected String getPOM() {
98          return "multi-plugin-config.xml";
99      }
100 }