Package org.apache.sis.internal.maven
Class JarCollector
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.sis.internal.maven.JarCollector
- All Implemented Interfaces:
FileFilter,org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="collect-jars",
defaultPhase=PACKAGE,
requiresDependencyResolution=RUNTIME)
public final class JarCollector
extends org.apache.maven.plugin.AbstractMojo
implements FileFilter
Collects
.jar files in a single "target/binaries" directory.
Dependencies are collected as well, except if already presents. This mojo uses hard links
on platforms that support them. If hard links are not supported, then this mojo will instead
creates a "target/binaries/other_dependencies.txt" file listing the dependencies.- Since:
- 0.3
- Version:
- 1.0
- Author:
- Martin Desruisseaux (Geomatys)
-
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
JarCollector
public JarCollector()Invoked by reflection for creating the MOJO.
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionCopies the*.jarfiles to the collect directory.- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionException- if the plugin execution failed.
-
accept
Filters the content of the "target" directory in order to keep only the project build result. We scan the directory because the final name may be different than the actual file name, because a classifier may have been added to the name.The
.jarextension is not quite appropriate for source and Javadoc files; a better extension would be.zip. Unfortunately, the.jarextension for those content is a very common practice, so we have to filter them.- Specified by:
acceptin interfaceFileFilter
-