org.efaps.maven.plugin.install.SourceInstallMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of efaps-maven-plugin Show documentation
Show all versions of efaps-maven-plugin Show documentation
eFaps Maven Plug-In to install / deploy eFaps applications and create CI/Jms Classes.
/*
* Copyright 2003 - 2012 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: 7663 $
* Last Changed: $Date: 2012-06-13 23:26:18 -0500 (Wed, 13 Jun 2012) $
* Last Changed By: $Author: [email protected] $
*/
package org.efaps.maven.plugin.install;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.maven.plugin.MojoExecutionException;
import org.efaps.update.Profile;
import org.efaps.update.version.Application;
import org.jfrog.maven.annomojo.annotations.MojoGoal;
import org.jfrog.maven.annomojo.annotations.MojoRequiresDependencyResolution;
/**
* Installs an eFaps application.
*
* @author The eFaps Team
* @version $Id: SourceInstallMojo.java 7663 2012-06-14 04:26:18Z [email protected] $
*/
@MojoGoal(value = "source-install")
@MojoRequiresDependencyResolution
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
{
init(true);
try {
final Application appl = Application.getApplicationFromSource(
getVersionFile(),
getClasspathElements(),
getEFapsDir(),
getOutputDirectory(),
this.includes,
this.excludes,
getTypeMapping());
final Set profiles = new HashSet();
if (getProfile() != null) {
profiles.add(Profile.getProfile(getProfile()));
} else {
profiles.add(Profile.getDefaultProfile());
}
// install applications
if (appl != null) {
appl.install(getUserName(), getPassWord(), profiles);
}
} catch (final Exception e) {
throw new MojoExecutionException("Could not execute SourceInstall script", e);
}
}
}