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 Details

    • skip

      @Parameter(property="wix.skip", defaultValue="false") protected boolean skip
      Skip running of all wix plugin goals altogether.
    • packaging

      @Parameter(property="wix.packaging", defaultValue="${project.packaging}", required=true) protected String packaging
      The 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 wxsInputDirectory
      The 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 wxsGeneratedDirectory
      Generated sources directory
    • validate

      @Parameter(property="wix.validate", defaultValue="unit") protected String 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 verbose
      Show additional info such as the wix toolset logo
    • suppress

      @Parameter protected Set<String> 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

      @Parameter protected Set<String> warn
      Treat specific warning messages as errors [-w]
      • x<N> suppress a specific message ID (example: x1011 x1012)
    • localeList

      @Parameter protected Map<String,String> 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 harvestInputDirectory
      Harvest input sources directory
    • intDirectory

      @Parameter(property="wix.intDirectory", defaultValue="${project.build.directory}/wixobj/Release", required=true) protected File intDirectory
      Intermediate directory - will have ${arch} appended - may have ${locale} appended, when using compilePerLocale
    • compilePerLocale

      @Parameter(property="wix.compilePerLocale", defaultValue="false") protected boolean compilePerLocale
      Wix 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 toolDirectory
      Where 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 toolDirectoryOverwrite
      When 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 unpackDirectory
      Unpack directory for dependent wix objects
    • relativeBase

      @Parameter(property="wix.relativeBase", defaultValue="${project.basedir}") protected File relativeBase
      A 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 toolsPluginArtifactId
      Artifact 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 zipUnArchiver
      The Zip archiver.
    • reactorProjects

      @Parameter(defaultValue="${reactorProjects}", readonly=true, required=true) protected List<org.apache.maven.project.MavenProject> reactorProjects
      To search for artifacts within the reactor and ensure consistent behaviour between Maven 2 and Maven 3.
    • repoSystem

      @Component protected org.eclipse.aether.RepositorySystem repoSystem
      The entry point to Aether, i.e. the component doing all the work.
    • repoSession

      @Parameter(defaultValue="${repositorySystemSession}", readonly=true) protected org.eclipse.aether.RepositorySystemSession repoSession
      The current repository/network configuration of Maven.
    • remoteRepos

      @Parameter(defaultValue="${project.remoteProjectRepositories}", readonly=true) protected List<org.eclipse.aether.repository.RemoteRepository> remoteRepos
      The project's remote repositories to use for the resolution.
    • wixExtensions

      @Parameter protected Set<String> wixExtensions
      v4-style NuGet extension names to pass as -ext <name> on the WiX v4+ unified CLI. Ignored when using WiX v3 (use Maven wixext dependencies 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 remoteArtifactRepositories
      Remote repositories which will be searched for attachments.
    • project

      @Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
      The Project
    • PACK_LIB

      public final String PACK_LIB
      See Also:
    • PACK_MERGE

      public final String PACK_MERGE
      See Also:
    • PACK_INSTALL

      public final String PACK_INSTALL
      See Also:
    • PACK_PATCH

      public final String PACK_PATCH
      See Also:
    • PACK_BUNDLE

      public final String PACK_BUNDLE
      See Also:
    • PACK_MSIX

      public final String PACK_MSIX
      See Also:
  • Constructor Details

    • AbstractWixMojo

      public AbstractWixMojo()
  • Method Details

    • getWixVersion

      protected WixToolsetVersion getWixVersion()
      Detect and return the WiX toolset version in use. Result is cached after the first call.
      Returns:
      detected WiX toolset version.
    • getCommandBuilder

      protected WixToolsetCommandBuilder getCommandBuilder()
      Return the WixToolsetCommandBuilder appropriate for the detected toolset version. Result is cached after the first call.
      Returns:
      command builder matching the active toolset version.
    • getPlatforms

      protected Set<String> getPlatforms()
    • setPlatforms

      protected void setPlatforms(Set<String> platforms)
    • getArchIntDirectory

      protected File getArchIntDirectory(String arch, String culture)
    • 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

      protected void addExtension(org.codehaus.plexus.util.cli.Commandline cl, String extFile)
    • addWixExtensions

      protected void addWixExtensions(org.codehaus.plexus.util.cli.Commandline cl) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getOutput

      protected File getOutput(File baseDir, String arch, String culture, String extension)
    • getOutputPath

      protected File getOutputPath(File baseDir, String arch, String culture)
    • 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

      protected File wixUnpackDirectory(org.apache.maven.artifact.Artifact wixArtifact)
    • getPrimaryCulture

      public static final String getPrimaryCulture(String culturespec)
    • getRelative

      protected String getRelative(File target)
    • 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

      public static String getRelativePath(String base, File targetFile)
      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

      public String getLocales()
    • setLocales

      public void setLocales(String locales_)
    • culturespecs

      protected Set<String> culturespecs()