com.googlecode.t7mp.TomeePreconditions Maven / Gradle / Ivy
The newest version!
package com.googlecode.t7mp;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
/**
*
*
* @author jbellmann
*
*/
public final class TomeePreconditions {
private TomeePreconditions() {
//hide constructor
}
public static void checkConfiguredTomeeVersion(Log log, String version) throws MojoExecutionException {
if (!version.startsWith("1.")) {
log.info("");
log.info("");
log.error("======================= MAVEN-TOMEE-PLUGIN ==================");
log.error("This plugin supports only Version 1.x.x of TomEE. You configured: " + version
+ ". Cancel the Build.");
log.error("===========================================================");
log.info("");
log.info("");
throw new MojoExecutionException("This plugin supports only Version 1.x.x of TomEE. You configured "
+ version);
}
}
public static void checkDistribution(Log log, String distribution) throws MojoExecutionException {
if (!(distribution.equals("webprofile") || distribution.equals("plus"))) {
log.info("");
log.info("");
log.error("======================= MAVEN-TOMEE-PLUGIN ==================");
log.error("This plugin supports only Distribution 'webprofile' or 'plus' of TomEE. You configured: "
+ distribution + ". Cancel the Build.");
log.error("===========================================================");
log.info("");
log.info("");
throw new MojoExecutionException(
"This plugin supports only Distribution 'webprofile' or 'plus' of TomEE. You configured "
+ distribution);
}
}
}