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  /**
23   * Cancel the deployment of an artifact.
24   * <p/>
25   * Date: Apr 1, 2008
26   * Time: 10:04:51 PM
27   *
28   * @author <a href="mailto:josborn@belltracy.com>Jon Osborn</a>
29   * @version $Id: CancelMojo.java 6648 2008-04-02 02:14:50Z jonnio $
30   * @description issue the weblogic -cancel deployment task
31   */
32  public class CancelMojo
33      extends DeployMojoBase
34  {
35      /**
36       * This method will perform a -cancel operation
37       *
38       * @throws org.apache.maven.plugin.MojoExecutionException
39       *          Thrown if we fail to obtain a Weblogic deployment instance.
40       */
41      public void execute()
42          throws MojoExecutionException
43      {
44  
45          if ( getLog().isInfoEnabled() )
46          {
47              getLog().info( "Weblogic cancel beginning " );
48          }
49  
50          // get the basic parameters
51          String[] parameters = this.getInputParameters( "cancel" );
52          final boolean success = super.executeDeployer( parameters, "Exception encountered during artifact cancel" );
53  
54          if ( getLog().isInfoEnabled() )
55          {
56              if ( success )
57              {
58                  getLog().info( "Weblogic artifact cancel successful " );
59              }
60              else
61              {
62                  getLog().info( "Weblogic artifact cancel failed " );
63              }
64          }
65  
66      }
67  }