View Javadoc

1   /*
2    * Copyright 2006-2012 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.maven.plugin.buildmetadata.data;
17  
18  import java.util.List;
19  
20  import de.smartics.maven.plugin.buildmetadata.common.Property;
21  
22  /**
23   * Defines the Maven information to be included in the build meta data.
24   *
25   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
26   * @version $Revision:591 $
27   */
28  public final class MavenMetaDataSelection
29  {
30    // ********************************* Fields *********************************
31  
32    // --- constants ------------------------------------------------------------
33  
34    // --- members --------------------------------------------------------------
35  
36    /**
37     * Add environment variables if set to <code>true</code>, skip it, if set to
38     * <code>false</code>. If you are not interested in the environment variables
39     * of the host (e.g. for security reasons, set this to <code>false</code>).
40     */
41    private boolean addEnvInfo;
42  
43    /**
44     * Add information about the Java runtime running the build if set to
45     * <code>true</code>, skip it, if set to <code>false</code>.
46     */
47    private boolean addJavaRuntimeInfo;
48  
49    /**
50     * Add information about the operating system the build is run in if set to
51     * <code>true</code>, skip it, if set to <code>false</code>.
52     */
53    private boolean addOsInfo;
54  
55    /**
56     * Add Maven execution information (commandline, goals, profiles, etc.) if set
57     * to <code>true</code>, skip it, if set to <code>false</code>. If you are not
58     * interested in execution information, set this to <code>false</code>.
59     */
60    private boolean addMavenExecutionInfo;
61  
62    /**
63     * Add project information (homepage URL, categories, tags, etc.) if set to
64     * <code>true</code>, skip it, if set to <code>false</code>. If you are not
65     * interested in execution information, set this to <code>false</code>.
66     */
67    private boolean addProjectInfo;
68  
69    /**
70     * While the command line may be useful to refer to for a couple of reasons,
71     * displaying it with the build properties is a security issue. Some plugins
72     * allow to read passwords as properties from the command line and this
73     * sensible data will be shown.
74     */
75    private boolean hideCommandLineInfo;
76  
77    /**
78     * While the MAVEN_OPTS may be useful to refer to for a couple of reasons,
79     * displaying them with the build properties is a security issue. Some plugins
80     * allow to read passwords as properties from the command line and this
81     * sensible data will be shown.
82     */
83    private boolean hideMavenOptsInfo;
84  
85    /**
86     * While the JAVA_OPTS may be useful to refer to for a couple of reasons,
87     * displaying them with the build properties is a security issue. Some plugins
88     * allow to read passwords as properties from the command line and this
89     * sensible data will be shown.
90     * <p>
91     * Therefore the JAVA_OPTS are hidden by default (<code>true</code>). To
92     * include this information, use a value of <code>false</code>.
93     * </p>
94     */
95    private boolean hideJavaOptsInfo;
96  
97    /**
98     * The list of a system properties or environment variables to be selected by
99     * the user to include into the build meta data properties.
100    * <p>
101    * The name is the name of the property, the section is relevant for placing
102    * the property in one of the following sections:
103    * </p>
104    * <ul>
105    * <li><code>build.scm</code></li>
106    * <li><code>build.dateAndVersion</code></li>
107    * <li><code>build.runtime</code></li>
108    * <li><code>build.java</code></li>
109    * <li><code>build.maven</code></li>
110    * <li><code>build.misc</code></li>
111    * </ul>
112    * <p>
113    * If no valid section is given, the property is silently rendered in the
114    * <code>build.misc</code> section.
115    * </p>
116    */
117   private List<Property> selectedSystemProperties;
118 
119   // ****************************** Initializer *******************************
120 
121   // ****************************** Constructors ******************************
122 
123   // ****************************** Inner Classes *****************************
124 
125   // ********************************* Methods ********************************
126 
127   // --- init -----------------------------------------------------------------
128 
129   // --- get&set --------------------------------------------------------------
130 
131   /**
132    * Returns the value for addMavenExecutionInfo.
133    * <p>
134    * Add Maven execution information (commandline, goals, profiles, etc. ) if
135    * set to <code>true</code>, skip it, if set to <code>false</code>. If you are
136    * not interested in execution information, set this to <code>false</code>.
137    *
138    * @return the value for addMavenExecutionInfo.
139    */
140   public boolean isAddMavenExecutionInfo()
141   {
142     return addMavenExecutionInfo;
143   }
144 
145   /**
146    * Sets the value for addMavenExecutionInfo.
147    * <p>
148    * Add Maven execution information (commandline, goals, profiles, etc. ) if
149    * set to <code>true</code>, skip it, if set to <code>false</code>. If you are
150    * not interested in execution information, set this to <code>false</code>.
151    *
152    * @param addMavenExecutionInfo the value for addMavenExecutionInfo.
153    */
154   public void setAddMavenExecutionInfo(final boolean addMavenExecutionInfo)
155   {
156     this.addMavenExecutionInfo = addMavenExecutionInfo;
157   }
158 
159   /**
160    * Returns the value for hideCommandLineInfo.
161    * <p>
162    * While the command line may be useful to refer to for a couple of reasons,
163    * displaying it with the build properties is a security issue. Some plugins
164    * allow to read passwords as properties from the command line and this
165    * sensible data will be shown.
166    *
167    * @return the value for hideCommandLineInfo.
168    */
169   public boolean isHideCommandLineInfo()
170   {
171     return hideCommandLineInfo;
172   }
173 
174   /**
175    * Sets the value for hideCommandLineInfo.
176    * <p>
177    * While the command line may be useful to refer to for a couple of reasons,
178    * displaying it with the build properties is a security issue. Some plugins
179    * allow to read passwords as properties from the command line and this
180    * sensible data will be shown.
181    *
182    * @param hideCommandLineInfo the value for hideCommandLineInfo.
183    */
184   public void setHideCommandLineInfo(final boolean hideCommandLineInfo)
185   {
186     this.hideCommandLineInfo = hideCommandLineInfo;
187   }
188 
189   /**
190    * Returns the value for hideMavenOptsInfo.
191    * <p>
192    * While the MAVEN_OPTS may be useful to refer to for a couple of reasons,
193    * displaying them with the build properties is a security issue. Some plugins
194    * allow to read passwords as properties from the command line and this
195    * sensible data will be shown.
196    *
197    * @return the value for hideMavenOptsInfo.
198    */
199   public boolean isHideMavenOptsInfo()
200   {
201     return hideMavenOptsInfo;
202   }
203 
204   /**
205    * Sets the value for hideMavenOptsInfo.
206    * <p>
207    * While the MAVEN_OPTS may be useful to refer to for a couple of reasons,
208    * displaying them with the build properties is a security issue. Some plugins
209    * allow to read passwords as properties from the command line and this
210    * sensible data will be shown.
211    *
212    * @param hideMavenOptsInfo the value for hideMavenOptsInfo.
213    */
214   public void setHideMavenOptsInfo(final boolean hideMavenOptsInfo)
215   {
216     this.hideMavenOptsInfo = hideMavenOptsInfo;
217   }
218 
219   /**
220    * Returns the value for hideJavaOptsInfo.
221    * <p>
222    * While the JAVA_OPTS may be useful to refer to for a couple of reasons,
223    * displaying them with the build properties is a security issue. Some plugins
224    * allow to read passwords as properties from the command line and this
225    * sensible data will be shown.
226    * <p>
227    * Therefore the JAVA_OPTS are hidden by default (<code>true</code>). To
228    * include this information, use a value of <code>false</code>.
229    * </p>
230    *
231    * @return the value for hideJavaOptsInfo.
232    */
233   public boolean isHideJavaOptsInfo()
234   {
235     return hideJavaOptsInfo;
236   }
237 
238   /**
239    * Sets the value for hideJavaOptsInfo.
240    * <p>
241    * While the JAVA_OPTS may be useful to refer to for a couple of reasons,
242    * displaying them with the build properties is a security issue. Some plugins
243    * allow to read passwords as properties from the command line and this
244    * sensible data will be shown.
245    * <p>
246    * Therefore the JAVA_OPTS are hidden by default (<code>true</code>). To
247    * include this information, use a value of <code>false</code>.
248    * </p>
249    *
250    * @param hideJavaOptsInfo the value for hideJavaOptsInfo.
251    */
252   public void setHideJavaOptsInfo(final boolean hideJavaOptsInfo)
253   {
254     this.hideJavaOptsInfo = hideJavaOptsInfo;
255   }
256 
257   /**
258    * Sets the value for addEnvInfo.
259    * <p>
260    * Add environment variables if set to <code>true</code>, skip it, if set to
261    * <code>false</code>. If you are not interested in the environment variables
262    * of the host (e.g. for security reasons, set this to <code>false</code>).
263    *
264    * @param addEnvInfo the value for addEnvInfo.
265    */
266   public void setAddEnvInfo(final boolean addEnvInfo)
267   {
268     this.addEnvInfo = addEnvInfo;
269   }
270 
271   /**
272    * Returns the value for addEnvInfo.
273    * <p>
274    * Add environment variables if set to <code>true</code>, skip it, if set to
275    * <code>false</code>. If you are not interested in the environment variables
276    * of the host (e.g. for security reasons, set this to <code>false</code>).
277    *
278    * @return the value for addEnvInfo.
279    */
280   public boolean isAddEnvInfo()
281   {
282     return addEnvInfo;
283   }
284 
285   /**
286    * Returns the value for addJavaRuntimeInfo.
287    * <p>
288    * Add information about the Java runtime running the build if set to
289    * <code>true</code>, skip it, if set to <code>false</code>.
290    *
291    * @return the value for addJavaRuntimeInfo.
292    */
293   public boolean isAddJavaRuntimeInfo()
294   {
295     return addJavaRuntimeInfo;
296   }
297 
298   /**
299    * Sets the value for addJavaRuntimeInfo.
300    * <p>
301    * Add information about the Java runtime running the build if set to
302    * <code>true</code>, skip it, if set to <code>false</code>.
303    *
304    * @param addJavaRuntimeInfo the value for addJavaRuntimeInfo.
305    */
306   public void setAddJavaRuntimeInfo(final boolean addJavaRuntimeInfo)
307   {
308     this.addJavaRuntimeInfo = addJavaRuntimeInfo;
309   }
310 
311   /**
312    * Sets the value for addProjectInfo.
313    * <p>
314    * Add project information (homepage URL, categories, tags, etc.) if set to
315    * <code>true</code>, skip it, if set to <code>false</code>. If you are not
316    * interested in execution information, set this to <code>false</code>.
317    *
318    * @param addProjectInfo the value for addProjectInfo.
319    */
320   public void setAddProjectInfo(final boolean addProjectInfo)
321   {
322     this.addProjectInfo = addProjectInfo;
323   }
324 
325   /**
326    * Returns the value for addProjectInfo.
327    * <p>
328    * Add project information (homepage URL, categories, tags, etc.) if set to
329    * <code>true</code>, skip it, if set to <code>false</code>. If you are not
330    * interested in execution information, set this to <code>false</code>.
331    *
332    * @return the value for addProjectInfo.
333    */
334   public boolean isAddProjectInfo()
335   {
336     return addProjectInfo;
337   }
338 
339   /**
340    * Returns the value for addOsInfo.
341    * <p>
342    * Add information about the operating system the build is run in if set to
343    * <code>true</code>, skip it, if set to <code>false</code>.
344    *
345    * @return the value for addOsInfo.
346    */
347   public boolean isAddOsInfo()
348   {
349     return addOsInfo;
350   }
351 
352   /**
353    * Sets the value for addOsInfo.
354    * <p>
355    * Add information about the operating system the build is run in if set to
356    * <code>true</code>, skip it, if set to <code>false</code>.
357    *
358    * @param addOsInfo the value for addOsInfo.
359    */
360   public void setAddOsInfo(final boolean addOsInfo)
361   {
362     this.addOsInfo = addOsInfo;
363   }
364 
365   /**
366    * Returns the list of a system properties or environment variables to be
367    * selected by the user to include into the build meta data properties.
368    * <p>
369    * The name is the name of the property, the section is relevant for placing
370    * the property in one of the following sections:
371    * </p>
372    * <ul>
373    * <li><code>build.scm</code></li>
374    * <li><code>build.dateAndVersion</code></li>
375    * <li><code>build.runtime</code></li>
376    * <li><code>build.java</code></li>
377    * <li><code>build.maven</code></li>
378    * <li><code>build.misc</code></li>
379    * </ul>
380    * <p>
381    * If no valid section is given, the property is silently rendered in the
382    * <code>build.misc</code> section.
383    * </p>
384    *
385    * @return the list of a system properties to be selected by the user to
386    *         include into the build meta data properties.
387    */
388   public List<Property> getSelectedSystemProperties()
389   {
390     return selectedSystemProperties;
391   }
392 
393   /**
394    * Sets the list of a system properties or environment variables to be
395    * selected by the user to include into the build meta data properties.
396    * <p>
397    * The name is the name of the property, the section is relevant for placing
398    * the property in one of the following sections:
399    * </p>
400    * <ul>
401    * <li><code>build.scm</code></li>
402    * <li><code>build.dateAndVersion</code></li>
403    * <li><code>build.runtime</code></li>
404    * <li><code>build.java</code></li>
405    * <li><code>build.maven</code></li>
406    * <li><code>build.misc</code></li>
407    * </ul>
408    * <p>
409    * If no valid section is given, the property is silently rendered in the
410    * <code>build.misc</code> section.
411    * </p>
412    *
413    * @param selectedSystemProperties the list of a system properties to be
414    *          selected by the user to include into the build meta data
415    *          properties.
416    */
417   public void setSelectedSystemProperties(
418       final List<Property> selectedSystemProperties)
419   {
420     this.selectedSystemProperties = selectedSystemProperties;
421   }
422 
423   // --- business -------------------------------------------------------------
424 
425   // --- object basics --------------------------------------------------------
426 
427 }