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.reporting.exec;
20  
21  import java.util.ArrayList;
22  import java.util.Collections;
23  import java.util.List;
24  
25  import org.codehaus.plexus.configuration.PlexusConfiguration;
26  
27  /**
28   * Represents a reporting plugin and its execution configuration. It basically contains similar informations as a
29   * {@link org.apache.maven.model.ReportPlugin}, but in order to decouple reporting stuff from core,
30   * some values are copied.
31   * @see org.apache.maven.model.ReportPlugin
32   */
33  class ReportPlugin {
34      private String groupId = "org.apache.maven.plugins";
35  
36      private String artifactId;
37  
38      private String version;
39  
40      private PlexusConfiguration configuration;
41  
42      private List<ReportSet> reportSets;
43  
44      private List<String> reports;
45  
46      public String getGroupId() {
47          return this.groupId;
48      }
49  
50      public void setGroupId(String groupId) {
51          this.groupId = groupId;
52      }
53  
54      public String getArtifactId() {
55          return this.artifactId;
56      }
57  
58      public void setArtifactId(String artifactId) {
59          this.artifactId = artifactId;
60      }
61  
62      public String getVersion() {
63          return this.version;
64      }
65  
66      public void setVersion(String version) {
67          this.version = version;
68      }
69  
70      public PlexusConfiguration getConfiguration() {
71          return this.configuration;
72      }
73  
74      public void setConfiguration(PlexusConfiguration configuration) {
75          this.configuration = configuration;
76      }
77  
78      public List<ReportSet> getReportSets() {
79          if (this.reportSets == null) {
80              this.reportSets = new ArrayList<>();
81          }
82  
83          return this.reportSets;
84      }
85  
86      public void setReportSets(List<ReportSet> reportSets) {
87          this.reportSets = reportSets;
88      }
89  
90      public List<String> getReports() {
91          return reports == null ? Collections.<String>emptyList() : reports;
92      }
93  
94      public void setReports(List<String> reports) {
95          this.reports = reports;
96      }
97  
98      @Override
99      public String toString() {
100         return "ReportPlugin(" + artifactId + "){version='" + version + "', reports=" + reports + ", reportSets="
101                 + reportSets + "}";
102     }
103 }