Package org.wildfly.galleon.maven
Class AbstractFeaturePackBuildMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.wildfly.galleon.maven.AbstractFeaturePackBuildMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
UserFeaturePackBuildMojo,WfFeaturePackBuildMojo
public abstract class AbstractFeaturePackBuildMojo extends org.apache.maven.plugin.AbstractMojoThis Maven mojo creates a WildFly style feature-pack archive from the provided resources according to the feature-pack build configuration file and attaches it to the current Maven project as an artifact. The content of the future feature-pack archive is first created in the directory called `layout` under the module's build directory which is then ZIPped to create the feature-pack artifact.- Author:
- Alexey Loubyansky
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanaddFeaturePacksAsRequiredManifestsAdd any feature-pack dependency as a required manifest in the manifest YAML definition.protected org.apache.maven.shared.artifact.resolve.ArtifactResolverartifactResolverprotected booleangenerateChannelManifestGenerates a channel manifest YAML definition when the feature-pack is produced.protected org.apache.maven.project.MavenProjectprojectprotected org.eclipse.aether.RepositorySystemSessionrepoSessionprotected java.util.List<org.eclipse.aether.repository.RemoteRepository>repositoriesprotected org.eclipse.aether.RepositorySystemrepoSystemprotected org.apache.maven.execution.MavenSessionsessionprotected java.util.Map<java.lang.String,java.lang.String>taskPropsVarious properties that will be added to feature-pack's `resources/wildfly/wildfly-tasks.properties`.
NOTE: values of this parameter will overwrite the corresponding values from task-properties-file parameter, in case it's also set.protected org.wildfly.galleon.plugin.WildFlyChannelResolutionModewildflyChannelResolutionModeFeature-pack WildFly channel resolution mode when WildFly channels are configured in the provisioning tooling used to provision this feature-pack.
-
Constructor Summary
Constructors Constructor Description AbstractFeaturePackBuildMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.jboss.galleon.spec.PackageSpecaddPackage(java.nio.file.Path fpPackagesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, org.jboss.galleon.spec.PackageSpec.Builder pkgBuilder)protected voidbuildFeaturePack(org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, WildFlyFeaturePackBuild buildConfig)protected voiddebug(java.lang.String msg, java.lang.Object... args)protected abstract voiddoExecute()voidexecute()protected org.wildfly.galleon.maven.MavenProjectArtifactVersionsgetArtifactVersions()protected java.util.Map<java.lang.String,org.jboss.galleon.layout.FeaturePackDescription>getFpDependencies()protected java.nio.file.PathgetFpDir()protected java.nio.file.PathgetPackagesDir()protected java.nio.file.PathgetWildFlyResourcesDir()protected java.nio.file.PathgetWorkDir()protected voidhandleAddOns(java.nio.file.Path srcModulesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, java.nio.file.Path targetResources, org.jboss.galleon.spec.PackageSpec.Builder modulesAll)protected voidhandleLayers(java.nio.file.Path srcModulesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, java.nio.file.Path targetResources, org.jboss.galleon.spec.PackageSpec.Builder modulesAll)protected voidhandleModules(java.nio.file.Path srcModulesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, java.nio.file.Path targetResources, org.jboss.galleon.spec.PackageSpec.Builder modulesAll)protected voidprocessFeaturePackDependencies(WildFlyFeaturePackBuild buildConfig, org.jboss.galleon.spec.FeaturePackSpec.Builder fpBuilder)java.nio.file.PathresolveArtifact(org.wildfly.galleon.plugin.ArtifactCoords coords)java.lang.StringresolveVersion(java.lang.String coordsWoVersion)protected voidsetupDirs(java.lang.String buildName, java.lang.String fpArtifactId, java.lang.String layoutDir, java.nio.file.Path resourcesDir)protected voidwarn(java.lang.String msg, java.lang.Object... args)
-
-
-
Field Detail
-
repoSession
@Parameter(defaultValue="${repositorySystemSession}", readonly=true) protected org.eclipse.aether.RepositorySystemSession repoSession
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
-
session
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession session
-
repositories
@Parameter(defaultValue="${project.remoteProjectRepositories}", readonly=true, required=true) protected java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories
-
taskProps
@Parameter(alias="task-properties", required=false) protected java.util.Map<java.lang.String,java.lang.String> taskPropsVarious properties that will be added to feature-pack's `resources/wildfly/wildfly-tasks.properties`.
NOTE: values of this parameter will overwrite the corresponding values from task-properties-file parameter, in case it's also set.
-
generateChannelManifest
@Parameter(alias="generate-channel-manifest", required=false, defaultValue="false", property="wildfly.feature.pack.generate-channel-manifest") protected boolean generateChannelManifestGenerates a channel manifest YAML definition when the feature-pack is produced. Any dependency from the feature pack is declared as a stream in the channel manifest.
-
addFeaturePacksAsRequiredManifests
@Parameter(alias="add-feature-packs-as-required-manifests", required=false, defaultValue="true") protected boolean addFeaturePacksAsRequiredManifestsAdd any feature-pack dependency as a required manifest in the manifest YAML definition. This parameter has no effect if "generate-channel-manifest" is false.
-
wildflyChannelResolutionMode
@Parameter(alias="wildfly-channel-resolution-mode", required=false, defaultValue="NOT_REQUIRED", property="wildfly.feature.pack.require.channel.resolution") protected org.wildfly.galleon.plugin.WildFlyChannelResolutionMode wildflyChannelResolutionModeFeature-pack WildFly channel resolution mode when WildFly channels are configured in the provisioning tooling used to provision this feature-pack. "NOT_REQUIRED" means that the feature-pack and artifacts can be resolved without WildFly channels. "REQUIRED" means that the feature-pack and all its artifacts must be only resolved from WildFly channels. "REQUIRED_FP_ONLY" means that only the feature-pack must be only resolved from WildFly channels. Referenced artifacts can be resolved outside of configured WildFly channels.
-
repoSystem
@Component protected org.eclipse.aether.RepositorySystem repoSystem
-
artifactResolver
@Component protected org.apache.maven.shared.artifact.resolve.ArtifactResolver artifactResolver
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
getFpDependencies
protected java.util.Map<java.lang.String,org.jboss.galleon.layout.FeaturePackDescription> getFpDependencies()
-
getArtifactVersions
protected org.wildfly.galleon.maven.MavenProjectArtifactVersions getArtifactVersions()
-
doExecute
protected abstract void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
setupDirs
protected void setupDirs(java.lang.String buildName, java.lang.String fpArtifactId, java.lang.String layoutDir, java.nio.file.Path resourcesDir)
-
getWorkDir
protected java.nio.file.Path getWorkDir()
-
getWildFlyResourcesDir
protected java.nio.file.Path getWildFlyResourcesDir()
-
getFpDir
protected java.nio.file.Path getFpDir()
-
getPackagesDir
protected java.nio.file.Path getPackagesDir()
-
resolveVersion
public java.lang.String resolveVersion(java.lang.String coordsWoVersion) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
buildFeaturePack
protected void buildFeaturePack(org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, WildFlyFeaturePackBuild buildConfig) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
processFeaturePackDependencies
protected void processFeaturePackDependencies(WildFlyFeaturePackBuild buildConfig, org.jboss.galleon.spec.FeaturePackSpec.Builder fpBuilder) throws java.lang.Exception
- Throws:
java.lang.Exception
-
resolveArtifact
public java.nio.file.Path resolveArtifact(org.wildfly.galleon.plugin.ArtifactCoords coords) throws org.jboss.galleon.ProvisioningException- Throws:
org.jboss.galleon.ProvisioningException
-
handleLayers
protected void handleLayers(java.nio.file.Path srcModulesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, java.nio.file.Path targetResources, org.jboss.galleon.spec.PackageSpec.Builder modulesAll) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
handleAddOns
protected void handleAddOns(java.nio.file.Path srcModulesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, java.nio.file.Path targetResources, org.jboss.galleon.spec.PackageSpec.Builder modulesAll) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
handleModules
protected void handleModules(java.nio.file.Path srcModulesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, java.nio.file.Path targetResources, org.jboss.galleon.spec.PackageSpec.Builder modulesAll) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
addPackage
protected org.jboss.galleon.spec.PackageSpec addPackage(java.nio.file.Path fpPackagesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, org.jboss.galleon.spec.PackageSpec.Builder pkgBuilder) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
debug
protected void debug(java.lang.String msg, java.lang.Object... args)
-
warn
protected void warn(java.lang.String msg, java.lang.Object... args)
-
-