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

com.lotaris.maven.plugin.glassfish.macro.DeployMacro Maven / Gradle / Ivy

Go to download

Glassfish Asadmin maven plugin with full arguments supported through XML pom configuration.

There is a newer version: 1.2.2
Show newest version
package com.lotaris.maven.plugin.glassfish.macro;

import com.lotaris.maven.plugin.glassfish.model.Configuration;

import static com.lotaris.maven.plugin.glassfish.command.CommandFactory.*;

/**
 * Deploy application macro take care of the requirements (like domain created and started)
 * 
 * @author Laurent Prevost, [email protected]
 */
public class DeployMacro extends AbstractMacro {
	/**
	 * Constructor
	 * 
	 * @param configuration The configuration
	 */
	public DeployMacro(Configuration configuration) {
		super(configuration);

		// Take care of the domain operations if and only if the host is a local address
		if (isLocalDomain()) {
			// Check if the domain does not exist
			if (!configuration.getDomain().exists()) {
				registerCommand(new MacroMacroCommand(new CreateDomainMacro(configuration), "Creating domain."));
			}

			// Check if the domain is not started
			else if (!configuration.getDomain().isStarted()) {
				registerCommand(new MacroMacroCommand(new StartDomainMacro(configuration), "Starting domain."));
			}
		}
		
		registerCommand(new MacroCommand(buildDeployCommand(configuration), "Deploying application [" + configuration.getDeployConfiguration().getName() + "]."));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy