Class AbstractProvisioningMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.bndly.common.app.provisioning.mojo.AbstractMojo
-
- org.bndly.common.app.provisioning.mojo.AbstractProvisioningMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractStartOrRunMojo,PackageMojo,PreparePackageMojo,StopMojo
public abstract class AbstractProvisioningMojo extends AbstractMojo
- Author:
- cybercon <bndly@cybercon.de>
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>additionalMainClasspathLibrariesprotected PackageLayoutpackageLayoutprotected org.apache.maven.project.MavenProjectHelperprojectHelperprotected FileprovisioningDirectoryprotected booleanrunModeConfigurationsprotected booleansaveProvisioningModelprotected PropertiessystemPropertiesFromConfiguration-
Fields inherited from class org.bndly.common.app.provisioning.mojo.AbstractMojo
mavenSession, project
-
-
Constructor Summary
Constructors Constructor Description AbstractProvisioningMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateFileAndParentDirectories(Path file)protected voiddeleteIfExists(Path path)voidexecute()protected Map<Integer,Properties>extractRunModeProperties(ProvisioningModel model)protected StringgetMainClassName()protected PathgetManifestPath()protected org.codehaus.plexus.interpolation.StringSearchInterpolatorgetStringSearchInterpolator()protected PathgetTargetAppFolder()protected PathgetTargetJavaMainFolder()protected voidinit(org.codehaus.plexus.interpolation.StringSearchInterpolator stringSearchInterpolator)protected ProvisioningModelloadProvisioningModel()protected ProvisioningModelloadProvisioningModel(boolean interpolatePlaceholderStrings)voidsetMavenSession(org.apache.maven.execution.MavenSession mavenSession)This setter exists for unit testing only.voidsetProject(org.apache.maven.project.MavenProject project)This setter exists for unit testing only.voidsetProvisioningDirectory(File provisioningDirectory)This setter exists for unit testing only.voidsetSystemProperties(Properties systemPropertiesFromConfiguration)This setter exists for unit testing only.protected voidwriteProvisioningModel(ProvisioningModel model, String jsonFileName)-
Methods inherited from class org.bndly.common.app.provisioning.mojo.AbstractMojo
getArchiverManager, getArtifactHelper, resolveArtifactDefinitionToArtifactFile, setArtifactHelper, setResolver
-
-
-
-
Field Detail
-
provisioningDirectory
@Parameter(defaultValue="${basedir}/src/main/prov") protected File provisioningDirectory
-
systemPropertiesFromConfiguration
@Parameter(alias="systemProperties", readonly=true) protected Properties systemPropertiesFromConfiguration
-
saveProvisioningModel
@Parameter(readonly=true, defaultValue="false") protected boolean saveProvisioningModel
-
runModeConfigurations
@Parameter(readonly=true, defaultValue="true") protected boolean runModeConfigurations
-
packageLayout
@Parameter(defaultValue="classic") protected PackageLayout packageLayout
-
projectHelper
@Component protected org.apache.maven.project.MavenProjectHelper projectHelper
-
-
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
-
getStringSearchInterpolator
protected final org.codehaus.plexus.interpolation.StringSearchInterpolator getStringSearchInterpolator()
-
init
protected void init(org.codehaus.plexus.interpolation.StringSearchInterpolator stringSearchInterpolator)
-
writeProvisioningModel
protected final void writeProvisioningModel(ProvisioningModel model, String jsonFileName) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createFileAndParentDirectories
protected final void createFileAndParentDirectories(Path file) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
deleteIfExists
protected final void deleteIfExists(Path path) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
loadProvisioningModel
protected final ProvisioningModel loadProvisioningModel() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
loadProvisioningModel
protected final ProvisioningModel loadProvisioningModel(boolean interpolatePlaceholderStrings) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
extractRunModeProperties
protected Map<Integer,Properties> extractRunModeProperties(ProvisioningModel model) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getTargetAppFolder
protected Path getTargetAppFolder() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getTargetJavaMainFolder
protected final Path getTargetJavaMainFolder() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getManifestPath
protected final Path getManifestPath()
-
getMainClassName
protected final String getMainClassName()
-
setSystemProperties
public void setSystemProperties(Properties systemPropertiesFromConfiguration)
This setter exists for unit testing only.- Parameters:
systemPropertiesFromConfiguration-
-
setProvisioningDirectory
public void setProvisioningDirectory(File provisioningDirectory)
This setter exists for unit testing only.- Parameters:
provisioningDirectory-
-
setMavenSession
public void setMavenSession(org.apache.maven.execution.MavenSession mavenSession)
This setter exists for unit testing only.- Parameters:
mavenSession-
-
setProject
public void setProject(org.apache.maven.project.MavenProject project)
This setter exists for unit testing only.- Parameters:
project-
-
-