@Mojo(name="ark-plugin",
defaultPhase=PACKAGE,
requiresDependencyResolution=RUNTIME)
public class ArkPluginMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected String |
activator |
protected org.codehaus.plexus.archiver.manager.ArchiverManager |
archiverManager |
protected String |
artifactId |
protected String |
description |
protected LinkedHashSet<String> |
excludeArtifactIds
list of artifact names to exclude (exact match).
|
protected LinkedHashSet<String> |
excludeGroupIds
list of groupId names to exclude (exact match).
|
protected LinkedHashSet<String> |
excludes
Colon separated groupId, artifactId [and classifier] to exclude (exact match)
|
protected ExportConfig |
exported |
protected Boolean |
exportPluginClass
Export plugin project classes by default
|
protected String |
groupId
The configuration of ark plugin
|
protected ImportConfig |
imported |
protected File |
outputDirectory
The location of the generated ark plugin
|
String |
pluginName |
protected Integer |
priority |
protected org.apache.maven.project.MavenProject |
project |
protected org.apache.maven.project.MavenProjectHelper |
projectHelper |
protected LinkedHashSet<String> |
shades
Colon separated groupId, artifactId, classifier(optional), version.
|
protected String |
version |
protected File |
workDirectory
The location of sofa-ark-maven-plugin temporary file
|
| Constructor and Description |
|---|
ArkPluginMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addArkPluginArtifact(org.codehaus.plexus.archiver.Archiver archiver,
Set<org.apache.maven.artifact.Artifact> dependencies,
Set<org.apache.maven.artifact.Artifact> conflicts)
put all dependencies together into archive
|
protected void |
addArkPluginConfig(org.codehaus.plexus.archiver.Archiver archiver)
generate ark.plugin configuration file
archive
|
protected void |
addArtifact(org.codehaus.plexus.archiver.Archiver archiver,
org.apache.maven.artifact.Artifact artifact,
boolean artifactIdConflict)
add a artifact into archiver
|
void |
execute() |
protected Set<org.apache.maven.artifact.Artifact> |
filterConflictArtifacts(Set<org.apache.maven.artifact.Artifact> artifacts)
compute conflict artifacts
|
protected Set<org.apache.maven.artifact.Artifact> |
filterExcludeArtifacts(Set<org.apache.maven.artifact.Artifact> artifacts)
filter the excluded dependencies
|
protected org.codehaus.plexus.archiver.Archiver |
getArchiver()
create a zip archiver
|
protected boolean |
getExportPluginClass()
check whether to export plugin project
default true.
|
protected String |
getFileName()
repackage jar name
|
LinkedHashSet<String> |
getShades() |
protected String |
getTempFileName() |
protected boolean |
isAttach()
check whether install ark plugin install local repo
default true.
|
boolean |
isShadeJar(org.apache.maven.artifact.Artifact artifact) |
void |
setProject(org.apache.maven.project.MavenProject project) |
void |
setShades(LinkedHashSet<String> shades) |
void |
shadeJarIntoArkPlugin(File pluginFile,
File tmpPluginFile,
Set<org.apache.maven.artifact.Artifact> artifacts) |
@Component protected org.apache.maven.project.MavenProject project
@Component protected org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
@Component protected org.apache.maven.project.MavenProjectHelper projectHelper
@Parameter(defaultValue="${project.build.directory}",
property="sofa.ark.plugin.repository")
protected File outputDirectory
@Parameter(defaultValue="${project.build.directory}/sofa-ark-maven-plugin")
protected File workDirectory
@Parameter(defaultValue="${project.groupId}",
readonly=true)
protected String groupId
@Parameter(defaultValue="${project.artifactId}",
readonly=true)
protected String artifactId
@Parameter(defaultValue="${project.version}",
readonly=true)
protected String version
@Parameter(defaultValue="${project.artifactId}")
public String pluginName
@Parameter(defaultValue=" ") protected String description
@Parameter(defaultValue="100",
property="sofa.ark.plugin.priority")
protected Integer priority
@Parameter protected String activator
@Parameter protected ExportConfig exported
@Parameter protected ImportConfig imported
@Parameter(defaultValue="") protected LinkedHashSet<String> excludes
@Parameter(defaultValue="") protected LinkedHashSet<String> excludeGroupIds
@Parameter(defaultValue="") protected LinkedHashSet<String> excludeArtifactIds
@Parameter(defaultValue="") protected LinkedHashSet<String> shades
@Parameter(defaultValue="true") protected Boolean exportPluginClass
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void shadeJarIntoArkPlugin(File pluginFile, File tmpPluginFile, Set<org.apache.maven.artifact.Artifact> artifacts) throws IOException
IOExceptionpublic LinkedHashSet<String> getShades()
public void setShades(LinkedHashSet<String> shades)
public void setProject(org.apache.maven.project.MavenProject project)
public boolean isShadeJar(org.apache.maven.artifact.Artifact artifact)
protected void addArkPluginArtifact(org.codehaus.plexus.archiver.Archiver archiver,
Set<org.apache.maven.artifact.Artifact> dependencies,
Set<org.apache.maven.artifact.Artifact> conflicts)
archiver - ark plugin archiverdependencies - all dependencies of ark pluginconflicts - dependencies whose jar name (artifact id) is conflictprotected void addArtifact(org.codehaus.plexus.archiver.Archiver archiver,
org.apache.maven.artifact.Artifact artifact,
boolean artifactIdConflict)
archiver - archiver which represents a ark pluginartifact - artifact which will be put into archiverartifactIdConflict - whether artifact is conflicted, it will determine the final jar name.protected Set<org.apache.maven.artifact.Artifact> filterConflictArtifacts(Set<org.apache.maven.artifact.Artifact> artifacts)
artifacts - all dependencies of projectprotected Set<org.apache.maven.artifact.Artifact> filterExcludeArtifacts(Set<org.apache.maven.artifact.Artifact> artifacts)
artifacts - all dependencies of projectprotected org.codehaus.plexus.archiver.Archiver getArchiver()
throws org.codehaus.plexus.archiver.manager.NoSuchArchiverException
org.codehaus.plexus.archiver.manager.NoSuchArchiverExceptionprotected String getFileName()
protected String getTempFileName()
protected boolean isAttach()
protected boolean getExportPluginClass()
protected void addArkPluginConfig(org.codehaus.plexus.archiver.Archiver archiver)
throws org.apache.maven.plugin.MojoExecutionException
archiver - org.apache.maven.plugin.MojoExecutionExceptionCopyright © 2024. All rights reserved.