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.AbstractMojo
Resolves and unpack corresponding sources of project dependencies.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Configuration of dependency mapping to name. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.codehaus.plexus.archiver.manager.ArchiverManager
Manager used to look up Archiver/UnArchiver implementations.private String
Comma separated list of (g:)a(:v) to excludes for unpack.private String
Comma separated list of file extensions to include for copy.private String
Comma separated list of exclude patterns.private String
Scope to exclude.private String
The groupId of the feature sets to include.private String
Comma separated list of include patterns.private String
Scope to include.Custom mappings.private org.apache.maven.project.MavenProject
The maven project.private static final String
Parameters property prefix.private List
<org.eclipse.aether.repository.RemoteRepository> The project remote repositories to use.private org.eclipse.aether.RepositorySystemSession
The current repository/network configuration of Maven.private org.eclipse.aether.RepositorySystem
The entry point to Aether.private boolean
Skip this mojo.private File
The directory where the files will be copied.private String
Comma separated list of (g:)a(:v) to excludes for unpack.private String
Comma separated list of file extensions to include for unpack.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
private String
getMapping
(org.eclipse.aether.artifact.Artifact artifact) Get the mapping for a given artifact.private static boolean
isArtifactExcluded
(List<String> excludes, org.eclipse.aether.artifact.Artifact artifact) Match the given artifact against the exclusion list.private boolean
isScopeIncluded
(String scope) Match the given scope with the includeScope and excludeScope parameters.stringAsList
(String str, String c) Convert aString
to aList
.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
PROPERTY_PREFIX
Parameters property prefix.- See Also:
-
repoSystem
@Component private org.eclipse.aether.RepositorySystem repoSystemThe 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 List<org.eclipse.aether.repository.RemoteRepository> remoteReposThe project remote repositories to use. -
archiverManager
@Component private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManagerManager 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 File stageDirectoryThe directory where the files will be copied. -
copyTypes
@Parameter(property="gfbuild.featuresets.dependencies.copyTypes", defaultValue="jar,war,rar") private String copyTypesComma separated list of file extensions to include for copy. -
copyExcludes
@Parameter(property="gfbuild.featuresets.dependencies.copyExcludes", defaultValue="") private String copyExcludesComma separated list of (g:)a(:v) to excludes for unpack. -
unpackTypes
@Parameter(property="gfbuild.featuresets.dependencies.unpackTypes", defaultValue="zip") private String unpackTypesComma separated list of file extensions to include for unpack. -
unpackExcludes
@Parameter(property="gfbuild.featuresets.dependencies.unpackExcludes", defaultValue="") private String unpackExcludesComma separated list of (g:)a(:v) to excludes for unpack. -
includes
@Parameter(property="gfbuild.featuresets.dependencies.includes", defaultValue="") private String includesComma separated list of include patterns. -
excludes
@Parameter(property="gfbuild.featuresets.dependencies.excludes", defaultValue="") private String excludesComma separated list of exclude patterns. -
includeScope
@Parameter(property="gfbuild.featuresets.dependencies.includeScope", defaultValue="compile", required=false) private String includeScopeScope to include. An Empty string indicates all scopes. -
excludeScope
@Parameter(property="gfbuild.featuresets.dependencies.excludeScope", defaultValue="test,system") private String excludeScopeScope to exclude. An Empty string indicates no scopes. -
featureSetGroupIdIncludes
@Parameter(property="gfbuild.featuresets.dependencies.featureset.groupid.includes", defaultValue="") private String featureSetGroupIdIncludesThe groupId of the feature sets to include. -
mappings
Custom mappings. -
skip
@Parameter(property="gfbuild.featuresets.dependencies.skip", defaultValue="false") private boolean skipSkip this mojo.
-
-
Constructor Details
-
FeatureSetsDependenciesMojo
public FeatureSetsDependenciesMojo()
-
-
Method Details
-
getMapping
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
Convert aString
to aList
.- Parameters:
str
- theString
to convertc
- the character used as separated in theString
- Returns:
- the converted
List
-
isScopeIncluded
Match the given scope with the includeScope and excludeScope parameters.- Parameters:
scope
- the scope to match- Returns:
true
if the scope is included and not excluded,false
otherwise
-
isArtifactExcluded
private static boolean isArtifactExcluded(List<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:
true
if the artifact is included,false
otherwise
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-