View Javadoc

1   package org.codehaus.mojo.weblogic;
2   
3   /*
4    * Copyright 2006 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * 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, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import org.apache.maven.plugin.MojoExecutionException;
20  
21  /**
22   * Deploy an artifact to Weblogic servers(s) or cluster(s).
23   *
24   * @author <a href="mailto:scott@theryansplace.com">Scott Ryan</a>
25   * @version $Id: DeployMojo.java 6645 2008-04-02 01:38:51Z jonnio $
26   * @description Deploy an artifact (war, ear, etc) to a target(s) which can be servers or clusters.
27   * @goal deploy
28   */
29  public class DeployMojo
30      extends DeployMojoBase
31  {
32  
33      /**
34       * This method will perform the deployment of artifact to the targets.
35       *
36       * @throws MojoExecutionException Thrown if we fail to obtain a Weblogic deployment instance.
37       */
38      public void execute()
39          throws MojoExecutionException
40      {
41  
42          if ( getLog().isInfoEnabled() )
43          {
44              getLog().info( "Weblogic Deployment beginning with parameters " + this.toString() );
45          }
46  
47          // get the basic parameters
48          final String[] parameters = this.getInputParameters( "deploy" );
49          final boolean success = super.executeDeployer( parameters, "Exception encountered during artifact start" );
50  
51          if ( getLog().isInfoEnabled() )
52          {
53              if ( success )
54              {
55                  getLog().info( "Weblogic artifact deploy successful " );
56              }
57              else
58              {
59                  getLog().info( "Weblogic artifact deploy failed " );
60              }
61          }
62  
63      }
64  
65  }