View Javadoc
1   package org.apache.maven.reporting.exec;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.ArrayList;
23  import java.util.Collections;
24  import java.util.List;
25  
26  import org.codehaus.plexus.configuration.PlexusConfiguration;
27  
28  /**
29   * Represents a reporting plugin and its execution configuration. It basically contains similar informations as a
30   * {@link org.apache.maven.model.ReportPlugin}, but in order to decouple reporting stuff from core,
31   * some values are copied.
32   * @see org.apache.maven.model.ReportPlugin
33   */
34  class ReportPlugin
35  {
36      private String groupId = "org.apache.maven.plugins";
37  
38      private String artifactId;
39  
40      private String version;
41  
42      private PlexusConfiguration configuration;
43  
44      private List<ReportSet> reportSets;
45      
46      private List<String> reports;
47  
48      public String getGroupId()
49      {
50          return this.groupId;
51      }
52  
53      public void setGroupId( String groupId )
54      {
55          this.groupId = groupId;
56      }
57  
58      public String getArtifactId()
59      {
60          return this.artifactId;
61      }
62  
63      public void setArtifactId( String artifactId )
64      {
65          this.artifactId = artifactId;
66      }
67  
68      public String getVersion()
69      {
70          return this.version;
71      }
72  
73      public void setVersion( String version )
74      {
75          this.version = version;
76      }
77  
78      public PlexusConfiguration getConfiguration()
79      {
80          return this.configuration;
81      }
82  
83      public void setConfiguration( PlexusConfiguration configuration )
84      {
85          this.configuration = configuration;
86      }
87  
88      public List<ReportSet> getReportSets()
89      {
90          if ( this.reportSets == null )
91          {
92              this.reportSets = new ArrayList<>();
93          }
94  
95          return this.reportSets;
96      }
97  
98      public void setReportSets( List<ReportSet> reportSets )
99      {
100         this.reportSets = reportSets;
101     }
102 
103     public List<String> getReports()
104     {
105         return reports == null ? Collections.<String>emptyList() : reports;
106     }
107 
108     public void setReports( List<String> reports )
109     {
110         this.reports = reports;
111     }
112 
113     @Override
114     public String toString()
115     {
116         return "ReportPlugin(" + artifactId + "){version='" + version + "', reports=" + reports
117             + ", reportSets=" + reportSets + "}";
118     }
119 }