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

org.efaps.maven.plugin.install.SourceInstallMojo Maven / Gradle / Ivy

There is a newer version: 2.19.0-7.5.4.v20111024
Show newest version
/*
 * Copyright 2003 - 2009 The eFaps Team
 *
 * 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.
 *
 * Revision:        $Rev: 3365 $
 * Last Changed:    $Date: 2009-11-26 16:36:21 -0500 (Thu, 26 Nov 2009) $
 * Last Changed By: $Author: tim.moxter $
 */

package org.efaps.maven.plugin.install;

import java.util.List;

import org.apache.maven.plugin.MojoExecutionException;
import org.efaps.maven_java5.org.apache.maven.tools.plugin.Goal;
import org.efaps.update.version.Application;

/**
 * Installs an eFaps application.
 *
 * @author The eFaps Team
 * @version $Id: SourceInstallMojo.java 3365 2009-11-26 21:36:21Z tim.moxter $
 */
@Goal(name = "source-install",
      requiresDependencyResolutionScope = "compile")
public final class SourceInstallMojo
    extends AbstractEFapsInstallMojo
{
    /**
     * List of includes.
     */
    private final List includes = null;

    /**
     * List of excludes.
     */
    private final List excludes = null;

    /**
     * Executes the install goal.
     *
     * @throws MojoExecutionException if installation failed
     */
    public void execute()
        throws MojoExecutionException
    {
        this.init();

        try {
            final Application appl = Application.getApplicationFromSource(
                    this.getVersionFile(),
                    this.getClasspathElements(),
                    this.getEFapsDir(),
                    this.includes,
                    this.excludes,
                    this.getTypeMapping());

            // install applications
            if (appl != null) {
                appl.install(this.getUserName(), this.getPassWord());
            }
        } catch (final Exception e) {
            throw new MojoExecutionException("Could not execute SourceInstall script", e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy