Package org.glassfish.build
Class FeatureSetsDependenciesMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.glassfish.build.FeatureSetsDependenciesMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="featuresets-dependencies", requiresProject=true, requiresDependencyResolution=COMPILE, defaultPhase=PROCESS_RESOURCES) public final class FeatureSetsDependenciesMojo extends org.apache.maven.plugin.AbstractMojoResolves and unpack corresponding sources of project dependencies.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFeatureSetsDependenciesMojo.DependencyMappingConfiguration of dependency mapping to name.
-
Field Summary
Fields Modifier and Type Field Description private org.codehaus.plexus.archiver.manager.ArchiverManagerarchiverManagerManager used to look up Archiver/UnArchiver implementations.private java.lang.StringcopyExcludesComma separated list of (g:)a(:v) to excludes for unpack.private java.lang.StringcopyTypesComma separated list of file extensions to include for copy.private java.lang.StringexcludesComma separated list of exclude patterns.private java.lang.StringexcludeScopeScope to exclude.private java.lang.StringfeatureSetGroupIdIncludesThe groupId of the feature sets to include.private java.lang.StringincludesComma separated list of include patterns.private java.lang.StringincludeScopeScope to include.private java.util.List<FeatureSetsDependenciesMojo.DependencyMapping>mappingsCustom mappings.private org.apache.maven.project.MavenProjectprojectThe maven project.private static java.lang.StringPROPERTY_PREFIXParameters property prefix.private java.util.List<org.eclipse.aether.repository.RemoteRepository>remoteReposThe project remote repositories to use.private org.eclipse.aether.RepositorySystemSessionrepoSessionThe current repository/network configuration of Maven.private org.eclipse.aether.RepositorySystemrepoSystemThe entry point to Aether.private booleanskipSkip this mojo.private java.io.FilestageDirectoryThe directory where the files will be copied.private java.lang.StringunpackExcludesComma separated list of (g:)a(:v) to excludes for unpack.private java.lang.StringunpackTypesComma separated list of file extensions to include for unpack.
-
Constructor Summary
Constructors Constructor Description FeatureSetsDependenciesMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()private java.lang.StringgetMapping(org.eclipse.aether.artifact.Artifact artifact)Get the mapping for a given artifact.private static booleanisArtifactExcluded(java.util.List<java.lang.String> excludes, org.eclipse.aether.artifact.Artifact artifact)Match the given artifact against the exclusion list.private booleanisScopeIncluded(java.lang.String scope)Match the given scope with the includeScope and excludeScope parameters.private static java.util.List<java.lang.String>stringAsList(java.lang.String str, java.lang.String c)Convert aStringto aList.
-
-
-
Field Detail
-
PROPERTY_PREFIX
private static final java.lang.String PROPERTY_PREFIX
Parameters property prefix.- See Also:
- Constant Field Values
-
repoSystem
@Component private org.eclipse.aether.RepositorySystem repoSystem
The entry point to Aether.
-
repoSession
@Parameter(defaultValue="${repositorySystemSession}", readonly=true) private org.eclipse.aether.RepositorySystemSession repoSessionThe current repository/network configuration of Maven.
-
remoteRepos
@Parameter(defaultValue="${project.remoteProjectRepositories}", readonly=true) private java.util.List<org.eclipse.aether.repository.RemoteRepository> remoteReposThe project remote repositories to use.
-
archiverManager
@Component private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
Manager used to look up Archiver/UnArchiver implementations.
-
project
@Parameter(defaultValue="${project}", required=true, readonly=true) private org.apache.maven.project.MavenProject projectThe maven project.
-
stageDirectory
@Parameter(property="gfbuild.featuresets.dependencies.stageDirectory", defaultValue="${project.build.directory}/stage") private java.io.File stageDirectoryThe directory where the files will be copied.
-
copyTypes
@Parameter(property="gfbuild.featuresets.dependencies.copyTypes", defaultValue="jar,war,rar") private java.lang.String copyTypesComma separated list of file extensions to include for copy.
-
copyExcludes
@Parameter(property="gfbuild.featuresets.dependencies.copyExcludes", defaultValue="") private java.lang.String copyExcludesComma separated list of (g:)a(:v) to excludes for unpack.
-
unpackTypes
@Parameter(property="gfbuild.featuresets.dependencies.unpackTypes", defaultValue="zip") private java.lang.String unpackTypesComma separated list of file extensions to include for unpack.
-
unpackExcludes
@Parameter(property="gfbuild.featuresets.dependencies.unpackExcludes", defaultValue="") private java.lang.String unpackExcludesComma separated list of (g:)a(:v) to excludes for unpack.
-
includes
@Parameter(property="gfbuild.featuresets.dependencies.includes", defaultValue="") private java.lang.String includesComma separated list of include patterns.
-
excludes
@Parameter(property="gfbuild.featuresets.dependencies.excludes", defaultValue="") private java.lang.String excludesComma separated list of exclude patterns.
-
includeScope
@Parameter(property="gfbuild.featuresets.dependencies.includeScope", defaultValue="compile", required=false) private java.lang.String includeScopeScope to include. An Empty string indicates all scopes.
-
excludeScope
@Parameter(property="gfbuild.featuresets.dependencies.excludeScope", defaultValue="test,system") private java.lang.String excludeScopeScope to exclude. An Empty string indicates no scopes.
-
featureSetGroupIdIncludes
@Parameter(property="gfbuild.featuresets.dependencies.featureset.groupid.includes", defaultValue="") private java.lang.String featureSetGroupIdIncludesThe groupId of the feature sets to include.
-
mappings
@Parameter private java.util.List<FeatureSetsDependenciesMojo.DependencyMapping> mappings
Custom mappings.
-
skip
@Parameter(property="gfbuild.featuresets.dependencies.skip", defaultValue="false") private boolean skipSkip this mojo.
-
-
Method Detail
-
getMapping
private java.lang.String getMapping(org.eclipse.aether.artifact.Artifact artifact)
Get the mapping for a given artifact. Lookup the configured mapping for a custom mapping, otherwise return the artifactId- Parameters:
artifact- the artifact to be mapped- Returns:
- the mapped name for the artifact
-
stringAsList
private static java.util.List<java.lang.String> stringAsList(java.lang.String str, java.lang.String c)Convert aStringto aList.- Parameters:
str- theStringto convertc- the character used as separated in theString- Returns:
- the converted
List
-
isScopeIncluded
private boolean isScopeIncluded(java.lang.String scope)
Match the given scope with the includeScope and excludeScope parameters.- Parameters:
scope- the scope to match- Returns:
trueif the scope is included and not excluded,falseotherwise
-
isArtifactExcluded
private static boolean isArtifactExcluded(java.util.List<java.lang.String> excludes, org.eclipse.aether.artifact.Artifact artifact)Match the given artifact against the exclusion list.- Parameters:
excludes- the exclusion listartifact- the artifact to match- Returns:
trueif the artifact is included,falseotherwise
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-