View Javadoc

1   package org.apache.maven.plugins.modello;
2   
3   /* ====================================================================
4    *   Licensed to the Apache Software Foundation (ASF) under one or more
5    *   contributor license agreements.  See the NOTICE file distributed with
6    *   this work for additional information regarding copyright ownership.
7    *   The ASF licenses this file to You under the Apache License, Version 2.0
8    *   (the "License"); you may not use this file except in compliance with
9    *   the License.  You may obtain a copy of the License at
10   *
11   *       http://www.apache.org/licenses/LICENSE-2.0
12   *
13   *   Unless required by applicable law or agreed to in writing, software
14   *   distributed under the License is distributed on an "AS IS" BASIS,
15   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   *   See the License for the specific language governing permissions and
17   *   limitations under the License.
18   * ====================================================================
19   */
20  
21  import org.codehaus.modello.ModelloCli;
22  
23  /**
24   * @author <a href="mailto:brett@apache.org">Brett Porter</a>
25   * @version $Id: ArtifactDeployer.java,v 1.6 2004/09/06 04:26:10 felipeal Exp $
26   */
27  public class ModelloCliWrapper
28  {
29      private String model;
30  
31      private String packageWithVersion;
32  
33      private String version;
34  
35      private String type;
36  
37      private String targetDirectory;
38  
39      public void generate() throws Exception
40      {
41          ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
42          Thread.currentThread().setContextClassLoader( getClass().getClassLoader() );
43          String[] args = new String[] { this.model, this.type, this.targetDirectory, this.version, this.packageWithVersion };
44          ModelloCli.main( args );
45          Thread.currentThread().setContextClassLoader( oldClassLoader );
46      }
47  
48      public String getModel()
49      {
50          return this.model;
51      }
52  
53      public String getPackageWithVersion()
54      {
55          return this.packageWithVersion;
56      }
57  
58      public String getVersion()
59      {
60          return this.version;
61      }
62  
63      public String getType()
64      {
65          return this.type;
66      }
67  
68      public String getTargetDirectory()
69      {
70          return this.targetDirectory;
71      }
72  
73      public void setModel( String model )
74      {
75          this.model = model;
76      }
77  
78      public void setPackageWithVersion( String packageWithVersion )
79      {
80          this.packageWithVersion = packageWithVersion;
81      }
82  
83      public void setVersion( String version )
84      {
85          this.version = version;
86      }
87  
88      public void setType( String type )
89      {
90          this.type = type;
91      }
92  
93      public void setTargetDirectory( String targetDirectory )
94      {
95          this.targetDirectory = targetDirectory;
96      }
97  }