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

com.kamomileware.maven.plugin.opencms.DeployModuleMojo Maven / Gradle / Ivy

The newest version!
package com.kamomileware.maven.plugin.opencms;

/*
 * Copyright 2001-2005 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 java.io.File;
import java.io.IOException;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

import com.kamomileware.maven.plugin.opencms.util.OpenCmsScriptUtils;

/**
 * Deploys a opencms-module project to a configure instance of OpenCms.
 * The module file is copied to ${opencms.home}/WEB-INF/packages/modules directory.
 * The installation is done via CmsShell by a generated script.
 *
 * @author jagarcia
 */
@Mojo(name="deploy", requiresProject=true )

public class DeployModuleMojo extends ModuleBaseMojo {

	@Override
	protected void prepareExecution() throws MojoExecutionException {
		// Copy the module to the install directory
		OpenCmsScriptUtils.copyFileToModulesDir(getOpenCmsWebInfDir(), moduleFile);
	}

	@Override
	protected File getScriptToExecute() throws IOException {
		return OpenCmsScriptUtils.buildInstallScript(moduleName, moduleFile, openCmsUserName, openCmsUserPass, false);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy