Class JarMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.archetype.mojos.JarMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
@Mojo(name="jar",
defaultPhase=PACKAGE,
requiresProject=true)
public class JarMojo
extends org.apache.maven.plugin.AbstractMojo
Build a JAR from the current Archetype project.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArchetypeArtifactManagerprivate FileDirectory containing the classes.private org.apache.maven.archiver.MavenArchiveConfigurationThe archive configuration to use.The Jar archiver.private StringName of the generated JAR.private FileDirectory containing the generated JAR.private StringTimestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).private org.apache.maven.project.MavenProjectThe Maven project.private org.apache.maven.execution.MavenSessionTheMavenSession.private booleanExclude some files from the archetype like .gitignore.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsConstructorDescriptionJarMojo(Map<String, org.codehaus.plexus.archiver.Archiver> archivers, ArchetypeArtifactManager archetypeArtifactManager) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckArchetypeFile(File jarFile) private voidcheckFileSetArchetypeFile(File jarFile) voidexecute()Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
archetypeDirectory
@Parameter(defaultValue="${project.build.outputDirectory}", required=true) private File archetypeDirectoryDirectory containing the classes. -
finalName
@Parameter(defaultValue="${project.build.finalName}", alias="jarName", required=true) private String finalNameName of the generated JAR. -
outputDirectory
Directory containing the generated JAR. -
useDefaultExcludes
@Parameter(defaultValue="true") private boolean useDefaultExcludesExclude some files from the archetype like .gitignore. -
project
@Parameter(defaultValue="${project}", readonly=true, required=true) private org.apache.maven.project.MavenProject projectThe Maven project. -
session
@Parameter(defaultValue="${session}", readonly=true, required=true) private org.apache.maven.execution.MavenSession sessionTheMavenSession. -
archive
@Parameter private org.apache.maven.archiver.MavenArchiveConfiguration archiveThe archive configuration to use. See Maven Archiver Reference.- Since:
- 3.2.0
-
outputTimestamp
Timestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).- Since:
- 3.2.0
-
archivers
-
archetypeArtifactManager
-
-
Constructor Details
-
JarMojo
@Inject public JarMojo(Map<String, org.codehaus.plexus.archiver.Archiver> archivers, ArchetypeArtifactManager archetypeArtifactManager)
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
checkArchetypeFile
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
checkFileSetArchetypeFile
- Throws:
UnknownArchetype
-