org.codehaus.mojo.apt.ProcessMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apt-maven-plugin Show documentation
Show all versions of apt-maven-plugin Show documentation
Maven Plugin for Annotation Processing Tool (apt).
package org.codehaus.mojo.apt;
/*
* The MIT License
*
* Copyright 2006-2008 The Codehaus.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import java.io.File;
import java.util.List;
import java.util.Set;
import org.apache.maven.model.Resource;
/**
* Executes apt on project sources.
*
* @author Juraj Burian
* @author Mark Hobson
* @version $Id: ProcessMojo.java 7029 2008-05-22 09:34:31Z mark $
* @goal process
* @phase generate-resources
* @requiresDependencyResolution compile
*/
public class ProcessMojo extends AbstractAptMojo
{
// read-only parameters ---------------------------------------------------
/**
* The source directories containing the sources to be processed.
*
* @parameter expression="${project.compileSourceRoots}"
* @required
* @readonly
*/
private List compileSourceRoots;
/**
* The project's resources.
*
* @parameter expression="${project.resources}"
* @required
* @readonly
*/
private List resources;
/**
* The project's classpath.
*
* @parameter expression="${project.compileClasspathElements}"
* @required
* @readonly
*/
private List classpathElements;
// configurable parameters ------------------------------------------------
/**
* A set of inclusion filters for apt. Default value is **/*.java
.
*
* @parameter
*/
private Set includes;
/**
* A set of exclusion filters for apt.
*
* @parameter
*/
private Set excludes;
/**
* The directory root under which processor-generated source files will be placed; files are placed in
* subdirectories based on package namespace. This is equivalent to the -s
argument for apt.
*
* @parameter default-value="${project.build.directory}/generated-sources/apt"
*/
private File outputDirectory;
// AbstractAptMojo methods ------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
protected List getCompileSourceRoots()
{
return compileSourceRoots;
}
/**
* {@inheritDoc}
*/
@Override
protected List getResources()
{
return resources;
}
/**
* {@inheritDoc}
*/
@Override
protected List getClasspathElements()
{
return classpathElements;
}
/**
* {@inheritDoc}
*/
@Override
protected Set getIncludes()
{
return includes;
}
/**
* {@inheritDoc}
*/
@Override
protected Set getExcludes()
{
return excludes;
}
/**
* {@inheritDoc}
*/
@Override
protected File getOutputDirectory()
{
return outputDirectory;
}
}