@Mojo(name="install-file", requiresProject=false, aggregator=true, threadSafe=true) public class InstallFileMojo extends AbstractInstallMojo
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
artifactId
ArtifactId of the artifact to be installed.
|
protected java.lang.String |
classifier
Classifier type of the artifact to be installed.
|
private java.io.File |
file
The file to be installed in the local repository.
|
private java.lang.Boolean |
generatePom
Generate a minimal POM for the artifact if none is supplied via the parameter
pomFile . |
protected java.lang.String |
groupId
GroupId of the artifact to be installed.
|
private java.io.File |
javadoc
The bundled API docs for the artifact.
|
private java.io.File |
localRepositoryPath
The path for a specific local repository directory.
|
private org.apache.maven.project.validation.ModelValidator |
modelValidator
The component used to validate the user-supplied artifact coordinates.
|
protected java.lang.String |
packaging
Packaging type of the artifact to be installed.
|
private java.io.File |
pomFile
Location of an existing POM file to be installed alongside the main artifact, given by the
file
parameter. |
private java.lang.String |
repositoryLayout
The type of remote repository layout to install to.
|
private java.util.Map<java.lang.String,org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout> |
repositoryLayouts
Map that contains the repository layouts.
|
private java.io.File |
sources
The bundled sources for the artifact.
|
protected java.lang.String |
version
Version of the artifact to be installed.
|
artifactFactory, createChecksum, digester, installer, localRepository, updateReleaseInfo
Constructor and Description |
---|
InstallFileMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
private org.apache.maven.model.Model |
generateModel()
Generates a minimal model from the user-supplied artifact information.
|
private java.io.File |
generatePomFile()
Generates a (temporary) POM file from the plugin configuration.
|
java.io.File |
getLocalRepositoryPath() |
private void |
processModel(org.apache.maven.model.Model model)
Populates missing mojo parameters from the specified POM.
|
private org.apache.maven.model.Model |
readModel(java.io.File pomFile)
Parses a POM.
|
private org.apache.maven.model.Model |
readModel(java.io.InputStream pomFile)
Parses a POM.
|
void |
setLocalRepositoryPath(java.io.File theLocalRepositoryPath) |
private void |
validateArtifactInformation()
Validates the user-supplied artifact information.
|
addMetaDataFilesForArtifact, getLocalRepoFile, getLocalRepoFile, installChecksums, installChecksums
@Parameter(property="groupId") protected java.lang.String groupId
pom.xml
in jar if available.@Parameter(property="artifactId") protected java.lang.String artifactId
pom.xml
in jar if available.@Parameter(property="version") protected java.lang.String version
pom.xml
in jar if available.@Parameter(property="packaging") protected java.lang.String packaging
pom.xml
in jar if available.@Parameter(property="classifier") protected java.lang.String classifier
@Parameter(property="file", required=true) private java.io.File file
@Parameter(property="javadoc") private java.io.File javadoc
@Parameter(property="sources") private java.io.File sources
@Parameter(property="pomFile") private java.io.File pomFile
file
parameter.@Parameter(property="generatePom") private java.lang.Boolean generatePom
pomFile
. Defaults to
true
if there is no existing POM in the local repository yet.@Parameter(property="repositoryLayout", defaultValue="default", required=true) private java.lang.String repositoryLayout
legacy
for a Maven 1.x-style repository
layout.@Component(role=org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout.class) private java.util.Map<java.lang.String,org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout> repositoryLayouts
@Parameter(property="localRepositoryPath") private java.io.File localRepositoryPath
@Component private org.apache.maven.project.validation.ModelValidator modelValidator
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
Mojo.execute()
private org.apache.maven.model.Model readModel(java.io.File pomFile) throws org.apache.maven.plugin.MojoExecutionException
pomFile
- The path of the POM file to parse, must not be null
.null
.org.apache.maven.plugin.MojoExecutionException
- If the POM could not be parsed.private org.apache.maven.model.Model readModel(java.io.InputStream pomFile) throws org.apache.maven.plugin.MojoExecutionException
pomFile
- The path of the POM file to parse, must not be null
.null
.org.apache.maven.plugin.MojoExecutionException
- If the POM could not be parsed.private void processModel(org.apache.maven.model.Model model)
model
- The POM to extract missing artifact coordinates from, must not be null
.private void validateArtifactInformation() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- If any artifact coordinate is invalid.private org.apache.maven.model.Model generateModel()
null
.private java.io.File generatePomFile() throws org.apache.maven.plugin.MojoExecutionException
null
.org.apache.maven.plugin.MojoExecutionException
- If the POM file could not be generated.public java.io.File getLocalRepositoryPath()
public void setLocalRepositoryPath(java.io.File theLocalRepositoryPath)
theLocalRepositoryPath
- the localRepositoryPath to set