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.AbstractMojoAbstract base class for the plugins Mojo's.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractXmlMojo.CatalogHandling
-
Field Summary
Fields Modifier and Type Field Description private java.io.FilebasedirThe base directory, relative to which directory names are interpreted.private AbstractXmlMojo.CatalogHandlingcatalogHandlingHow to handle entities which cannot be found in any catalog.private java.lang.String[]catalogsAn XML catalog file, or URL, which is being used to resolve entities.private org.codehaus.plexus.resource.ResourceManagerlocatorPlexus resource manager used to obtain XSL.private booleanlocatorInitializedprivate org.apache.maven.project.MavenProjectprojectThe Maven Project.private org.apache.maven.settings.SettingssettingsThe Maven Settings.private booleanskipWhether 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.ObjectactivateProxy()Called to install the plugins proxy settings.protected java.io.FileasAbsoluteFile(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 ofFileinstances.(package private) voidcheckCatalogHandling()protected java.io.FilegetBasedir()Returns the projects base directory.protected AbstractXmlMojo.CatalogHandlinggetCatalogHandling()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 ofFileinstances.protected org.codehaus.plexus.resource.ResourceManagergetLocator()protected org.apache.maven.project.MavenProjectgetProject()Returns the maven project.protected ResolvergetResolver()Creates a new resolver.protected java.net.URLgetResource(java.lang.String pResource)private booleanisEmpty(java.lang.String value)protected booleanisSkipping()protected voidpassivateProxy(java.lang.Object pProperties)Called to restore the proxy settings, which have been installed when the plugin was invoked.protected voidsetCatalogs(java.util.List<java.io.File> pCatalogFiles, java.util.List<java.net.URL> pCatalogUrls)Returns the plugins catalog files.private voidsetProperty(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 projectThe Maven Project.
-
settings
@Parameter(defaultValue="${settings}", required=true, readonly=true) private org.apache.maven.settings.Settings settingsThe Maven Settings.
-
basedir
@Parameter(defaultValue="${project.basedir}", required=true, readonly=true) private java.io.File basedirThe base directory, relative to which directory names are interpreted.
-
skip
@Parameter(property="xml.skip", defaultValue="false") private boolean skipWhether to skip execution.
-
catalogs
@Parameter private java.lang.String[] catalogs
An XML catalog file, or URL, which is being used to resolve entities.
-
catalogHandling
@Parameter(property="xml.catalogHandling", defaultValue="passThrough") private AbstractXmlMojo.CatalogHandling catalogHandlingHow to handle entities which cannot be found in any catalog.
-
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.MojoExecutionExceptionReturns 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.MojoExecutionExceptionScans a directory for files and returns a set of path names.- Throws:
org.apache.maven.plugin.MojoFailureExceptionorg.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 ofFileinstances. 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.MojoExecutionExceptionScans a directory for files and returns a set ofFileinstances.- Throws:
org.apache.maven.plugin.MojoFailureExceptionorg.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()
-
-