Package org.codehaus.mojo.xml
Class AbstractXmlMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.xml.AbstractXmlMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CheckFormatMojo
,TransformMojo
,ValidateMojo
public abstract class AbstractXmlMojo extends org.apache.maven.plugin.AbstractMojo
Abstract base class for the plugins Mojo's.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractXmlMojo.CatalogHandling
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
basedir
The base directory, relative to which directory names are interpreted.private AbstractXmlMojo.CatalogHandling
catalogHandling
How to handle entities which cannot be found in any catalog.private java.lang.String[]
catalogs
An XML catalog file, or URL, which is being used to resolve entities.private org.codehaus.plexus.resource.ResourceManager
locator
Plexus resource manager used to obtain XSL.private boolean
locatorInitialized
private org.apache.maven.project.MavenProject
project
The Maven Project.private org.apache.maven.settings.Settings
settings
The Maven Settings.private boolean
skip
Whether to skip execution.
-
Constructor Summary
Constructors Constructor Description AbstractXmlMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
activateProxy()
Called to install the plugins proxy settings.protected java.io.File
asAbsoluteFile(java.io.File f)
Converts the given file into an file with an absolute path.protected java.io.File[]
asFiles(java.io.File pDir, java.lang.String[] pFileNames)
Converts the given set of file names into a set ofFile
instances.(package private) void
checkCatalogHandling()
protected java.io.File
getBasedir()
Returns the projects base directory.protected AbstractXmlMojo.CatalogHandling
getCatalogHandling()
protected java.lang.String[]
getExcludes(java.lang.String[] origExcludes, boolean skipDefaultExcludes)
Calculates the exclusions to use when searching files.protected java.lang.String[]
getFileNames(java.io.File pDir, java.lang.String[] pIncludes, java.lang.String[] pExcludes)
Scans a directory for files and returns a set of path names.protected java.io.File[]
getFiles(java.io.File pDir, java.lang.String[] pIncludes, java.lang.String[] pExcludes)
Scans a directory for files and returns a set ofFile
instances.protected org.codehaus.plexus.resource.ResourceManager
getLocator()
protected org.apache.maven.project.MavenProject
getProject()
Returns the maven project.protected Resolver
getResolver()
Creates a new resolver.protected java.net.URL
getResource(java.lang.String pResource)
private boolean
isEmpty(java.lang.String value)
protected boolean
isSkipping()
protected void
passivateProxy(java.lang.Object pProperties)
Called to restore the proxy settings, which have been installed when the plugin was invoked.protected void
setCatalogs(java.util.List<java.io.File> pCatalogFiles, java.util.List<java.net.URL> pCatalogUrls)
Returns the plugins catalog files.private void
setProperty(java.util.List<java.lang.String> pProperties, java.lang.String pKey, java.lang.String pValue)
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
project
@Parameter(defaultValue="${project}", required=true, readonly=true) private org.apache.maven.project.MavenProject project
The Maven Project.
-
settings
@Parameter(defaultValue="${settings}", required=true, readonly=true) private org.apache.maven.settings.Settings settings
The Maven Settings.
-
basedir
@Parameter(defaultValue="${project.basedir}", required=true, readonly=true) private java.io.File basedir
The base directory, relative to which directory names are interpreted.
-
skip
@Parameter(property="xml.skip", defaultValue="false") private boolean skip
Whether to skip execution.- Since:
- 1.0.1
-
catalogs
@Parameter private java.lang.String[] catalogs
An XML catalog file, or URL, which is being used to resolve entities. See Catalog files.- Since:
- 1.0
-
catalogHandling
@Parameter(property="xml.catalogHandling", defaultValue="passThrough") private AbstractXmlMojo.CatalogHandling catalogHandling
How to handle entities which cannot be found in any catalog. See Common Goal Properties.- Since:
- 1.0.2
-
locator
@Component private org.codehaus.plexus.resource.ResourceManager locator
Plexus resource manager used to obtain XSL.
-
locatorInitialized
private boolean locatorInitialized
-
-
Method Detail
-
getProject
protected org.apache.maven.project.MavenProject getProject()
Returns the maven project.
-
getBasedir
protected java.io.File getBasedir()
Returns the projects base directory.
-
asAbsoluteFile
protected java.io.File asAbsoluteFile(java.io.File f)
Converts the given file into an file with an absolute path.
-
setCatalogs
protected void setCatalogs(java.util.List<java.io.File> pCatalogFiles, java.util.List<java.net.URL> pCatalogUrls) throws org.apache.maven.plugin.MojoExecutionException
Returns the plugins catalog files.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getResolver
protected Resolver getResolver() throws org.apache.maven.plugin.MojoExecutionException
Creates a new resolver.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getFileNames
protected java.lang.String[] getFileNames(java.io.File pDir, java.lang.String[] pIncludes, java.lang.String[] pExcludes) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
Scans a directory for files and returns a set of path names.- Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
-
asFiles
protected java.io.File[] asFiles(java.io.File pDir, java.lang.String[] pFileNames)
Converts the given set of file names into a set ofFile
instances. The file names may be relative to the given base directory.
-
getFiles
protected java.io.File[] getFiles(java.io.File pDir, java.lang.String[] pIncludes, java.lang.String[] pExcludes) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
Scans a directory for files and returns a set ofFile
instances.- Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
-
getExcludes
protected java.lang.String[] getExcludes(java.lang.String[] origExcludes, boolean skipDefaultExcludes)
Calculates the exclusions to use when searching files.
-
isEmpty
private boolean isEmpty(java.lang.String value)
-
setProperty
private void setProperty(java.util.List<java.lang.String> pProperties, java.lang.String pKey, java.lang.String pValue)
-
activateProxy
protected java.lang.Object activateProxy()
Called to install the plugins proxy settings.
-
passivateProxy
protected void passivateProxy(java.lang.Object pProperties)
Called to restore the proxy settings, which have been installed when the plugin was invoked.
-
getResource
protected java.net.URL getResource(java.lang.String pResource) throws org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoFailureException
-
getLocator
protected org.codehaus.plexus.resource.ResourceManager getLocator()
-
isSkipping
protected boolean isSkipping()
-
checkCatalogHandling
void checkCatalogHandling() throws org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoFailureException
-
getCatalogHandling
protected AbstractXmlMojo.CatalogHandling getCatalogHandling()
-
-