com.lotaris.maven.plugin.glassfish.macro.RedeployMacro Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lotaris-glassfish-maven-plugin Show documentation
Show all versions of lotaris-glassfish-maven-plugin Show documentation
Glassfish Asadmin maven plugin with full arguments supported through XML pom configuration.
package com.lotaris.maven.plugin.glassfish.macro;
import com.lotaris.maven.plugin.glassfish.model.Configuration;
import static com.lotaris.maven.plugin.glassfish.command.CommandFactory.*;
/**
* Redeploy application macro take care of the requirements (like domain created and started)
*
* @author Laurent Prevost, [email protected]
*/
public class RedeployMacro extends AbstractMacro {
/**
* Constructor
*
* @param configuration The configuration
*/
public RedeployMacro(Configuration configuration) {
super(configuration);
// Check if the domain does not exist
if (!configuration.getDomain().exists()) {
if (isLocalDomain()) {
registerCommand(new MacroMacroCommand(new CreateDomainMacro(configuration), "Creating domain."));
}
configuration.setDeployConfiguration(configuration.getRedeployConfiguration().getDeployConfiguration());
registerCommand(new MacroCommand(buildDeployCommand(configuration), "Deploy application [" + configuration.getRedeployConfiguration().getName() + "]."));
}
else {
// Check if the domain is not started
if (isLocalDomain() && !configuration.getDomain().isStarted()) {
registerCommand(new MacroMacroCommand(new StartDomainMacro(configuration), "Starting domain."));
}
registerCommand(new MacroCommand(buildRedeployCommand(configuration), "Redeploying application [" + configuration.getRedeployConfiguration().getName() + "]."));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy