1 package org.codehaus.mojo.appassembler;
2
3 /*
4 * The MIT License
5 *
6 * Copyright (c) 2006-2012, The Codehaus
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy of
9 * this software and associated documentation files (the "Software"), to deal in
10 * the Software without restriction, including without limitation the rights to
11 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12 * of the Software, and to permit persons to whom the Software is furnished to do
13 * so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in all
16 * copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * SOFTWARE.
25 */
26
27 import java.io.File;
28 import java.util.List;
29 import java.util.Set;
30
31 import org.apache.maven.plugins.annotations.Parameter;
32
33 /**
34 * @author <a href="mailto:kristian.nordal@gmail.com">Kristian Nordal</a>
35 * @version $Id$
36 * @deprecated Use generate-daemons instead
37 */
38 public class Program
39 {
40 private String name;
41
42 private String id;
43
44 private String mainClass;
45
46 /**
47 * Extra arguments which will be given the Main Class as arguments verbatim.
48 */
49 @Parameter
50 private List<String> commandLineArguments;
51
52 /**
53 * The License header which can be used instead of the default header.
54 *
55 * @since 1.2
56 */
57 @Parameter
58 private File licenseHeaderFile;
59
60 /**
61 * Define the name of binary folder.
62 *
63 * @since 1.2
64 */
65 @Parameter( defaultValue = "bin" )
66 private File binFolder;
67
68 /**
69 * JvmSettings for every program.
70 *
71 * @since 1.2
72 */
73 @Parameter
74 private org.codehaus.mojo.appassembler.model.JvmSettings jvmSettings;
75
76 /**
77 * The platforms the plugin will generate bin files for. Configure with string values - "all"(default/empty) |
78 * "windows" | "unix".
79 */
80 @Parameter
81 private Set<String> platforms;
82
83 /**
84 * The default constructor.
85 */
86 public Program()
87 {
88 }
89
90 /**
91 * The constructor.
92 *
93 * @param name The name of the program.
94 * @param mainClass The main class of the program.
95 */
96 public Program( String name, String mainClass )
97 {
98 this.name = name;
99 this.mainClass = mainClass;
100 }
101
102 /**
103 * The name.
104 *
105 * @return The name of the program.
106 * @deprecated Please use @{link {@link #getId()} instead.
107 */
108 public String getName()
109 {
110 return name;
111 }
112
113 /**
114 * The id.
115 *
116 * @return The id of the program.
117 */
118 public String getId()
119 {
120 return id;
121 }
122
123 /**
124 * Set the name.
125 *
126 * @param name The name of the program.
127 * @deprecated Use {@link #setId(String)} instead.
128 */
129 public void setName( String name )
130 {
131 this.name = name;
132 }
133
134 /**
135 * Set the id.
136 *
137 * @param id
138 */
139 public void setId( String id )
140 {
141 this.id = id;
142 }
143
144 /**
145 * Get the main class.
146 *
147 * @return The name of the main class.
148 */
149 public String getMainClass()
150 {
151 return mainClass;
152 }
153
154 /**
155 * Set the main class.
156 *
157 * @param mainClass The name of the main class.
158 */
159 public void setMainClass( String mainClass )
160 {
161 this.mainClass = mainClass;
162 }
163
164 /**
165 * The platforms.
166 *
167 * @return The set of platforms.
168 */
169 public Set<String> getPlatforms()
170 {
171 return platforms;
172 }
173
174 /**
175 * The platforms.
176 *
177 * @param platforms The set with the platforms.
178 */
179 public void setPlatforms( Set<String> platforms )
180 {
181 this.platforms = platforms;
182 }
183
184 /**
185 * Get the command line arguments.
186 *
187 * @return The list of command line arguments.
188 */
189 public List<String> getCommandLineArguments()
190 {
191 return this.commandLineArguments;
192 }
193
194 /**
195 * Set the argument list.
196 *
197 * @param arguments The list of command line arguments.
198 */
199 public void setCommandLineArguments( List<String> arguments )
200 {
201 this.commandLineArguments = arguments;
202 }
203
204 /**
205 * Add an command line arguments.
206 *
207 * @param argument The argument which will be aded to list of arguments.
208 */
209 public void addCommandLineArgument( String argument )
210 {
211 this.commandLineArguments.add( argument );
212 }
213
214 /**
215 * Get the JVM settings.
216 *
217 * @return An instance of the JVM settings.
218 * @see JvmSettings
219 */
220 public org.codehaus.mojo.appassembler.model.JvmSettings getJvmSettings()
221 {
222 return jvmSettings;
223 }
224
225 /**
226 * Set the JVM settings.
227 *
228 * @param jvmSettings The instance of the JVM settings which will be used.
229 */
230 public void setJvmSettings( org.codehaus.mojo.appassembler.model.JvmSettings jvmSettings )
231 {
232 this.jvmSettings = jvmSettings;
233 }
234
235 /**
236 * Get the current license header file which is used.
237 *
238 * @return The file instance of the header file.
239 */
240 public File getLicenseHeaderFile()
241 {
242 return licenseHeaderFile;
243 }
244
245 /**
246 * Set the license header file.
247 *
248 * @param licenseHeaderFile The File instance.
249 */
250 public void setLicenseHeaderFile( File licenseHeaderFile )
251 {
252 this.licenseHeaderFile = licenseHeaderFile;
253 }
254
255 /**
256 * The bin folder.
257 *
258 * @return The bin folder.
259 */
260 public File getBinFolder()
261 {
262 return binFolder;
263 }
264
265 /**
266 * Set the bin folder.
267 *
268 * @param binFolder The new bin folder name.
269 */
270 public void setBinFolder( File binFolder )
271 {
272 this.binFolder = binFolder;
273 }
274
275 }