Package org.codehaus.mojo.xml
Class TransformMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.xml.AbstractXmlMojo
-
- org.codehaus.mojo.xml.TransformMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(defaultPhase=GENERATE_RESOURCES, name="transform", threadSafe=true) public class TransformMojo extends AbstractXmlMojoThe TransformMojo is used for transforming a set of files using a common stylesheet.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.codehaus.mojo.xml.AbstractXmlMojo
AbstractXmlMojo.CatalogHandling
-
-
Constructor Summary
Constructors Constructor Description TransformMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()Called by Maven to run the plugin.protected longfindLastModified(List<?> files, boolean oldest)protected booleanisUpdToDate(List<?> dependsFiles, List<?> producesFiles)static TransformerFactorynewTransformerFactory(String factoryClassName, ClassLoader classLoader)-
Methods inherited from class org.codehaus.mojo.xml.AbstractXmlMojo
activateProxy, asAbsoluteFile, asFiles, getBasedir, getCatalogHandling, getExcludes, getFileNames, getFiles, getLocator, getProject, getResolver, getResource, isSkipping, passivateProxy, setCatalogs
-
-
-
-
Method Detail
-
newTransformerFactory
public static TransformerFactory newTransformerFactory(String factoryClassName, ClassLoader classLoader) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
-
findLastModified
protected long findLastModified(List<?> files, boolean oldest)
- Parameters:
files- the fileNames or URLs to scan their lastModified timestamp.oldest- if true, returns the latest modificationDate of all files, otherwise returns the earliest.- Returns:
- the older or younger last modification timestamp of all files.
-
isUpdToDate
protected boolean isUpdToDate(List<?> dependsFiles, List<?> producesFiles)
- Returns:
- true to indicate results are up-to-date, that is, when the latest from input files is earlier than the younger from the output files (meaning no re-execution required).
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionCalled by Maven to run the plugin.- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
-