Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2009 Andreas Andreou, Ibrahim Chaehoi 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.
 
 package net.jawr.maven;
 
 import java.io.File;
 import java.util.List;
 
 
 
The Jawr Mojo which will perform the bundle. The original author of this Mojo is Andreas Andreou.

Author(s):
Andreas Andreou
Ibrahim Chaehoi
Goal:
bundle
 
 public class JawrMojo extends AbstractMojo {

The path to the root of the web application where the resources are loaded from.

Parameter:
default-value="${project.build.directory}/${project.build.finalName}"
 
 	private String rootPath;

The path to the temporary directory for Jawr where the temporary resources are generated.

Parameter:
default-value="${project.build.directory}/jawr/temp"
 
 	private String tempDirPath;

The path to the destination directory where the files are stored at the end of the process.

Parameter:
default-value="${project.build.directory}/jawr/bundles"
 
 	private String destDirPath;

The list of comma separated servlet names to initialize.

Parameter:
default-value=""
 
The list of comma separated path to script config files to use.

Parameter:
default-value=""
 
The flag indicating if we should generate the CDN files or not

Parameter:
default-value="true"
 
 	private boolean generateCDNFiles;

The flag indicating if we want to keep the jawr URL mapping or if we rewrite it to remove resource hashcode.

Parameter:
default-value="false"
 
 	private boolean keepUrlMapping;


Sets the list of servlet to initialize

Parameters:
servletsToInitialize the servletsToInitialize to set
 
 	public void setServletsToInitialize(String servletsToInitialize) {
 		this. = servletsToInitialize;
 	}

Sets the list of spring config files to use

Parameters:
springConfigFiles the spring config files to set
	public void setSpringConfigFiles(String springConfigFiles) {
		this. = springConfigFiles;
	}

Parameters:
generateCDNFiles the generateCDNFiles to set
	public void setGenerateCDNFiles(boolean generateCDNFiles) {
		this. = generateCDNFiles;
	}

Sets the flag indicating if we keep or not the URL mapping

Parameters:
keepUrlMapping the keepUrlMapping to set
	public void setKeepUrlMapping(boolean keepUrlMapping) {
		this. = keepUrlMapping;
	}

Returns:
the rootPath
	public String getRootPath() {
		return ;
	}

Parameters:
rootPath the rootPath to set
	public void setRootPath(String rootPath) {
		this. = rootPath;
	}

Returns:
the tempDirPath
	public String getTempDirPath() {
		return ;
	}

Parameters:
tempDirPath the tempDirPath to set
	public void setTempDirPath(String tempDirPath) {
		this. = tempDirPath;
	}

Returns:
the destDirPath
	public String getDestDirPath() {
		return ;
	}

Parameters:
destDirPath the destDirPath to set
	public void setDestDirPath(String destDirPath) {
		this. = destDirPath;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.maven.plugin.AbstractMojo#execute()
	 */
		try {
catch (Exception ex) {
			Logger logger = Logger.getLogger(JawrMojo.class.getName());
			if(ex instanceof ServletException){
				logger.log(.null, ((ServletException)ex).getRootCause());
			}else{
				logger.log(.nullex);
			}
		}
	}

Create the bundles.

Throws:
java.lang.Exception if an exception occurs
	public void createBundles() throws Exception {
		File tempDir = new File();
		if(!tempDir.exists()){
			tempDir.mkdirs();
		}else{
			FileUtils.cleanDirectory(tempDir);
		}
		File destDir = new File();
		if(!destDir.exists()){
			destDir.mkdirs();
		}else{
			FileUtils.cleanDirectory(destDir);
		}
		List servlets = new ArrayList();
		if( != null){
			String[] servletNames = .split(",");
			for (int i = 0; i < servletNames.lengthi++) {
				servlets.add(servletNames[i].trim());
			}
		}
		BundleProcessor bundleProcessor = new BundleProcessor();
	}
New to GrepCode? Check out our FAQ X