org.apache.sling.maven.slingstart

## Class PackageMojo

- java.lang.Object
- - org.apache.maven.plugin.AbstractMojo
  - - org.apache.sling.maven.slingstart.AbstractSlingStartMojo
    - - org.apache.sling.maven.slingstart.PackageMojo

All Implemented Interfaces:
  org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="package",
          defaultPhase=PRE_INTEGRATION_TEST,
          requiresDependencyResolution=TEST,
          threadSafe=true)
    public class PackageMojo
    extends AbstractSlingStartMojo

Create a Sling quickstart package (either JAR or WAR) based on the referenced model.

### Field Summary

Fields
`protected boolean` `attachArtifact` If set to `false` does not attach the generated artifact to Maven.
`protected boolean` `createWebapp` If set to `true` creates a WAR artifact in addition to the standalone JAR from the model.

### Fields inherited from class org.apache.sling.maven.slingstart.AbstractSlingStartMojo

`allowUnresolvedPomDependencies, DEFAULT_MODEL_PATTERN, mavenSession, project, projectHelper, usePomDependencies, usePomVariables`

### Fields inherited from interface org.apache.maven.plugin.Mojo

`ROLE`

### Constructor Summary

Constructors
Constructor and Description
`PackageMojo()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `execute()`
`static File` `getNonPrimaryBuildFile(org.apache.maven.project.MavenProject project, String extension)`

### Methods inherited from class org.apache.sling.maven.slingstart.AbstractSlingStartMojo

`getResolverOptions, getStandaloneOutputDirectory, getTmpDir`

### Methods inherited from class org.apache.maven.plugin.AbstractMojo

`getLog, getPluginContext, setLog, setPluginContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### createWebapp

    @Parameter(defaultValue="false")
    protected boolean createWebapp

If set to `true` creates a WAR artifact in addition to the standalone JAR from the model.

#### attachArtifact

    @Parameter(defaultValue="true")
    protected boolean attachArtifact

If set to `false` does not attach the generated artifact to Maven. This setting takes only effect if the packaging of the current Maven project is not `slingstart`. Otherwise the generated artifact is always the main artifact (and is therefore always attached).

### Constructor Detail

#### PackageMojo

    public PackageMojo()

### Method Detail

#### execute

    public void execute()
                 throws org.apache.maven.plugin.MojoExecutionException,
                        org.apache.maven.plugin.MojoFailureException

Throws:
  `org.apache.maven.plugin.MojoExecutionException`
  `org.apache.maven.plugin.MojoFailureException`

#### getNonPrimaryBuildFile

    public static File getNonPrimaryBuildFile(org.apache.maven.project.MavenProject project,
                                              String extension)