public WebAppConfig getWebAppConfig() { return (getEnunciate() != null && getEnunciate().getConfig() != null) ? getEnunciate().getConfig().getWebAppConfig() : null; }
/** * The war file to create. * * @return The war file to create. */ public File getWarFile() { WebAppConfig config = getWebAppConfig(); if (config != null && config.getWar() != null) { return getEnunciate().resolvePath(config.getWar()); } else { String filename = "enunciate.war"; if (getEnunciate().getConfig().getLabel() != null) { filename = getEnunciate().getConfig().getLabel() + ".war"; } return new File(getPackageDir(), filename); } }
@Override public File getBuildDir() { File buildDir = null; WebAppConfig webAppConfig = getWebAppConfig(); if (webAppConfig != null && webAppConfig.getDir() != null) { buildDir = getEnunciate().resolvePath(webAppConfig.getDir()); buildDir.mkdirs(); } return buildDir == null ? super.getBuildDir() : buildDir; } }
@Override protected void doPackage() throws EnunciateException, IOException { if (getWebAppConfig() == null || getWebAppConfig().isDoPackage()) { File buildDir = getBuildDir(); File warFile = getWarFile(); Enunciate enunciate = getEnunciate(); if (!enunciate.isUpToDate(buildDir, warFile)) { if (!warFile.getParentFile().exists()) { warFile.getParentFile().mkdirs(); } debug("Creating %s", warFile.getAbsolutePath()); enunciate.zip(warFile, buildDir); } else { info("Skipping war file creation as everything appears up-to-date..."); } enunciate.addArtifact(new FileArtifact(getName(), "war.file", warFile)); } else { debug("Packaging has been disabled. No packaging will be performed."); } }
Enunciate enunciate = getEnunciate(); File buildDir = getBuildDir(); File webinf = new File(buildDir, "WEB-INF");
/** * Copy the post base. */ protected void copyPostBase() throws IOException { Enunciate enunciate = getEnunciate(); File buildDir = getBuildDir(); //extract a post base if specified. WebAppConfig webAppConfig = getWebAppConfig(); if ((webAppConfig != null) && (webAppConfig.getPostBase() != null)) { File postBase = enunciate.resolvePath(webAppConfig.getPostBase()); if (postBase.isDirectory()) { debug("Copying postBase directory %s to %s...", postBase, buildDir); enunciate.copyDir(postBase, buildDir); } else { debug("Extracting postBase zip file %s to %s...", postBase, buildDir); enunciate.extractBase(new FileInputStream(postBase), buildDir); } } }
/** * Copy the pre base. */ protected void copyPreBase() throws IOException { Enunciate enunciate = getEnunciate(); File buildDir = getBuildDir(); WebAppConfig webAppConfig = getWebAppConfig(); if ((webAppConfig != null) && (webAppConfig.getPreBase() != null)) { File preBase = enunciate.resolvePath(webAppConfig.getPreBase()); if (preBase.isDirectory()) { debug("Copying preBase directory %s to %s...", preBase, buildDir); enunciate.copyDir(preBase, buildDir); } else { debug("Extracting preBase zip file %s to %s...", preBase, buildDir); enunciate.extractBase(new FileInputStream(preBase), buildDir); } } }
Enunciate enunciate = getEnunciate(); File buildDir = getBuildDir(); File webinf = new File(buildDir, "WEB-INF");
@Override protected void doCompile() throws EnunciateException, IOException { Enunciate enunciate = getEnunciate(); if (getWebAppConfig() != null && !getWebAppConfig().isDoCompile()) { debug("Compilation has been disabled. No server-side classes will be compiled, nor will any resources be copied.");
@Override protected void doBuild() throws IOException, EnunciateException { Enunciate enunciate = getEnunciate(); File buildDir = getBuildDir();