All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.mojo.weblogic.UnDeployMojo Maven / Gradle / Ivy

Go to download

This plugin will support various tasks within the Weblogic 8.1, 9.x, 10.x and 12.x environment. This version starts to support weblogic 10 and 11. The mojo supports such tasks as deploy, undeploy,clientgen,servicegen, and appc are supported as well as many others. The plugin uses exposed API's that are subject to change but have been tested in 8.1 SP 4-6 and 9.0 - 9.2 MP3, 10.x. There are two versions of the plugin to support the two environments based on differences in the JDK. The 9.x version is currently being refactored to support the standard JSR supported deployment interface. The code used in the plugin has been contributed to the Cargo project however to date has not be integrated into the codebase. Please feel free to suggest improvements or help support this plugin effort.

The newest version!
package org.codehaus.mojo.weblogic;

/*
 * Copyright 2006 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import org.apache.maven.plugin.MojoExecutionException;
import weblogic.Deployer;

/**
 * Undeploy artifacts from Weblogic server(s) or cluster(s).
 *
 * @author Scott Ryan
 * @version $Id: UnDeployMojo.java 17525 2012-09-16 13:39:50Z jonnio $
 * @description undeploy an artifact (war, ear, etc) to a target(s) which can be servers or clusters.
 * @goal undeploy
 */
public class UnDeployMojo extends DeployMojoBase {

    /**
     * This task will perform the un-deployment of the object to the proper server url.
     *
     * @throws MojoExecutionException Thrown if we fail to obtain a Weblogic deployment instance.
     */
    public void execute() throws MojoExecutionException {

        if (getLog().isInfoEnabled()) {
            getLog().info("Weblogic un-deployment beginning with parameters " + this.toString());
        }


        // get the basic parameters
        String[] parameters = this.getInputParameters("stop", null, null);

        try {

            // Deploy with the parameters
            Deployer deployer = new Deployer(parameters);
            deployer.run();
        } catch (Exception ex) {
            getLog().error("Exception encountered during artifact stop ", ex);
            throw new MojoExecutionException("Exception encountered during artifact stop", ex);
        }

        if (getLog().isInfoEnabled()) {
            getLog().info("Weblogic artifact stop successful ");
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy