/*
 * Copyright (c) 2011, David Beale
 *
 * 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 com.bealearts.livecycleplugin;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.codehaus.plexus.archiver.zip.ZipArchiver;

import java.io.File;


/**
 * Mojo to Generate the LiveCycle Archive file
 * 
 * @goal archive
 * @phase compile
 */
public class ArchiveMojo extends AbstractMojo
{
	
	
	/**
	 * Location of the build directory
	 * 
	 * @parameter expression="${project.build.directory}"
	 * @required
	 */
	private File buildDirectory;
	
	
	
	/**
	 * Name of the archive
	 * 
	 * @parameter expression="${project.build.finalName}"
	 * @required
	 */
	private String finalName;
	
	
	/**
	* The Zip archiver.
	* @component role="org.codehaus.plexus.archiver.Archiver" roleHint="zip"
	*/
	private ZipArchiver zipArchiver;

	
	/**
	 * Execute the Mojo
	 */
	public void execute() throws MojoExecutionException
	{
		try
		{
			this.zipArchiver.addDirectory(new File(this.buildDirectory, "classes"));
			this.zipArchiver.setDestFile(new File(this.buildDirectory, this.finalName + ".lca"));
			this.zipArchiver.createArchive();
		}
		catch (Exception e)
		{
			throw new MojoExecutionException("Error creating archive", e);
		}
	}
	
	
	
	/* PRIVATE */
	

}

@@ -1487,24 +1487,73 @@
 %7B%0A%09%09try%0A%09%09%7B%0A
+%09%09%09String%5B%5D excludes = %7B%22**/*.application%22%7D;%0A%09%09%09%0A
 %09%09%09this.zipA
@@ -1613,16 +1613,32 @@
 lasses%22)
+, null, excludes
 );%0A%09%09%09th

Exclude .application files from the Archive