Package com.github.wix_maven
Class PatchMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.github.wix_maven.AbstractWixMojo
com.github.wix_maven.AbstractPackageable
com.github.wix_maven.AbstractTorchMojo
com.github.wix_maven.PatchMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="patch",
requiresProject=true,
defaultPhase=PACKAGE,
requiresDependencyResolution=COMPILE)
public class PatchMojo
extends AbstractTorchMojo
Goal which executes WiX torch & pyro to create msp files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringBaseline id...protected org.apache.maven.project.MavenProjectBuilderProject builder -- builds a model from a pom.xmlFields inherited from class com.github.wix_maven.AbstractPackageable
cabCacheDirectory, externalCabs, mergeLevel, ML_BASE, ML_DEFAULT, ML_REPACK, ML_TRANSFORM, narUnpackDirectory, outputDirectory, packLevel, PL_CACHED_CAB, PL_CULTURE_CAB, PL_DEFAULT, PL_MST, PL_PACKAGE, PL_TRANS_CAB, PL_WIXPDBFields inherited from class com.github.wix_maven.AbstractWixMojo
compilePerLocale, harvestInputDirectory, intDirectory, localeList, PACK_BUNDLE, PACK_INSTALL, PACK_LIB, PACK_MERGE, PACK_MSIX, PACK_PATCH, packaging, project, reactorProjects, relativeBase, remoteArtifactRepositories, remoteRepos, repoSession, repoSystem, skip, suppress, toolDirectory, toolDirectoryOverwrite, toolsPluginArtifactId, unpackDirectory, validate, verbose, warn, wixExtensions, wxsGeneratedDirectory, wxsInputDirectory, zipUnArchiverFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddOtherOptions(org.codehaus.plexus.util.cli.Commandline cl) protected voidaddValidationOptions(org.codehaus.plexus.util.cli.Commandline cl) voidexecute()protected Set<org.apache.maven.artifact.Artifact>protected Set<org.apache.maven.artifact.Artifact>getJARDependencySets(org.apache.maven.artifact.Artifact inputArtifact) protected org.apache.maven.artifact.ArtifactgetRelatedArtifact(ArtifactItem artifactItem, String arch, String culture, String type) Based on Maven-dependency-plugin AbstractFromConfigurationMojo.protected FilegetRelatedArtifactFiles(org.apache.maven.artifact.Artifact artifact) protected voidPrepare and execute the Uber pyro commandlineprotected voidpyro(File pyroTool, org.apache.maven.artifact.Artifact baseInputArtifact, org.apache.maven.artifact.Artifact latestInputArtifact, String arch, File patchInputFile, File transformInputFile, File archOutputFile) Prepare and execute pyro commandline toolprotected voidpyro(org.codehaus.plexus.util.cli.Commandline cl) Execute the given command line parsing output for pyro commentsprotected Set<org.apache.maven.artifact.Artifact>resolveArtifactDependencies(org.apache.maven.artifact.Artifact artifact) This method resolves all transitive dependencies of an artifact.protected StringMethods inherited from class com.github.wix_maven.AbstractTorchMojo
addTorchOptions, torch, torch, validateToolMethods inherited from class com.github.wix_maven.AbstractPackageable
alternateCulturespecs, baseCulturespec, defaultLocale, getExternalCabs, getOutput, getPackageOutputExtension, getPackaging, languagesMethods inherited from class com.github.wix_maven.AbstractWixMojo
addExtension, addToolsetGeneralOptions, addWixExtensions, cleanupFileBasedResources, culturespecs, findToolsArtifact, findToolsArtifacts, getArchIntDirectory, getCommandBuilder, getExtDependencySets, getJARDependencySets, getLocales, getNPANDAYDependencySets, getOutput, getOutputPath, getPlatforms, getPrimaryCulture, getRelatedArtifacts, getRelative, getRelativePath, getWixDependencySets, getWixVersion, resolveArtifact, resolveArtifact, setLocales, setPlatforms, unpackFileBasedResources, wixUnpackDirectoryMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
baseline
Baseline id... needs to match the baseline in the patch file, why then is it needed...I don't get how this works... Can we just read this from the input xml? -
mavenProjectBuilder
@Component protected org.apache.maven.project.MavenProjectBuilder mavenProjectBuilderProject builder -- builds a model from a pom.xml
-
-
Constructor Details
-
PatchMojo
public PatchMojo()
-
-
Method Details
-
addValidationOptions
protected void addValidationOptions(org.codehaus.plexus.util.cli.Commandline cl) - Specified by:
addValidationOptionsin classAbstractTorchMojo
-
addOtherOptions
protected void addOtherOptions(org.codehaus.plexus.util.cli.Commandline cl) -
torchOutputExtension
- Specified by:
torchOutputExtensionin classAbstractTorchMojo
-
getJARDependencySets
protected Set<org.apache.maven.artifact.Artifact> getJARDependencySets(org.apache.maven.artifact.Artifact inputArtifact) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
pyro
protected void pyro(File pyroTool, org.apache.maven.artifact.Artifact baseInputArtifact, org.apache.maven.artifact.Artifact latestInputArtifact, String arch, File patchInputFile, File transformInputFile, File archOutputFile) throws org.apache.maven.plugin.MojoExecutionException Prepare and execute pyro commandline tool- Parameters:
pyroTool- pyro executable to run.baseInputArtifact- baseline artifact, used to source bind paths.latestInputArtifact- latest artifact, used to source bind paths.arch- target architecture.patchInputFile- patch input file.transformInputFile- transform input file.archOutputFile- output file to generate.- Throws:
org.apache.maven.plugin.MojoExecutionException- if pyro execution fails.
-
pyro
protected void pyro(File pyroTool, File patchInputFile, Map<String, File> transformInputFiles, File archOutputFile) throws org.apache.maven.plugin.MojoExecutionExceptionPrepare and execute the Uber pyro commandline- Parameters:
pyroTool- pyro executable to run.patchInputFile- patch input file.transformInputFiles- transforms keyed by culture.archOutputFile- output file to generate.- Throws:
org.apache.maven.plugin.MojoExecutionException- if pyro execution fails.
-
pyro
protected void pyro(org.codehaus.plexus.util.cli.Commandline cl) throws org.apache.maven.plugin.MojoExecutionException Execute the given command line parsing output for pyro comments- Parameters:
cl- prepared pyro command line.- Throws:
org.apache.maven.plugin.MojoExecutionException- if pyro execution fails.
-
getDependencySets
protected Set<org.apache.maven.artifact.Artifact> getDependencySets() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
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
-
getRelatedArtifact
protected org.apache.maven.artifact.Artifact getRelatedArtifact(ArtifactItem artifactItem, String arch, String culture, String type) throws org.apache.maven.plugin.MojoExecutionException Based on Maven-dependency-plugin AbstractFromConfigurationMojo. Resolves the Artifact from the remote repository if necessary. If no version is specified, it will be retrieved from the dependency list or from the DependencyManagement section of the pom.- Parameters:
artifactItem- containing information about artifact from plugin configuration.arch- target architecture classifier prefix.culture- target culture, or null for neutral.type- artifact type to resolve.- Returns:
- Artifact object representing the specified file.
- Throws:
org.apache.maven.plugin.MojoExecutionException- with a message if the version can't be found in DependencyManagement.
-
getRelatedArtifactFiles
protected File getRelatedArtifactFiles(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
resolveArtifactDependencies
protected Set<org.apache.maven.artifact.Artifact> resolveArtifactDependencies(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.artifact.resolver.ArtifactResolutionException, org.apache.maven.artifact.resolver.ArtifactNotFoundException, org.apache.maven.project.ProjectBuildingException, org.apache.maven.project.artifact.InvalidDependencyVersionException, org.apache.maven.plugin.MojoExecutionException This method resolves all transitive dependencies of an artifact.- Parameters:
artifact- the artifact used to retrieve dependencies- Returns:
- resolved set of dependencies
- Throws:
org.apache.maven.artifact.resolver.ArtifactResolutionException- if dependency artifacts cannot be resolved.org.apache.maven.artifact.resolver.ArtifactNotFoundException- if a required artifact cannot be found.org.apache.maven.project.ProjectBuildingException- if Maven project metadata cannot be built.org.apache.maven.project.artifact.InvalidDependencyVersionException- if a dependency version is invalid.org.apache.maven.plugin.MojoExecutionException- if dependency resolution fails unexpectedly.
-