@Mojo(name="attach-modules",
defaultPhase=PACKAGE,
requiresDependencyCollection=COMPILE)
public class AttachModulesMojo
extends org.apache.maven.plugin.AbstractMojo
.zip
file containing the .jar
file of the project and the module.xml
files available in the src/main/modules
directory. This .zip
file is then attached to the project
using zip
as the type and a classifier composed by the optional category
parameter and the
modules
word.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
category
Category of the module.
|
private boolean |
generateIndex
This is parameter is no longer used, index generation has been removed.
|
private java.lang.String |
moduleName
The name of the module.
|
private java.util.List<Module> |
modules
The list of modules to generate.
|
private java.io.File |
modulesDir
The temporary directory where modules will be stored.
|
private java.lang.String |
moduleSlot
The slot of the module.
|
private org.apache.maven.project.MavenProject |
project
The maven project.
|
private org.apache.maven.project.MavenProjectHelper |
projectHelper
The project helper.
|
Constructor and Description |
---|
AttachModulesMojo() |
Modifier and Type | Method and Description |
---|---|
private void |
createModule(Module module) |
void |
execute() |
private java.lang.String |
makeArchiveName()
Computes the name of the archive that contains the modules.
|
private java.lang.String |
makeClassifier()
Computes the classifier of the archive that contains the modules.
|
@Parameter(defaultValue="${project}", readonly=true) private org.apache.maven.project.MavenProject project
@Component private org.apache.maven.project.MavenProjectHelper projectHelper
@Parameter(property="moduleName", required=false) private java.lang.String moduleName
@Parameter(property="moduleSlot", required=false, defaultValue="main") private java.lang.String moduleSlot
@Parameter(property="modules") private java.util.List<Module> modules
@Parameter(property="generateIndex", defaultValue="false") private boolean generateIndex
@Parameter(property="category", defaultValue="") private java.lang.String category
common
then the classifier will be common-modules
and
the name of the attached artifact will be common-modules.zip
.private java.io.File modulesDir
public void execute() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
private java.lang.String makeArchiveName()
modules.zip
, with dashes as separators where needed.private java.lang.String makeClassifier()
modules
, with a dash as separator if needed.private void createModule(Module module) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException