Package com.github.wix_maven
Class AbstractWixMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.github.wix_maven.AbstractWixMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractCompilerMojo,AbstractPackageable,ToolsetMojo,UnpackDependenciesMojo
public abstract class AbstractWixMojo
extends org.apache.maven.plugin.AbstractMojo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWix generates Id's during compilation, in some cases it is necessary to get unique id's for each locale.protected FileHarvest input sources directoryprotected FileIntermediate directory - will have ${arch} appended - may have ${locale} appended, when using compilePerLocaleA locale is a language id + a culture specification each culture specification can contain a semicolon (;) separated list of cultures, this is an ordered list to fall back.final Stringfinal Stringfinal Stringfinal Stringfinal Stringfinal Stringprotected StringThe output type: msi - Windows installer msm - Merge Module wixlib - Wix library msp - Windows patch bundle - wix bootstrapperprotected org.apache.maven.project.MavenProjectThe Projectprotected List<org.apache.maven.project.MavenProject>To search for artifacts within the reactor and ensure consistent behaviour between Maven 2 and Maven 3.protected FileA relative base path to shorten command line references to files in the project.protected ListRemote repositories which will be searched for attachments.protected List<org.eclipse.aether.repository.RemoteRepository>The project's remote repositories to use for the resolution.protected org.eclipse.aether.RepositorySystemSessionThe current repository/network configuration of Maven.protected org.eclipse.aether.RepositorySystemThe entry point to Aether, i.e.protected booleanSkip running of all wix plugin goals altogether.Suppress [-s] com suppress COM elements frag suppress fragments rd suppress harvesting the root directory as an element reg suppress registry harvesting uid suppress unique identifiers for files, components and directories vb6 suppress VB6 COM elements w<N> suppress all warnings or a specific message ID (example: w1011 w1012)protected FileWhere to unpack the wix tools TODO: might need to do something about including tools version in path, or manage the unpacking more cleanlyprotected booleanWhen to unpack the wix tools.protected StringArtifact id of the toolset jar to unpack.protected FileUnpack directory for dependent wix objectsprotected StringShould validation be run, and when.protected booleanShow additional info such as the wix toolset logoTreat specific warning messages as errors [-w] x<N> suppress a specific message ID (example: x1011 x1012)v4-style NuGet extension names to pass as-ext <name>on the WiX v4+ unified CLI.protected FileGenerated sources directoryprotected FileThe directory to scan for wix files.protected org.codehaus.plexus.archiver.zip.ZipUnArchiverThe Zip archiver.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddExtension(org.codehaus.plexus.util.cli.Commandline cl, String extFile) protected voidaddToolsetGeneralOptions(org.codehaus.plexus.util.cli.Commandline cl) protected voidaddWixExtensions(org.codehaus.plexus.util.cli.Commandline cl) protected voidprotected org.apache.maven.artifact.ArtifactfindToolsArtifact(String pluginGroupId, String pluginArtifactId, String pluginClassifier, String pluginType) protected org.apache.maven.artifact.Artifact[]protected FilegetArchIntDirectory(String arch, String culture) protected WixToolsetCommandBuilderReturn theWixToolsetCommandBuilderappropriate for the detected toolset version.protected Set<org.apache.maven.artifact.Artifact>protected Set<org.apache.maven.artifact.Artifact>protected Set<org.apache.maven.artifact.Artifact>protected Fileprotected FilegetOutputPath(File baseDir, String arch, String culture) static final StringgetPrimaryCulture(String culturespec) protected Set<org.apache.maven.artifact.Artifact>getRelatedArtifacts(org.apache.maven.artifact.Artifact artifactItem, String arch, String culture) Based on Maven-dependency-plugin AbstractFromConfigurationMojo.protected StringgetRelative(File target) static StringgetRelativePath(String base, File targetFile) Returns a relative path for the targetFile relative to the base directory.protected Set<org.apache.maven.artifact.Artifact>protected WixToolsetVersionDetect and return the WiX toolset version in use.protected voidresolveArtifact(String groupId, String artifactId, String type, Set<org.apache.maven.artifact.Artifact> artifactSet, org.apache.maven.artifact.versioning.VersionRange vr, String classifier) protected org.eclipse.aether.resolution.ArtifactResultresolveArtifact(org.eclipse.aether.artifact.Artifact artifact) voidsetLocales(String locales_) protected voidsetPlatforms(Set<String> platforms) protected voidprotected FilewixUnpackDirectory(org.apache.maven.artifact.Artifact wixArtifact) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
skip
@Parameter(property="wix.skip", defaultValue="false") protected boolean skipSkip running of all wix plugin goals altogether. -
packaging
@Parameter(property="wix.packaging", defaultValue="${project.packaging}", required=true) protected String packagingThe output type:- msi - Windows installer
- msm - Merge Module
- wixlib - Wix library
- msp - Windows patch
- bundle - wix bootstrapper
-
wxsInputDirectory
@Parameter(property="wix.wxsInputDirectory", defaultValue="${project.basedir}/src/main/wix", required=true) protected File wxsInputDirectoryThe directory to scan for wix files. For each build type there is at least one wxs file required -
wxsGeneratedDirectory
@Parameter(property="wix.wxsGeneratedDirectory", defaultValue="${project.build.directory}/generated-sources/wixharvest", required=true) protected File wxsGeneratedDirectoryGenerated sources directory -
validate
Should validation be run, and when.- linking - Run validation during linking from light/lit.
- unit - Run validation as unit test, suppressing validation during linking (light/lit).
- both - Run validation during linking from light/lit and also as unit test.
- suppress - Suppressing validation during linking (light/lit)
-
verbose
@Parameter(property="wix.verbose", defaultValue="false") protected boolean verboseShow additional info such as the wix toolset logo -
suppress
Suppress [-s]- com suppress COM elements
- frag suppress fragments
- rd suppress harvesting the root directory as an element
- reg suppress registry harvesting
- uid suppress unique identifiers for files, components and directories
- vb6 suppress VB6 COM elements
- w<N> suppress all warnings or a specific message ID (example: w1011 w1012)
-
warn
Treat specific warning messages as errors [-w]- x<N> suppress a specific message ID (example: x1011 x1012)
-
localeList
A locale is a language id + a culture specification each culture specification can contain a semicolon (;) separated list of cultures, this is an ordered list to fall back. ie. <localeList> <1033>en-US</1033> <1031<de-DE;en-US</1031> </localeList< Will add to light -cultures:culturespec
Will add to link each culture to the path as part of -b options - maybe should also add langid to path as -b option
Will use language id for re-packing mst bug: maven gives us a map of it's choice, rather than setting an item at a time, thus losing the prefered ordered set. -
harvestInputDirectory
@Parameter(property="wix.harvestInputDirectory", defaultValue="${project.build.directory}/heat", required=true) protected File harvestInputDirectoryHarvest input sources directory -
intDirectory
@Parameter(property="wix.intDirectory", defaultValue="${project.build.directory}/wixobj/Release", required=true) protected File intDirectoryIntermediate directory - will have ${arch} appended - may have ${locale} appended, when using compilePerLocale -
compilePerLocale
@Parameter(property="wix.compilePerLocale", defaultValue="false") protected boolean compilePerLocaleWix generates Id's during compilation, in some cases it is necessary to get unique id's for each locale. Useful for Patch MSP, may be useful for MSI. Ignored for Wixlib. -
toolDirectory
@Parameter(property="wix.toolsPath", defaultValue="${project.build.directory}/wix-tools", required=true) protected File toolDirectoryWhere to unpack the wix tools TODO: might need to do something about including tools version in path, or manage the unpacking more cleanly -
toolDirectoryOverwrite
@Parameter(property="wix.toolDirectoryOverwrite", defaultValue="true", required=true) protected boolean toolDirectoryOverwriteWhen to unpack the wix tools. Default is to unpack the tools every time and overwrite, set to false to only overwrite if the tools are newer. This is provided to allow newer WIX test binaries to be dropped in, rather than having to install/deploy the wix-tools. -
unpackDirectory
@Parameter(property="wix.unpackDirectory", defaultValue="${project.build.directory}/unpack", required=true) protected File unpackDirectoryUnpack directory for dependent wix objects -
relativeBase
@Parameter(property="wix.relativeBase", defaultValue="${project.basedir}") protected File relativeBaseA relative base path to shorten command line references to files in the project. Default is the project base directory, if alternate locations are given for wxs, wxl files it may be appropriate to change this. -
toolsPluginArtifactId
@Parameter(property="wix.toolsPluginArtifactId", defaultValue="wix-toolset") protected String toolsPluginArtifactIdArtifact id of the toolset jar to unpack. -
zipUnArchiver
@Component(role=org.codehaus.plexus.archiver.UnArchiver.class, hint="zip") protected org.codehaus.plexus.archiver.zip.ZipUnArchiver zipUnArchiverThe Zip archiver. -
reactorProjects
@Parameter(defaultValue="${reactorProjects}", readonly=true, required=true) protected List<org.apache.maven.project.MavenProject> reactorProjectsTo search for artifacts within the reactor and ensure consistent behaviour between Maven 2 and Maven 3. -
repoSystem
@Component protected org.eclipse.aether.RepositorySystem repoSystemThe entry point to Aether, i.e. the component doing all the work. -
repoSession
@Parameter(defaultValue="${repositorySystemSession}", readonly=true) protected org.eclipse.aether.RepositorySystemSession repoSessionThe current repository/network configuration of Maven. -
remoteRepos
@Parameter(defaultValue="${project.remoteProjectRepositories}", readonly=true) protected List<org.eclipse.aether.repository.RemoteRepository> remoteReposThe project's remote repositories to use for the resolution. -
wixExtensions
v4-style NuGet extension names to pass as-ext <name>on the WiX v4+ unified CLI. Ignored when using WiX v3 (use Mavenwixextdependencies instead). Example:<wixExtensions> <ext>WixToolset.UI.wixext</ext> <ext>WixToolset.Util.wixext</ext> </wixExtensions> -
remoteArtifactRepositories
@Parameter(defaultValue="${project.remoteArtifactRepositories}", readonly=true, required=true) protected List remoteArtifactRepositoriesRemote repositories which will be searched for attachments. -
project
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject projectThe Project -
PACK_LIB
- See Also:
-
PACK_MERGE
- See Also:
-
PACK_INSTALL
- See Also:
-
PACK_PATCH
- See Also:
-
PACK_BUNDLE
- See Also:
-
PACK_MSIX
- See Also:
-
-
Constructor Details
-
AbstractWixMojo
public AbstractWixMojo()
-
-
Method Details
-
getWixVersion
Detect and return the WiX toolset version in use. Result is cached after the first call.- Returns:
- detected WiX toolset version.
-
getCommandBuilder
Return theWixToolsetCommandBuilderappropriate for the detected toolset version. Result is cached after the first call.- Returns:
- command builder matching the active toolset version.
-
getPlatforms
-
setPlatforms
-
getArchIntDirectory
-
findToolsArtifacts
protected org.apache.maven.artifact.Artifact[] findToolsArtifacts() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
findToolsArtifact
protected org.apache.maven.artifact.Artifact findToolsArtifact(String pluginGroupId, String pluginArtifactId, String pluginClassifier, String pluginType) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
unpackFileBasedResources
protected void unpackFileBasedResources() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
cleanupFileBasedResources
protected void cleanupFileBasedResources() -
resolveArtifact
protected void resolveArtifact(String groupId, String artifactId, String type, Set<org.apache.maven.artifact.Artifact> artifactSet, org.apache.maven.artifact.versioning.VersionRange vr, String classifier) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
resolveArtifact
protected org.eclipse.aether.resolution.ArtifactResult resolveArtifact(org.eclipse.aether.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
addExtension
-
addWixExtensions
protected void addWixExtensions(org.codehaus.plexus.util.cli.Commandline cl) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
getOutput
-
getOutputPath
-
getExtDependencySets
protected Set<org.apache.maven.artifact.Artifact> getExtDependencySets() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
addToolsetGeneralOptions
protected void addToolsetGeneralOptions(org.codehaus.plexus.util.cli.Commandline cl) -
getJARDependencySets
protected Set<org.apache.maven.artifact.Artifact> getJARDependencySets() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getNPANDAYDependencySets
protected Set<org.apache.maven.artifact.Artifact> getNPANDAYDependencySets() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getWixDependencySets
protected Set<org.apache.maven.artifact.Artifact> getWixDependencySets() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
wixUnpackDirectory
-
getPrimaryCulture
-
getRelative
-
getRelatedArtifacts
protected Set<org.apache.maven.artifact.Artifact> getRelatedArtifacts(org.apache.maven.artifact.Artifact artifactItem, String arch, String culture) 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.- 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.
-
getRelativePath
Returns a relative path for the targetFile relative to the base directory. - copied from Ant CPPTasks- Parameters:
base- base directory as returned by File.getCanonicalPath()targetFile- target file- Returns:
- relative path of target file. Returns targetFile if there were no commonalities between the base and the target
-
getLocales
-
setLocales
-
culturespecs
-