[
  {
    "path": ".claude/settings.json",
    "content": "{\n  \"permissions\": {\n    \"allow\": [\n      \"WebFetch(domain:github.com)\",\n      \"Bash(mvn test:*)\",\n      \"Bash(javac:*)\",\n      \"Bash(java:*)\",\n      \"mcp__jetbrains\"\n    ],\n    \"deny\": []\n  }\n}\n"
  },
  {
    "path": ".github/FUNDING.yaml",
    "content": "# These are supported funding model platforms\n\ngithub: [lukaszlenart] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]\npatreon: # Replace with a single Patreon username\nopen_collective: # Replace with a single Open Collective username\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\nliberapay: # Replace with a single Liberapay username\nissuehunt: # Replace with a single IssueHunt username\notechie: # Replace with a single Otechie username\nlfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry\ncustom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']\n"
  },
  {
    "path": ".github/workflows/maven.yml",
    "content": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nname: Java CI\n\non:\n  pull_request:\n  push:\n    branches:\n      - main\n  workflow_dispatch:\n\n# Sets permissions of the GITHUB_TOKEN to allow to apply a label and merge\n# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions\npermissions:\n  contents: write\n  issues: write\n  pull-requests: write\n  repository-projects: write\n\nconcurrency: ci-${{ github.ref }}\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        java: [ 17, 21, 25 ]\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v6.0.2\n      - name: Set up cache\n        uses: actions/cache@v5.0.5\n        with:\n          path: ~/.m2/repository\n          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}\n          restore-keys: |\n            ${{ runner.os }}-maven-\n      - name: Set up JDK ${{ matrix.java }}\n        uses: actions/setup-java@v5\n        with:\n          distribution: adopt\n          java-version: ${{ matrix.java }}\n      - name: Build with Maven on Java ${{ matrix.java }}\n        run: mvn -V test -Ddoclint=all --file pom.xml --no-transfer-progress\n"
  },
  {
    "path": ".gitignore",
    "content": "*.ipr\n*.iml\n*.iws\n.settings/*\n.project\n.classpath\n.factorypath\ntarget/\n.idea/\n.java-version\n.mvn/wrapper/maven-wrapper.jar\n.DS_Store\n.claude/settings.local.json\n"
  },
  {
    "path": ".mvn/extensions.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<extensions>\n    <extension>\n      <groupId>fr.jcgay.maven</groupId>\n      <artifactId>maven-profiler</artifactId>\n      <version>3.2</version>\n    </extension>\n</extensions>\n"
  },
  {
    "path": ".mvn/maven.config",
    "content": "-Daether.checksums.algorithms=SHA-512,SHA-256,SHA-1,MD5\n-Daether.connector.smartChecksums=false\n"
  },
  {
    "path": ".mvn/wrapper/MavenWrapperDownloader.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *  http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.Authenticator;\nimport java.net.PasswordAuthentication;\nimport java.net.URI;\nimport java.net.URL;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.StandardCopyOption;\nimport java.util.concurrent.ThreadLocalRandom;\n\npublic final class MavenWrapperDownloader {\n    private static final String WRAPPER_VERSION = \"3.3.4\";\n\n    private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv(\"MVNW_VERBOSE\"));\n\n    public static void main(String[] args) {\n        log(\"Apache Maven Wrapper Downloader \" + WRAPPER_VERSION);\n\n        if (args.length != 2) {\n            System.err.println(\" - ERROR wrapperUrl or wrapperJarPath parameter missing\");\n            System.exit(1);\n        }\n\n        try {\n            log(\" - Downloader started\");\n            final URL wrapperUrl = URI.create(args[0]).toURL();\n            final Path baseDir = Paths.get(\".\").toAbsolutePath().normalize();\n            final Path wrapperJarPath = baseDir.resolve(args[1]).normalize();\n            if (!wrapperJarPath.startsWith(baseDir)) {\n                throw new IOException(\"Invalid path: outside of allowed directory\");\n            }\n            downloadFileFromURL(wrapperUrl, wrapperJarPath);\n            log(\"Done\");\n        } catch (IOException e) {\n            System.err.println(\"- Error downloading: \" + e.getMessage());\n            if (VERBOSE) {\n                e.printStackTrace();\n            }\n            System.exit(1);\n        }\n    }\n\n    private static void downloadFileFromURL(URL wrapperUrl, Path wrapperJarPath)\n            throws IOException {\n        log(\" - Downloading to: \" + wrapperJarPath);\n        if (System.getenv(\"MVNW_USERNAME\") != null && System.getenv(\"MVNW_PASSWORD\") != null) {\n            final String username = System.getenv(\"MVNW_USERNAME\");\n            final char[] password = System.getenv(\"MVNW_PASSWORD\").toCharArray();\n            Authenticator.setDefault(new Authenticator() {\n                @Override\n                protected PasswordAuthentication getPasswordAuthentication() {\n                    return new PasswordAuthentication(username, password);\n                }\n            });\n        }\n        Path temp = wrapperJarPath\n                .getParent()\n                .resolve(wrapperJarPath.getFileName() + \".\"\n                        + Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + \".tmp\");\n        try (InputStream inStream = wrapperUrl.openStream()) {\n            Files.copy(inStream, temp, StandardCopyOption.REPLACE_EXISTING);\n            Files.move(temp, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING);\n        } finally {\n            Files.deleteIfExists(temp);\n        }\n        log(\" - Downloader complete\");\n    }\n\n    private static void log(String msg) {\n        if (VERBOSE) {\n            System.out.println(msg);\n        }\n    }\n\n}\n"
  },
  {
    "path": ".mvn/wrapper/maven-wrapper.properties",
    "content": "wrapperVersion=3.3.4\ndistributionType=source\ndistributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip\nwrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar\n"
  },
  {
    "path": "CLAUDE.md",
    "content": "# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nThis is a Maven plugin that wraps JAR files into Windows executables using Launch4j. The plugin allows generating\nWindows `.exe` files from Java applications as part of the Maven build process.\n\n**Requirements:**\n\n- Java 17 (specified in `<maven.compiler.target>` in pom.xml)\n- Maven 3.6.x or higher\n\n## Build Commands\n\n```bash\n# Build the project\n./mvnw clean install\n\n# Run tests only\n./mvnw test\n\n# Run a single test class\n./mvnw test -Dtest=Launch4jMojoTest\n\n# Run a single test method\n./mvnw test -Dtest=Launch4jMojoTest#testConfigurationWithIcon\n\n# Skip tests during build\n./mvnw clean install -DskipTests\n\n# Generate site documentation\n./mvnw site\n```\n\n## Architecture\n\n### Core Components\n\n- **`Launch4jMojo`** (`src/main/java/.../Launch4jMojo.java`) - The main Maven Mojo that executes during the `package`\n  phase. Handles:\n    - Loading configuration (either from POM or external Launch4j XML config via `<infile>`)\n    - Downloading platform-specific Launch4j binaries (win32, linux, linux64, mac, solaris)\n    - Building the Windows executable using Launch4j's `Builder`\n\n- **Configuration POJOs** - Mirror Launch4j's XML configuration structure:\n    - `ClassPath` - Classpath configuration with Maven dependency support\n    - `Jre` - JRE path and version requirements\n    - `VersionInfo` - Windows executable version information\n    - `Splash` - Splash screen configuration\n    - `SingleInstance` - Mutex-based single instance support\n    - `Messages` - Custom error messages\n\n- **`generators/`** - Default value generators:\n    - `CopyrightGenerator` - Generates copyright string from project metadata\n    - `Launch4jFileVersionGenerator` - Converts Maven version to Windows version format (x.x.x.x)\n\n### Plugin Configuration\n\nThe plugin binds to the `package` phase by default. Key configuration parameters:\n\n- `headerType` - `gui` or `console` (default: `console`)\n- `outfile` - Output executable path\n- `jar` - Input JAR file\n- `skip` / `-DskipLaunch4j` - Skip plugin execution\n- `parallelExecution` - Synchronize execution for thread safety\n\n### Test Structure\n\nTests use `maven-plugin-testing-harness` with mock Maven projects in `src/test/resources/unit/launch4j-config/`.\n\n## Platform-Specific Binaries\n\nLaunch4j requires platform-specific binaries (ld, windres) that are downloaded as Maven artifacts with classifiers like\n`workdir-win32`, `workdir-linux64`, `workdir-mac`. These are unpacked to the local Maven repository and reused.\n"
  },
  {
    "path": "LICENSE",
    "content": "Maven Launch4j Plugin 1.0\nA plugin for using Launch4j in Maven projects.\n\nCopyright (c) 2006 Paul Jungwirth\nCopyright (c) 2011-2025 Lukasz Lenart\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n\nA complete copy of this license may be found in src/main/legal/LICENSE.txt of the source distribution.\n"
  },
  {
    "path": "README.md",
    "content": "# Launch4j Maven Plugin\n\nOriginally hosted at http://9stmaryrd.com/tools/launch4j-maven-plugin/\n\n[![GH Actions](https://github.com/lukaszlenart/launch4j-maven-plugin/actions/workflows/maven.yml/badge.svg)](https://github.com/lukaszlenart/launch4j-maven-plugin/actions/workflows/maven.yml)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.akathist.maven.plugins.launch4j/launch4j-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.akathist.maven.plugins.launch4j/launch4j-maven-plugin/)\n\n - [Documentation](#documentation)\n - [Version Notes](#version-notes)\n - [FAQ](#faq)\n\n# Documentation\n\nPlease check [this](src/main/resources/README.adoc) document for more detailed info on how to use the plugin. \nPlease also check [Launch4j's Configuration file](http://launch4j.sourceforge.net/docs.html#Configuration_file) page.\nThe full list of all the parameters is available [here](src/main/resources/MOJO.md)\n\n**NOTE**: Since version 2.0.x this plugin requires to be used with Maven 3.6.x at least.\n\n# Version Notes\n\nPlease check the [releases](../../releases) page for the exact versions notes\n\n## Version notes 2.3.3 - 2023-03-11\n- updates maven wrapper to official 3.1.1, adds sha-512 & sha-256 checksums, adds a profiler extension,\n  see PR [#252](../../pull/252)\n\n## Version notes 2.3.2 - 2023-01-30\n- fixes broken Project Reports when running `maven-project-info-reports-plugin`, \n  see Issue [#223](../../issues/223) and PR [#227](../../pull/227)\n\n## Version notes 2.3.1 - 2023-01-16\n- logs only warnings instead of throwing exception, when cannot fulfill default values for `<VersionInfo>`\n  (no configuration data required by the formula), see Issue [#213](../../issues/213) and PR [#216](../../pull/216)\n\n## Version notes 2.3.0 - 2023-01-06\n- provides default values for plugin configuration, especially for `<VersionInfo>`, see Issue [#98](../../issues/98)\n- adds a `disableVersionInfoDefaults` parameter to be able to disable provided defaults, see PR [#205](../../pull/205)\n- adds documentation notes regarding a new defaults, see [VERSIONINFO.md](src/main/resources/VERSIONINFO.md)\n- throwing exceptions with detailed description of default values formula, when cannot fulfill default values\n  (no configuration data for a formula), it helps plugin user with debugging what is wrong\n\n## Version notes 2.2.0 - 2022-11-24\n- upgrades Launch4j to version 3.50 and adopts config to the bew requirements, see Issue [#199](../../issues/199)\n  and PR [#200](../../pull/200) for more details what has to be changed \n\n## Version notes 2.1.3 - 2022-10-24\n- allows to skip execution of the plugin using either `<skip>true</skip>` configuration option or `-DskipLaunch4j` property, \n  see [#190](../../pull/190)\n\n## Version notes 2.1.1 - 2021-05-04\n- creates parent folder if `outfile` was configured, see [#141](../../issues/141)\n\n## Version notes 2.1.0 - 2021-05-04\n- upgrades Maven API to version 3.8.1 (it should be compatible with Maven 3.6.x), see [#132](../../pull/132), \n  [#133](../../pull/133), [#134](../../pull/134), [#135](../../pull/135), [#136](../../pull/136)\n\n## Version notes 2.0.1 - 2021-03-21\n- fixes problem with NPE, see [#128](../../issues/128)\n\n## Version notes 2.0.0 - 2021-03-17\n**DO NOT USE THIS VERSION**\n- uses Launch4j version 3.14 (which requires Java 8), see [#126](../../pull/126)\n- switches to Java 8 as minimal supported version\n\n## Version notes 1.7.25\n- creates parent directories of an obj file, see [#99](../../pull/99) \n\n## Version notes 1.7.24\n- adds a `threadSafe` flag to the Mojo to properly mark that the plugin is thread safe, see [#72](../../issues/72) \n\n## Version notes 1.7.23\n- adds a `parallelExecution` flag that will allow to run only one instance of the plugin in the given time, see [#72](../../issues/72) \n\n## Version notes 1.7.22\n- upgrades to Launch4j version 3.12, see [#75](../../issues/75) \n\n## Version notes 1.7.21\n- fixes issue with detecting OSX, see [#58](../../issues/58) \n\n## Version notes 1.7.20\n- uses the `linux64` platform when run on 64-bit Linux, see [#59](../../pull/59) \n\n## Version notes 1.7.19\n- upgrades to the version 3.11 of Launch4j\n\n## Version notes 1.7.18\n- reverts changes introduced in **1.7.17**, see [#55](../../pull/55)\n\n## Version notes 1.7.17\n- adds support for unwrapped jar, see [#55](../../pull/55)\n\n## Version notes 1.7.16\n- detects different OSX versions to properly use proper binary bundle, see [#54](../../pull/54)\n\n## Version notes 1.7.15\n- allows override some properties loaded from an external Launch4j config file, see [#49](../../issues/49)\n\n## Version notes 1.7.14\n- fixes issue with setting `language`, see [#50](../../issues/50)\n\n## Version notes 1.7.13\n- upgrades maven plugins to latest versions, see [#47](../../issues/47)\n\n## Version notes 1.7.12\n- adds support for missing options, see [#45](../../issues/45)\n  - `language` - please use one of the values as defined for the `<language/>` tag\n  - `trademarks` -  a free text used as a trademarks \n\n## Version notes 1.7.11\n- upgrades to Launch4j version 3.9\n\n## Version notes 1.7.10\n- fixes broken `<configuration/>` when not using `<infile/>`\n\n## Version notes 1.7.9\n- adds capability of loading Launch4j native configuration file\n```xml\n<configuration> \n    <infile>${project.basedir}/src/main/resources/my-app-config.xml</infile>\n</configuration>\n```\nBy default it will take from `${project.basedir}/src/main/resources/${project.artifactId}-launch4j.xml`.\nPlugin execution goal should be set to `install`. It's an optional configuration, you can either use your existing configuration as it was in previous version or use native **Launch4j** [config file](http://launch4j.sourceforge.net/docs.html#Configuration_file) via `<infile>`.\n\n## Version notes 1.7.8\n- fixes issue with spaces in path to maven repository on non-Windows systems, see [#27](../../issues/27), [#28](../../issues/28)\n\n## Version notes 1.7.7\n- once again fixes problem with including dependencies in scope `runtime` (now it should be the final solution), see [#5](../../issues/5)\n- adds support for `bundledJreAsFallback` and `bundledJre64Bit` properties, see [#23](../../issues/23)\n- upgrades Launch4j to 3.8.0, see [#21](../../issues/21)\n\n## Version notes 1.7.6\n- fixes again problem with including dependencies in scope `runtime`, see [#5](../../issues/5)\n\n## Version notes 1.7.5\n- allows add custom headers and libraries to working dir  [#22](../../pull/22)\n\n## Version notes 1.7.4\n- fixes type in default value for `outfile` parameter  [#17](../../pull/17)\n\n## Version notes 1.7.3\n- uses Maven annotation instead of JavaDoc parameters [#15](../../pull/15)\n- upgrades Maven plugins [#15](../../pull/15)\n- converts tabs to spaces [5b0619](../../commit/5b0619)\n\n## Version notes 1.7.2\n- adds support for `restartOnCrash` Launch4j's option [#14](../../pull/14)\n\n## Version notes 1.7.1\n- launch4j's `abeille` dependency was excluded [#11](../../pull/11)\n- versions of several plugins were updated [#11](../../pull/11)\n- tabs were converted to spaces [#11](../../pull/11)\n\n## Version notes 1.7\n- uses the latest version of Launch4j (3.5.0)\n- contains support for `runtimeBits`, see [#6](../../issues/6)\n- ~~fixes problem with including dependencies in scope `runtime`, see [#5](../../issues/5)~~\n\n## Version notes 1.6\n- dropped Launch4j source and based on artifacts from Maven Central, see [#8](../../issues/8)\n- uses the latest version of Launch4j (3.4.0)\n- at least Java 1.7 is required\n\n# FAQ\nQ: I cannot build my project because `dsol-xml` dependency is missing?\n\nA: Add this repository to your `~/.m2/settings.xml`\n\n```xml\n<repositories>\n    <repository>\n        <id>dsol-xml</id>\n        <name>Simulation @ TU Delft</name>\n        <url>http://simulation.tudelft.nl/maven/</url>\n    </repository>\n</repositories>\n```\nQ: Where can I find -SNAPSHOT builds?\n\nA: Use the Sonatype OSS repo\n\n```xml\n<repositories>\n    <repository>\n        <id>sonatype-nexus-snapshots</id>\n        <name>Sonatype Nexus Snapshots</name>\n        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>\n        <releases>\n            <enabled>false</enabled>\n        </releases>\n        <snapshots>\n            <enabled>true</enabled>\n        </snapshots>\n    </repository>\n</repositories>\n```\n\nQ: Can I use Launch4j on 64bit OS?\n\nA: Yes but you will have to install these libs to avoid problems:\n\n - lib32z1\n - lib32ncurses5\n - lib32bz2-1.0 (has been ia32-libs in older Ubuntu versions)\n - zlib.i686\n - ncurses-libs.i686\n - bzip2-libs.i686\n\nSee [#4](../../issues/4) for more details.\n\nQ: How can I skip execution of the plugin?\n\nA: You can either use `<skip>true</skip>` configuration option or provide `-DskipLaunch4j` property to JVM\n\nSee PR [#190](../../pull/190) for more details.\n"
  },
  {
    "path": "mvnw",
    "content": "#!/bin/sh\n# ----------------------------------------------------------------------------\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n# ----------------------------------------------------------------------------\n\n# ----------------------------------------------------------------------------\n# Apache Maven Wrapper startup batch script, version 3.3.4\n#\n# Required ENV vars:\n# ------------------\n#   JAVA_HOME - location of a JDK home dir\n#\n# Optional ENV vars\n# -----------------\n#   MAVEN_OPTS - parameters passed to the Java VM when running Maven\n#     e.g. to debug Maven itself, use\n#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000\n#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files\n# ----------------------------------------------------------------------------\n\nif [ -z \"$MAVEN_SKIP_RC\" ]; then\n\n  if [ -f /usr/local/etc/mavenrc ]; then\n    . /usr/local/etc/mavenrc\n  fi\n\n  if [ -f /etc/mavenrc ]; then\n    . /etc/mavenrc\n  fi\n\n  if [ -f \"$HOME/.mavenrc\" ]; then\n    . \"$HOME/.mavenrc\"\n  fi\n\nfi\n\n# OS specific support.  $var _must_ be set to either true or false.\ncygwin=false\ndarwin=false\nmingw=false\ncase \"$(uname)\" in\nCYGWIN*) cygwin=true ;;\nMINGW*) mingw=true ;;\nDarwin*)\n  darwin=true\n  # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home\n  # See https://developer.apple.com/library/mac/qa/qa1170/_index.html\n  if [ -z \"$JAVA_HOME\" ]; then\n    if [ -x \"/usr/libexec/java_home\" ]; then\n      JAVA_HOME=\"$(/usr/libexec/java_home)\"\n      export JAVA_HOME\n    else\n      JAVA_HOME=\"/Library/Java/Home\"\n      export JAVA_HOME\n    fi\n  fi\n  ;;\nesac\n\nif [ -z \"$JAVA_HOME\" ]; then\n  if [ -r /etc/gentoo-release ]; then\n    JAVA_HOME=$(java-config --jre-home)\n  fi\nfi\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched\nif $cygwin; then\n  [ -n \"$JAVA_HOME\" ] \\\n    && JAVA_HOME=$(cygpath --unix \"$JAVA_HOME\")\n  [ -n \"$CLASSPATH\" ] \\\n    && CLASSPATH=$(cygpath --path --unix \"$CLASSPATH\")\nfi\n\n# For Mingw, ensure paths are in UNIX format before anything is touched\nif $mingw; then\n  [ -n \"$JAVA_HOME\" ] && [ -d \"$JAVA_HOME\" ] \\\n    && JAVA_HOME=\"$(\n      cd \"$JAVA_HOME\" || (\n        echo \"cannot cd into $JAVA_HOME.\" >&2\n        exit 1\n      )\n      pwd\n    )\"\nfi\n\nif [ -z \"$JAVA_HOME\" ]; then\n  javaExecutable=\"$(which javac)\"\n  if [ -n \"$javaExecutable\" ] && ! [ \"$(expr \"$javaExecutable\" : '\\([^ ]*\\)')\" = \"no\" ]; then\n    # readlink(1) is not available as standard on Solaris 10.\n    readLink=$(which readlink)\n    if [ ! \"$(expr \"$readLink\" : '\\([^ ]*\\)')\" = \"no\" ]; then\n      if $darwin; then\n        javaHome=\"$(dirname \"$javaExecutable\")\"\n        javaExecutable=\"$(cd \"$javaHome\" && pwd -P)/javac\"\n      else\n        javaExecutable=\"$(readlink -f \"$javaExecutable\")\"\n      fi\n      javaHome=\"$(dirname \"$javaExecutable\")\"\n      javaHome=$(expr \"$javaHome\" : '\\(.*\\)/bin')\n      JAVA_HOME=\"$javaHome\"\n      export JAVA_HOME\n    fi\n  fi\nfi\n\nif [ -z \"$JAVACMD\" ]; then\n  if [ -n \"$JAVA_HOME\" ]; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ]; then\n      # IBM's JDK on AIX uses strange locations for the executables\n      JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n      JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n  else\n    JAVACMD=\"$(\n      \\unset -f command 2>/dev/null\n      \\command -v java\n    )\"\n  fi\nfi\n\nif [ ! -x \"$JAVACMD\" ]; then\n  echo \"Error: JAVA_HOME is not defined correctly.\" >&2\n  echo \"  We cannot execute $JAVACMD\" >&2\n  exit 1\nfi\n\nif [ -z \"$JAVA_HOME\" ]; then\n  echo \"Warning: JAVA_HOME environment variable is not set.\" >&2\nfi\n\n# traverses directory structure from process work directory to filesystem root\n# first directory with .mvn subdirectory is considered project base directory\nfind_maven_basedir() {\n  if [ -z \"$1\" ]; then\n    echo \"Path not specified to find_maven_basedir\" >&2\n    return 1\n  fi\n\n  basedir=\"$1\"\n  wdir=\"$1\"\n  while [ \"$wdir\" != '/' ]; do\n    if [ -d \"$wdir\"/.mvn ]; then\n      basedir=$wdir\n      break\n    fi\n    # workaround for JBEAP-8937 (on Solaris 10/Sparc)\n    if [ -d \"${wdir}\" ]; then\n      wdir=$(\n        cd \"$wdir/..\" || exit 1\n        pwd\n      )\n    fi\n    # end of workaround\n  done\n  printf '%s' \"$(\n    cd \"$basedir\" || exit 1\n    pwd\n  )\"\n}\n\n# concatenates all lines of a file\nconcat_lines() {\n  if [ -f \"$1\" ]; then\n    # Remove \\r in case we run on Windows within Git Bash\n    # and check out the repository with auto CRLF management\n    # enabled. Otherwise, we may read lines that are delimited with\n    # \\r\\n and produce $'-Xarg\\r' rather than -Xarg due to word\n    # splitting rules.\n    tr -s '\\r\\n' ' ' <\"$1\"\n  fi\n}\n\nlog() {\n  if [ \"$MVNW_VERBOSE\" = true ]; then\n    printf '%s\\n' \"$1\"\n  fi\n}\n\nBASE_DIR=$(find_maven_basedir \"$(dirname \"$0\")\")\nif [ -z \"$BASE_DIR\" ]; then\n  exit 1\nfi\n\nMAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-\"$BASE_DIR\"}\nexport MAVEN_PROJECTBASEDIR\nlog \"$MAVEN_PROJECTBASEDIR\"\n\ntrim() {\n  # MWRAPPER-139:\n  #   Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.\n  #   Needed for removing poorly interpreted newline sequences when running in more\n  #   exotic environments such as mingw bash on Windows.\n  printf \"%s\" \"${1}\" | tr -d '[:space:]'\n}\n\n##########################################################################################\n# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central\n# This allows using the maven wrapper in projects that prohibit checking in binary data.\n##########################################################################################\nwrapperJarPath=\"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar\"\nif [ -r \"$wrapperJarPath\" ]; then\n  log \"Found $wrapperJarPath\"\nelse\n  log \"Couldn't find $wrapperJarPath, downloading it ...\"\n\n  if [ -n \"$MVNW_REPOURL\" ]; then\n    wrapperUrl=\"$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar\"\n  else\n    wrapperUrl=\"https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar\"\n  fi\n  while IFS=\"=\" read -r key value; do\n    case \"$key\" in wrapperUrl)\n      wrapperUrl=$(trim \"${value-}\")\n      break\n      ;;\n    esac\n  done <\"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties\"\n  log \"Downloading from: $wrapperUrl\"\n\n  if $cygwin; then\n    wrapperJarPath=$(cygpath --path --windows \"$wrapperJarPath\")\n  fi\n\n  if command -v wget >/dev/null; then\n    log \"Found wget ... using wget\"\n    [ \"$MVNW_VERBOSE\" = true ] && QUIET=\"\" || QUIET=\"--quiet\"\n    if [ -z \"$MVNW_USERNAME\" ] || [ -z \"$MVNW_PASSWORD\" ]; then\n      wget ${QUIET:+\"$QUIET\"} \"$wrapperUrl\" -O \"$wrapperJarPath\" || rm -f \"$wrapperJarPath\"\n    else\n      wget ${QUIET:+\"$QUIET\"} --http-user=\"$MVNW_USERNAME\" --http-password=\"$MVNW_PASSWORD\" \"$wrapperUrl\" -O \"$wrapperJarPath\" || rm -f \"$wrapperJarPath\"\n    fi\n  elif command -v curl >/dev/null; then\n    log \"Found curl ... using curl\"\n    [ \"$MVNW_VERBOSE\" = true ] && QUIET=\"\" || QUIET=\"--silent\"\n    if [ -z \"$MVNW_USERNAME\" ] || [ -z \"$MVNW_PASSWORD\" ]; then\n      curl ${QUIET:+\"$QUIET\"} -o \"$wrapperJarPath\" \"$wrapperUrl\" -f -L || rm -f \"$wrapperJarPath\"\n    else\n      curl ${QUIET:+\"$QUIET\"} --user \"$MVNW_USERNAME:$MVNW_PASSWORD\" -o \"$wrapperJarPath\" \"$wrapperUrl\" -f -L || rm -f \"$wrapperJarPath\"\n    fi\n  else\n    log \"Falling back to using Java to download\"\n    javaSource=\"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java\"\n    javaClass=\"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class\"\n    # For Cygwin, switch paths to Windows format before running javac\n    if $cygwin; then\n      javaSource=$(cygpath --path --windows \"$javaSource\")\n      javaClass=$(cygpath --path --windows \"$javaClass\")\n    fi\n    if [ -e \"$javaSource\" ]; then\n      if [ ! -e \"$javaClass\" ]; then\n        log \" - Compiling MavenWrapperDownloader.java ...\"\n        (\"$JAVA_HOME/bin/javac\" \"$javaSource\")\n      fi\n      if [ -e \"$javaClass\" ]; then\n        log \" - Running MavenWrapperDownloader.java ...\"\n        (\"$JAVA_HOME/bin/java\" -cp .mvn/wrapper MavenWrapperDownloader \"$wrapperUrl\" \"$wrapperJarPath\") || rm -f \"$wrapperJarPath\"\n      fi\n    fi\n  fi\nfi\n##########################################################################################\n# End of extension\n##########################################################################################\n\n# If specified, validate the SHA-256 sum of the Maven wrapper jar file\nwrapperSha256Sum=\"\"\nwhile IFS=\"=\" read -r key value; do\n  case \"$key\" in wrapperSha256Sum)\n    wrapperSha256Sum=$(trim \"${value-}\")\n    break\n    ;;\n  esac\ndone <\"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties\"\nif [ -n \"$wrapperSha256Sum\" ]; then\n  wrapperSha256Result=false\n  if command -v sha256sum >/dev/null; then\n    if echo \"$wrapperSha256Sum  $wrapperJarPath\" | sha256sum -c - >/dev/null 2>&1; then\n      wrapperSha256Result=true\n    fi\n  elif command -v shasum >/dev/null; then\n    if echo \"$wrapperSha256Sum  $wrapperJarPath\" | shasum -a 256 -c >/dev/null 2>&1; then\n      wrapperSha256Result=true\n    fi\n  else\n    echo \"Checksum validation was requested but neither 'sha256sum' or 'shasum' are available.\" >&2\n    echo \"Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties.\" >&2\n    exit 1\n  fi\n  if [ $wrapperSha256Result = false ]; then\n    echo \"Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.\" >&2\n    echo \"Investigate or delete $wrapperJarPath to attempt a clean download.\" >&2\n    echo \"If you updated your Maven version, you need to update the specified wrapperSha256Sum property.\" >&2\n    exit 1\n  fi\nfi\n\nMAVEN_OPTS=\"$(concat_lines \"$MAVEN_PROJECTBASEDIR/.mvn/jvm.config\") $MAVEN_OPTS\"\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin; then\n  [ -n \"$JAVA_HOME\" ] \\\n    && JAVA_HOME=$(cygpath --path --windows \"$JAVA_HOME\")\n  [ -n \"$CLASSPATH\" ] \\\n    && CLASSPATH=$(cygpath --path --windows \"$CLASSPATH\")\n  [ -n \"$MAVEN_PROJECTBASEDIR\" ] \\\n    && MAVEN_PROJECTBASEDIR=$(cygpath --path --windows \"$MAVEN_PROJECTBASEDIR\")\nfi\n\n# Provide a \"standardized\" way to retrieve the CLI args that will\n# work with both Windows and non-Windows executions.\nMAVEN_CMD_LINE_ARGS=\"$MAVEN_CONFIG $*\"\nexport MAVEN_CMD_LINE_ARGS\n\nWRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain\n\n# shellcheck disable=SC2086 # safe args\nexec \"$JAVACMD\" \\\n  $MAVEN_OPTS \\\n  $MAVEN_DEBUG_OPTS \\\n  -classpath \"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar\" \\\n  \"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}\" \\\n  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG \"$@\"\n"
  },
  {
    "path": "mvnw.cmd",
    "content": "@REM ----------------------------------------------------------------------------\r\n@REM Licensed to the Apache Software Foundation (ASF) under one\r\n@REM or more contributor license agreements.  See the NOTICE file\r\n@REM distributed with this work for additional information\r\n@REM regarding copyright ownership.  The ASF licenses this file\r\n@REM to you under the Apache License, Version 2.0 (the\r\n@REM \"License\"); you may not use this file except in compliance\r\n@REM with the License.  You may obtain a copy of the License at\r\n@REM\r\n@REM    http://www.apache.org/licenses/LICENSE-2.0\r\n@REM\r\n@REM Unless required by applicable law or agreed to in writing,\r\n@REM software distributed under the License is distributed on an\r\n@REM \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n@REM KIND, either express or implied.  See the License for the\r\n@REM specific language governing permissions and limitations\r\n@REM under the License.\r\n@REM ----------------------------------------------------------------------------\r\n\r\n@REM ----------------------------------------------------------------------------\r\n@REM Apache Maven Wrapper startup batch script, version 3.3.4\r\n@REM\r\n@REM Required ENV vars:\r\n@REM JAVA_HOME - location of a JDK home dir\r\n@REM\r\n@REM Optional ENV vars\r\n@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands\r\n@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending\r\n@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven\r\n@REM     e.g. to debug Maven itself, use\r\n@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000\r\n@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files\r\n@REM ----------------------------------------------------------------------------\r\n\r\n@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'\r\n@echo off\r\n@REM set title of command window\r\ntitle %0\r\n@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'\r\n@if \"%MAVEN_BATCH_ECHO%\" == \"on\"  echo %MAVEN_BATCH_ECHO%\r\n\r\n@REM set %HOME% to equivalent of $HOME\r\nif \"%HOME%\" == \"\" (set \"HOME=%HOMEDRIVE%%HOMEPATH%\")\r\n\r\n@REM Execute a user defined script before this one\r\nif not \"%MAVEN_SKIP_RC%\" == \"\" goto skipRcPre\r\n@REM check for pre script, once with legacy .bat ending and once with .cmd ending\r\nif exist \"%USERPROFILE%\\mavenrc_pre.bat\" call \"%USERPROFILE%\\mavenrc_pre.bat\" %*\r\nif exist \"%USERPROFILE%\\mavenrc_pre.cmd\" call \"%USERPROFILE%\\mavenrc_pre.cmd\" %*\r\n:skipRcPre\r\n\r\n@setlocal\r\n\r\nset ERROR_CODE=0\r\n\r\n@REM To isolate internal variables from possible post scripts, we use another setlocal\r\n@setlocal\r\n\r\n@REM ==== START VALIDATION ====\r\nif not \"%JAVA_HOME%\" == \"\" goto OkJHome\r\n\r\necho. >&2\r\necho Error: JAVA_HOME not found in your environment. >&2\r\necho Please set the JAVA_HOME variable in your environment to match the >&2\r\necho location of your Java installation. >&2\r\necho. >&2\r\ngoto error\r\n\r\n:OkJHome\r\nif exist \"%JAVA_HOME%\\bin\\java.exe\" goto init\r\n\r\necho. >&2\r\necho Error: JAVA_HOME is set to an invalid directory. >&2\r\necho JAVA_HOME = \"%JAVA_HOME%\" >&2\r\necho Please set the JAVA_HOME variable in your environment to match the >&2\r\necho location of your Java installation. >&2\r\necho. >&2\r\ngoto error\r\n\r\n@REM ==== END VALIDATION ====\r\n\r\n:init\r\n\r\n@REM Find the project base dir, i.e. the directory that contains the folder \".mvn\".\r\n@REM Fallback to current working directory if not found.\r\n\r\nset MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%\r\nIF NOT \"%MAVEN_PROJECTBASEDIR%\"==\"\" goto endDetectBaseDir\r\n\r\nset EXEC_DIR=%CD%\r\nset WDIR=%EXEC_DIR%\r\n:findBaseDir\r\nIF EXIST \"%WDIR%\"\\.mvn goto baseDirFound\r\ncd ..\r\nIF \"%WDIR%\"==\"%CD%\" goto baseDirNotFound\r\nset WDIR=%CD%\r\ngoto findBaseDir\r\n\r\n:baseDirFound\r\nset MAVEN_PROJECTBASEDIR=%WDIR%\r\ncd \"%EXEC_DIR%\"\r\ngoto endDetectBaseDir\r\n\r\n:baseDirNotFound\r\nset MAVEN_PROJECTBASEDIR=%EXEC_DIR%\r\ncd \"%EXEC_DIR%\"\r\n\r\n:endDetectBaseDir\r\n\r\nIF NOT EXIST \"%MAVEN_PROJECTBASEDIR%\\.mvn\\jvm.config\" goto endReadAdditionalConfig\r\n\r\n@setlocal EnableExtensions EnableDelayedExpansion\r\nfor /F \"usebackq delims=\" %%a in (\"%MAVEN_PROJECTBASEDIR%\\.mvn\\jvm.config\") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a\r\n@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%\r\n\r\n:endReadAdditionalConfig\r\n\r\nSET MAVEN_JAVA_EXE=\"%JAVA_HOME%\\bin\\java.exe\"\r\nset WRAPPER_JAR=\"%MAVEN_PROJECTBASEDIR%\\.mvn\\wrapper\\maven-wrapper.jar\"\r\nset WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain\r\n\r\nset WRAPPER_URL=\"https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar\"\r\n\r\nFOR /F \"usebackq tokens=1,2 delims==\" %%A IN (\"%MAVEN_PROJECTBASEDIR%\\.mvn\\wrapper\\maven-wrapper.properties\") DO (\r\n    IF \"%%A\"==\"wrapperUrl\" SET WRAPPER_URL=%%B\r\n)\r\n\r\n@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central\r\n@REM This allows using the maven wrapper in projects that prohibit checking in binary data.\r\nif exist %WRAPPER_JAR% (\r\n    if \"%MVNW_VERBOSE%\" == \"true\" (\r\n        echo Found %WRAPPER_JAR%\r\n    )\r\n) else (\r\n    if not \"%MVNW_REPOURL%\" == \"\" (\r\n        SET WRAPPER_URL=\"%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar\"\r\n    )\r\n    if \"%MVNW_VERBOSE%\" == \"true\" (\r\n        echo Couldn't find %WRAPPER_JAR%, downloading it ...\r\n        echo Downloading from: %WRAPPER_URL%\r\n    )\r\n\r\n    powershell -Command \"&{\"^\r\n\t\t\"$webclient = new-object System.Net.WebClient;\"^\r\n\t\t\"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {\"^\r\n\t\t\"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');\"^\r\n\t\t\"}\"^\r\n\t\t\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')\"^\r\n\t\t\"}\"\r\n    if \"%MVNW_VERBOSE%\" == \"true\" (\r\n        echo Finished downloading %WRAPPER_JAR%\r\n    )\r\n)\r\n@REM End of extension\r\n\r\n@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file\r\nSET WRAPPER_SHA_256_SUM=\"\"\r\nFOR /F \"usebackq tokens=1,2 delims==\" %%A IN (\"%MAVEN_PROJECTBASEDIR%\\.mvn\\wrapper\\maven-wrapper.properties\") DO (\r\n    IF \"%%A\"==\"wrapperSha256Sum\" SET WRAPPER_SHA_256_SUM=%%B\r\n)\r\nIF NOT %WRAPPER_SHA_256_SUM%==\"\" (\r\n    powershell -Command \"&{\"^\r\n       \"Import-Module $PSHOME\\Modules\\Microsoft.PowerShell.Utility -Function Get-FileHash;\"^\r\n       \"$hash = (Get-FileHash \\\"%WRAPPER_JAR%\\\" -Algorithm SHA256).Hash.ToLower();\"^\r\n       \"If('%WRAPPER_SHA_256_SUM%' -ne $hash){\"^\r\n       \"  Write-Error 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';\"^\r\n       \"  Write-Error 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';\"^\r\n       \"  Write-Error 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';\"^\r\n       \"  exit 1;\"^\r\n       \"}\"^\r\n       \"}\"\r\n    if ERRORLEVEL 1 goto error\r\n)\r\n\r\n@REM Provide a \"standardized\" way to retrieve the CLI args that will\r\n@REM work with both Windows and non-Windows executions.\r\nset MAVEN_CMD_LINE_ARGS=%*\r\n\r\n%MAVEN_JAVA_EXE% ^\r\n  %JVM_CONFIG_MAVEN_PROPS% ^\r\n  %MAVEN_OPTS% ^\r\n  %MAVEN_DEBUG_OPTS% ^\r\n  -classpath %WRAPPER_JAR% ^\r\n  \"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%\" ^\r\n  %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*\r\nif ERRORLEVEL 1 goto error\r\ngoto end\r\n\r\n:error\r\nset ERROR_CODE=1\r\n\r\n:end\r\n@endlocal & set ERROR_CODE=%ERROR_CODE%\r\n\r\nif not \"%MAVEN_SKIP_RC%\"==\"\" goto skipRcPost\r\n@REM check for post script, once with legacy .bat ending and once with .cmd ending\r\nif exist \"%USERPROFILE%\\mavenrc_post.bat\" call \"%USERPROFILE%\\mavenrc_post.bat\"\r\nif exist \"%USERPROFILE%\\mavenrc_post.cmd\" call \"%USERPROFILE%\\mavenrc_post.cmd\"\r\n:skipRcPost\r\n\r\n@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'\r\nif \"%MAVEN_BATCH_PAUSE%\"==\"on\" pause\r\n\r\nif \"%MAVEN_TERMINATE_CMD%\"==\"on\" exit %ERROR_CODE%\r\n\r\ncmd /C exit /B %ERROR_CODE%\r\n"
  },
  {
    "path": "pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\nMaven Launch4j Plugin 1.0\nA plugin for using Launch4j in Maven projects.\n\nCopyright (c) 2006 Paul Jungwirth\nCopyright (c) 2011-2025 Lukasz Lenart\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n\nA complete copy of this license may be found in src/main/legal/LICENSE.txt of the source distribution.\n-->\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n    \n    <groupId>com.akathist.maven.plugins.launch4j</groupId>\n    <artifactId>launch4j-maven-plugin</artifactId>\n    <packaging>maven-plugin</packaging>\n    <version>2.7.1-SNAPSHOT</version>\n\n    <name>Maven Launch4j Plugin</name>\n    <description>This plugin creates Windows executables from Java jar files using the Launch4j utility.</description>\n    <url>https://orphan.software/</url>\n    <inceptionYear>2025</inceptionYear>\n\n    <properties>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n        <launch4j.version>3.50</launch4j.version>\n        <maven.compiler.source>17</maven.compiler.source>\n        <maven.compiler.target>17</maven.compiler.target>\n\n        <central-publishing-maven-plugin.version>0.9.0</central-publishing-maven-plugin.version>\n        <maven-source-plugin.version>3.4.0</maven-source-plugin.version>\n        <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>\n        <maven-jar-plugin.version>3.5.0</maven-jar-plugin.version>\n        <maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>\n        <maven-release-plugin.version>3.3.1</maven-release-plugin.version>\n        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>\n    </properties>\n\n    <licenses>\n        <license>\n            <name>GNU General Public License v3.0</name>\n            <url>https://www.gnu.org/licenses/gpl-3.0.txt</url>\n            <distribution>repo</distribution>\n        </license>\n    </licenses>\n\n    <scm>\n        <connection>scm:git:git@github.com:orphan-oss/launch4j-maven-plugin.git</connection>\n        <url>git@github.com:orphan-oss/launch4j-maven-plugin.git</url>\n        <developerConnection>scm:git:git@github.com:orphan-oss/launch4j-maven-plugin.git</developerConnection>\n        <tag>HEAD</tag>\n    </scm>\n\n    <issueManagement>\n        <system>Github Issues</system>\n        <url>https://github.com/orphan-oss/launch4j-maven-plugin/issues</url>\n    </issueManagement>\n\n    <developers>\n        <developer>\n            <id>lukaszlenart</id>\n            <email>lukasz.lenart@gmail.com</email>\n            <roles>\n                <role>Lead maintainer</role>\n            </roles>\n        </developer>\n    </developers>\n\n    <dependencies>\n        <dependency>\n            <groupId>net.sf.launch4j</groupId>\n            <artifactId>launch4j</artifactId>\n            <version>${launch4j.version}</version>\n            <classifier>core</classifier>\n            <exclusions>\n                <exclusion>\n                    <groupId>com.ibm.icu</groupId>\n                    <artifactId>icu4j</artifactId>\n                </exclusion>\n                <exclusion>\n                    <artifactId>abeille</artifactId>\n                    <groupId>net.java.abeille</groupId>\n                </exclusion>\n                <exclusion>\n                    <groupId>com.thoughtworks.xstream</groupId>\n                    <artifactId>xstream</artifactId>\n                </exclusion>\n                <exclusion>\n                    <groupId>org.apache.ant</groupId>\n                    <artifactId>ant</artifactId>\n                </exclusion>\n            </exclusions>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.ant</groupId>\n            <artifactId>ant</artifactId>\n            <version>1.10.17</version>\n        </dependency>\n        <dependency>\n            <groupId>com.thoughtworks.xstream</groupId>\n            <artifactId>xstream</artifactId>\n            <version>1.4.21</version>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.maven</groupId>\n            <artifactId>maven-plugin-api</artifactId>\n            <version>3.9.15</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.maven</groupId>\n            <artifactId>maven-model</artifactId>\n            <version>3.9.15</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.maven</groupId>\n            <artifactId>maven-artifact</artifactId>\n            <version>3.9.15</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.maven</groupId>\n            <artifactId>maven-core</artifactId>\n            <version>3.9.15</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.maven.plugin-tools</groupId>\n            <artifactId>maven-plugin-annotations</artifactId>\n            <version>3.15.2</version>\n            <scope>provided</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.commons</groupId>\n            <artifactId>commons-lang3</artifactId>\n            <version>3.20.0</version>\n        </dependency>\n        <dependency>\n            <groupId>junit</groupId>\n            <artifactId>junit</artifactId>\n            <version>4.13.2</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>pl.pragmatists</groupId>\n            <artifactId>JUnitParams</artifactId>\n            <version>1.1.1</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.mockito</groupId>\n            <artifactId>mockito-core</artifactId>\n            <version>5.23.0</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.maven.plugin-testing</groupId>\n            <artifactId>maven-plugin-testing-harness</artifactId>\n            <version>3.5.1</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.apache.maven</groupId>\n            <artifactId>maven-compat</artifactId>\n            <version>3.9.15</version>\n            <scope>test</scope>\n        </dependency>\n    </dependencies>\n\n    <build>\n        <pluginManagement>\n            <plugins>\n                <plugin>\n                    <groupId>org.apache.maven.plugins</groupId>\n                    <artifactId>maven-compiler-plugin</artifactId>\n                    <version>3.15.0</version>\n                </plugin>\n                <plugin>\n                    <groupId>org.apache.maven.plugins</groupId>\n                    <artifactId>maven-plugin-plugin</artifactId>\n                    <version>3.15.2</version>\n                    <configuration>\n                        <!-- see https://issues.apache.org/jira/browse/MNG-5346 -->\n                        <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>\n                    </configuration>\n                    <executions>\n                        <execution>\n                            <id>default-descriptor</id>\n                            <goals>\n                                <goal>descriptor</goal>\n                            </goals>\n                            <phase>process-classes</phase>\n                        </execution>\n                        <execution>\n                            <id>help-descriptor</id>\n                            <goals>\n                                <goal>helpmojo</goal>\n                            </goals>\n                            <phase>process-classes</phase>\n                        </execution>\n                    </executions>\n                </plugin>\n            </plugins>\n        </pluginManagement>\n\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-plugin-plugin</artifactId>\n                <version>3.15.2</version>\n                <executions>\n                    <execution>\n                        <id>mojo-descriptor</id>\n                        <goals>\n                            <goal>descriptor</goal>\n                        </goals>\n                    </execution>\n                    <execution>\n                        <id>help-goal</id>\n                        <goals>\n                            <goal>helpmojo</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-site-plugin</artifactId>\n                <version>3.21.0</version>\n                <dependencies>\n                    <dependency>\n                        <groupId>org.apache.maven.doxia</groupId>\n                        <artifactId>doxia-core</artifactId>\n                        <version>2.1.0</version>\n                    </dependency>\n                    <dependency>\n                        <groupId>org.apache.maven.doxia</groupId>\n                        <artifactId>doxia-module-markdown</artifactId>\n                        <version>2.1.0</version>\n                    </dependency>\n                </dependencies>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-jar-plugin</artifactId>\n                <version>${maven-jar-plugin.version}</version>\n                <configuration>\n                    <archive>\n                        <compress>true</compress>\n                        <index>true</index>\n                        <manifestEntries>\n                            <Automatic-Module-Name>ognl</Automatic-Module-Name>\n                        </manifestEntries>\n                    </archive>\n                </configuration>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-source-plugin</artifactId>\n                <version>${maven-source-plugin.version}</version>\n                <configuration>\n                    <attach>true</attach>\n                    <archive>\n                        <compress>true</compress>\n                        <index>true</index>\n                    </archive>\n                </configuration>\n                <executions>\n                    <execution>\n                        <id>attach-sources</id>\n                        <goals>\n                            <goal>jar-no-fork</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-javadoc-plugin</artifactId>\n                <version>${maven-javadoc-plugin.version}</version>\n                <configuration>\n                    <archive>\n                        <compress>true</compress>\n                        <index>true</index>\n                    </archive>\n                    <source>1.8</source>\n                    <links>\n                        <link>https://docs.oracle.com/javase/8/docs/api/</link>\n                    </links>\n                    <doclint>none</doclint>\n                    <quiet>true</quiet>\n                    <encoding>UTF-8</encoding>\n                </configuration>\n                <executions>\n                    <execution>\n                        <id>attach-source</id>\n                        <goals>\n                            <goal>jar</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-deploy-plugin</artifactId>\n                <version>${maven-deploy-plugin.version}</version>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-release-plugin</artifactId>\n                <version>${maven-release-plugin.version}</version>\n                <configuration>\n                    <releaseProfiles>release</releaseProfiles>\n                </configuration>\n            </plugin>\n            <plugin>\n                <groupId>org.sonatype.central</groupId>\n                <artifactId>central-publishing-maven-plugin</artifactId>\n                <version>${central-publishing-maven-plugin.version}</version>\n                <extensions>true</extensions>\n                <configuration>\n                    <publishingServerId>central</publishingServerId>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n\n    <profiles>\n        <profile>\n            <id>eclipse</id>\n            <activation>\n                <property>\n                    <name>m2e.version</name>\n                </property>\n            </activation>\n            <build>\n                <pluginManagement>\n                    <plugins>\n                        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->\n                        <plugin>\n                            <groupId>org.eclipse.m2e</groupId>\n                            <artifactId>lifecycle-mapping</artifactId>\n                            <version>1.0.0</version>\n                            <configuration>\n                                <lifecycleMappingMetadata>\n                                    <pluginExecutions>\n                                        <pluginExecution>\n                                            <pluginExecutionFilter>\n                                                <groupId>org.apache.maven.plugins</groupId>\n                                                <artifactId>maven-plugin-plugin</artifactId>\n                                                <versionRange>[3.4,)</versionRange>\n                                                <goals>\n                                                    <goal>helpmojo</goal>\n                                                    <goal>descriptor</goal>\n                                                </goals>\n                                            </pluginExecutionFilter>\n                                            <action>\n                                                <ignore />\n                                            </action>\n                                        </pluginExecution>\n                                    </pluginExecutions>\n                                </lifecycleMappingMetadata>\n                            </configuration>\n                        </plugin>\n                    </plugins>\n                </pluginManagement>\n            </build>\n        </profile>\n        <profile>\n            <id>release</id>\n            <build>\n                <defaultGoal>deploy</defaultGoal>\n                <plugins>\n                    <plugin>\n                        <artifactId>maven-gpg-plugin</artifactId>\n                    </plugin>\n                </plugins>\n                <pluginManagement>\n                    <plugins>\n                        <plugin>\n                            <artifactId>maven-gpg-plugin</artifactId>\n                            <version>${maven-gpg-plugin.version}</version>\n                            <executions>\n                                <execution>\n                                    <id>sign-artifacts</id>\n                                    <phase>verify</phase>\n                                    <goals>\n                                        <goal>sign</goal>\n                                    </goals>\n                                </execution>\n                            </executions>\n                        </plugin>\n                    </plugins>\n                </pluginManagement>\n            </build>\n        </profile>\n    </profiles>\n\n    <reporting>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-project-info-reports-plugin</artifactId>\n                <version>3.9.0</version>\n                <reportSets>\n                    <reportSet>\n                        <reports>\n                            <report>index</report>\n                            <report>summary</report>\n                            <report>licenses</report>\n                            <report>dependencies</report>\n                            <report>plugins</report>\n                        </reports>\n                    </reportSet>\n                </reportSets>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-plugin-plugin</artifactId>\n                <version>3.15.2</version>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-javadoc-plugin</artifactId>\n                <version>3.12.0</version>\n            </plugin>\n        </plugins>\n    </reporting>\n</project>\n\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n  \"extends\": [\n    \"config:recommended\"\n  ],\n  \"packageRules\": [\n    {\n      \"matchUpdateTypes\": [\"major\",\"minor\", \"patch\"],\n      \"matchCurrentVersion\": \"!/^0/\",\n      \"automerge\": true\n    }\n  ]\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/ClassPath.java",
    "content": "/*\n * Maven Launch4j Plugin\n * Copyright (c) 2006 Paul Jungwirth\n * Copyright (c) 2011-2025 Lukasz Lenart\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport org.apache.maven.artifact.Artifact;\nimport org.apache.maven.plugins.annotations.Parameter;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Set;\n\npublic class ClassPath {\n\n    /**\n     * The main class to run. This is not required if you are wrapping an executable jar.\n     */\n    @Parameter\n    String mainClass;\n\n    /**\n     * The launch4j executable sets up a classpath before running your jar, but it must know what the\n     * classpath should be. If you set this property to true, the plugin will indicate a classpath\n     * based on all the dependencies your program will need at runtime. You can augment this classpath\n     * using the preCp and postCp properties.\n     */\n    @Parameter(defaultValue = \"true\")\n    boolean addDependencies = true;\n\n    /**\n     * If you want maven to build the classpath from dependencies, you can optionally set the jarLocation,\n     * which is the location of the jars in your distro relative to the executable. So if your distro\n     * has the exe at the top level and all the jars in a lib directory, you could set this to &quot;lib.&quot;\n     * This property does not affect preCp and postCp.\n     */\n    @Parameter\n    String jarLocation;\n\n    /**\n     * Part of the classpath that the executable should give to your application.\n     * Paths are relative to the executable and should be in Windows format (separated by a semicolon).\n     * You don't have to list all your dependencies here; the plugin will include them by default\n     * after this list.\n     */\n    @Parameter\n    String preCp;\n\n    /**\n     * Part of the classpath that the executable should give to your application.\n     * Paths are relative to the executable and should be in Windows format (separated by a semicolon).\n     * You don't have to list all your dependencies here; the plugin will include them by default\n     * before this list.\n     */\n    @Parameter\n    String postCp;\n\n    private void addToCp(List<String> cp, String cpStr) {\n        cp.addAll(Arrays.asList(cpStr.split(\"\\\\s*;\\\\s*\")));\n    }\n\n    net.sf.launch4j.config.ClassPath toL4j(Set<Artifact> dependencies) {\n        net.sf.launch4j.config.ClassPath ret = new net.sf.launch4j.config.ClassPath();\n        ret.setMainClass(mainClass);\n\n        List<String> cp = new ArrayList<>();\n        if (preCp != null) addToCp(cp, preCp);\n\n        if (addDependencies) {\n            if (jarLocation == null) jarLocation = \"\";\n            else if (!jarLocation.endsWith(\"/\")) jarLocation += \"/\";\n\n            for (Artifact dependency : dependencies) {\n                    String depFilename;\n                    depFilename = dependency.getFile().getName();\n//                  System.out.println(\"dependency = \" + depFilename);\n                    cp.add(jarLocation + depFilename);\n            }\n        }\n\n        if (postCp != null) addToCp(cp, postCp);\n        ret.setPaths(cp);\n\n        return ret;\n    }\n\n    @Override\n    public String toString() {\n        return \"ClassPath{\" +\n                \"mainClass='\" + mainClass + '\\'' +\n                \", addDependencies=\" + addDependencies +\n                \", jarLocation='\" + jarLocation + '\\'' +\n                \", preCp='\" + preCp + '\\'' +\n                \", postCp='\" + postCp + '\\'' +\n                '}';\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/Jre.java",
    "content": "/*\n * Maven Launch4j Plugin\n * Copyright (c) 2006 Paul Jungwirth\n * Copyright (c) 2011-2025 Lukasz Lenart\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport java.util.List;\n\nimport org.apache.maven.plugin.logging.Log;\nimport org.apache.maven.plugins.annotations.Parameter;\n\n/**\n * Details about which jre the executable should call.\n */\npublic class Jre {\n\n    /**\n     * The <path> property is used to specify absolute or relative JRE paths, it does not rely\n     * on the current directory or <chdir>.\n     * Note: the path is not checked until the actual application execution.\n     * The <path> is now required and always used for searching before the registry,\n     * to ensure compatibility with the latest runtimes, which by default\n     * do not add registry keys during installation.\n     */\n    @Parameter(required = true)\n    String path;\n\n    /**\n     * Sets jre's bundledJre64Bit flag\n     *\n     * @deprecated Replaced with <requires64Bit> which works during path and registry search.\n     * @since using Launch4j 3.50\n     */\n    @Parameter(defaultValue = \"false\")\n    @Deprecated\n    String bundledJre64Bit;\n\n    /**\n     * Sets jre's bundledJreAsFallback flag\n     *\n     * @deprecated Removed, path search is always first and registry search second\n     *             in order to improve compatibility with modern runtimes\n     * @since using Launch4j 3.50\n     */\n    @Parameter(defaultValue = \"false\")\n    @Deprecated\n    String bundledJreAsFallback;\n\n    /**\n     * When set to \"true\", limits the runtimes to 64-Bit only, \"false\" will use 64-Bit or 32-Bit\n     * depending on which is found. This option works with path and registry search.\n     * @since version 2.2.0\n     */\n    @Parameter(defaultValue = \"false\")\n    boolean requires64Bit;\n\n    /**\n     * Use this property if you want the executable to search the system for a jre.\n     * It names the minimum version acceptable, in x.x.x[_xx] format.\n     * <p>\n     * If you specify this property without giving a path, then the executable will search for a jre\n     * and, none is found, display the java download page.\n     * <p>\n     * If you include a path also, the executable will try that path before searching for jre matching minVersion.\n     * <p>\n     * In either case, you can also specify a maxVersion.\n     */\n    String minVersion;\n\n    /**\n     * If you specify minVersion, you can also use maxVersion to further constrain the search for a jre.\n     * This property should be in the format x.x.x[_xx].\n     */\n    String maxVersion;\n\n    /**\n     * Allows you to specify a preference for a public JRE or a private JDK runtime.\n     * <p>\n     * Valid values are:\n     * <table border=\"1\">\n     * <tr>\n     * <td>jreOnly</td>\n     * <td>Always use a public JRE</td>\n     * </tr>\n     * <tr>\n     * <td>preferJre</td>\n     * <td>Prefer a public JRE, but use a JDK private runtime if it is newer than the public JRE</td>\n     * </tr>\n     * <tr>\n     * <td>preferJdk</td>\n     * <td>Prefer a JDK private runtime, but use a public JRE if it is newer than the JDK</td>\n     * </tr>\n     * <tr>\n     * <td>jdkOnly</td>\n     * <td>Always use a private JDK runtime (fails if there is no JDK installed)</td>\n     * </tr>\n     * </table>\n     *\n     * @deprecated Replaces with <requiresJdk> which works during path and registry search.\n     * @since using Launch4j 3.50\n     */\n    @Parameter(defaultValue = \"preferJre\")\n    @Deprecated\n    String jdkPreference;\n\n    /**\n     * When set to \"true\" only a JDK will be used for execution. An additional check will be performed\n     * if javac is available during path and registry search.\n     * @since version 2.2.0\n     */\n    @Parameter(defaultValue = \"false\")\n    boolean requiresJdk;\n\n    /**\n     * Sets java's initial heap size in MB, like the -Xms flag.\n     */\n    int initialHeapSize;\n\n    /**\n     * Sets java's initial heap size in percent of free memory.\n     */\n    int initialHeapPercent;\n\n    /**\n     * Sets java's maximum heap size in MB, like the -Xmx flag.\n     */\n    int maxHeapSize;\n\n    /**\n     * Sets java's maximum heap size in percent of free memory.\n     */\n    int maxHeapPercent;\n\n    /**\n     * Use this to pass arbitrary options to the java/javaw program.\n     * For instance, you can say:\n     * <pre>\n     * &lt;opt&gt;-Dlaunch4j.exedir=\"%EXEDIR%\"&lt;/opt&gt;\n     * &lt;opt&gt;-Dlaunch4j.exefile=\"%EXEFILE%\"&lt;/opt&gt;\n     * &lt;opt&gt;-Denv.path=\"%Path%\"&lt;/opt&gt;\n     * &lt;opt&gt;-Dsettings=\"%HomeDrive%%HomePath%\\\\settings.ini\"&lt;/opt&gt;\n     * </pre>\n     */\n    List<String> opts;\n\n    /**\n     * Sets JVM version to use: 32 bits, 64 bits or 64/32 bits\n     * Possible values: 32, 64, 64/32 - it will fallback to default value if different option was used\n     * Default value is: 64/32\n     *\n     * @deprecated Replaced with <requires64Bit> which works during path and registry search.\n     * @since using Launch4j 3.50\n     */\n    @Parameter(defaultValue = \"64/32\")\n    @Deprecated\n    String runtimeBits;\n\n    net.sf.launch4j.config.Jre toL4j() {\n        net.sf.launch4j.config.Jre ret = new net.sf.launch4j.config.Jre();\n\n        ret.setPath(path);\n        ret.setRequires64Bit(requires64Bit);\n        ret.setMinVersion(minVersion);\n        ret.setMaxVersion(maxVersion);\n        ret.setRequiresJdk(requiresJdk);\n        ret.setInitialHeapSize(initialHeapSize);\n        ret.setInitialHeapPercent(initialHeapPercent);\n        ret.setMaxHeapSize(maxHeapSize);\n        ret.setMaxHeapPercent(maxHeapPercent);\n        ret.setOptions(opts);\n\n        return ret;\n    }\n\n    @Override\n    public String toString() {\n        return \"Jre{\" +\n                \"path='\" + path + '\\'' +\n                \", requires64Bit=\" + requires64Bit +\n                \", minVersion='\" + minVersion + '\\'' +\n                \", maxVersion='\" + maxVersion + '\\'' +\n                \", requiresJdk=\" + requiresJdk +\n                \", initialHeapSize=\" + initialHeapSize +\n                \", initialHeapPercent=\" + initialHeapPercent +\n                \", maxHeapSize=\" + maxHeapSize +\n                \", maxHeapPercent=\" + maxHeapPercent +\n                \", opts=\" + opts +\n                '}';\n    }\n\n    public void deprecationWarning(Log log) {\n        if (this.bundledJreAsFallback != null) {\n            log.warn(\"<bundledJreAsFallback/> has been removed! It has no effect!\");\n        }\n        if (this.bundledJre64Bit != null) {\n            log.warn(\"<bundledJre64Bit/> is deprecated, use <requires64Bit/> instead!\");\n        }\n        if (this.runtimeBits != null) {\n            log.warn(\"<runtimeBits/> is deprecated, use <requires64Bit/> instead!\");\n        }\n        if (this.jdkPreference != null) {\n            log.warn(\"<jdkPreference/> is deprecated, use <requiresJdk/> instead!\");\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java",
    "content": "/*\n * Maven Launch4j Plugin\n * Copyright (c) 2006 Paul Jungwirth\n * Copyright (c) 2011-2025 Lukasz Lenart\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport com.akathist.maven.plugins.launch4j.tools.ResourceIO;\nimport net.sf.launch4j.Builder;\nimport net.sf.launch4j.BuilderException;\nimport net.sf.launch4j.config.Config;\nimport net.sf.launch4j.config.ConfigPersister;\nimport net.sf.launch4j.config.ConfigPersisterException;\nimport org.apache.maven.execution.MavenSession;\nimport org.apache.maven.plugin.AbstractMojo;\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugin.logging.Log;\nimport org.apache.maven.plugins.annotations.Component;\nimport org.apache.maven.plugins.annotations.LifecyclePhase;\nimport org.apache.maven.plugins.annotations.Mojo;\nimport org.apache.maven.plugins.annotations.Parameter;\nimport org.apache.maven.plugins.annotations.ResolutionScope;\nimport org.apache.maven.project.MavenProject;\nimport org.eclipse.aether.RepositorySystem;\nimport org.eclipse.aether.RepositorySystemSession;\nimport org.eclipse.aether.artifact.Artifact;\nimport org.eclipse.aether.artifact.DefaultArtifact;\nimport org.eclipse.aether.impl.ArtifactResolver;\nimport org.eclipse.aether.repository.LocalArtifactRequest;\nimport org.eclipse.aether.repository.LocalArtifactResult;\nimport org.eclipse.aether.repository.RemoteRepository;\nimport org.eclipse.aether.resolution.ArtifactRequest;\nimport org.eclipse.aether.resolution.ArtifactResolutionException;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.StandardCopyOption;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Date;\nimport java.util.Enumeration;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.jar.JarEntry;\nimport java.util.jar.JarFile;\nimport java.util.stream.Collectors;\n\n/**\n * Wraps a jar in a Windows executable.\n */\n@Mojo(\n        name = \"launch4j\",\n        defaultPhase = LifecyclePhase.PACKAGE,\n        requiresDependencyResolution = ResolutionScope.RUNTIME,\n        threadSafe = true\n)\npublic class Launch4jMojo extends AbstractMojo {\n\n    @Parameter(defaultValue = \"launch4j\", required = true)\n    private String launch4jArtifactId;\n\n    @Parameter(defaultValue = \"net.sf.launch4j\", required = true)\n    private String launch4jGroupId;\n\n    // intentionally non-static non-final so it can be hacked with reflection if someone really needs to\n    private String DEF_REQADMMAN_RES = \"META-INF/resources/manifest-require_admin_rights-v1.xml\";\n\n    // intentionally non-static non-final so it can be hacked with reflection if someone really needs to\n    private String DEF_REQADMMAN_FILE = \"target/classes/META-INF/manifest-requireAdminRights.xml\";\n\n    /**\n     * Maven Session.\n     */\n    @Parameter(defaultValue = \"${session}\", required = true, readonly = true)\n    private MavenSession session;\n\n    @Parameter(defaultValue = \"${project.remoteProjectRepositories}\", required = true, readonly = true)\n    private List<RemoteRepository> repositories;\n\n    /**\n     * The dependencies required by the project.\n     */\n    @Parameter(defaultValue = \"${project.artifacts}\", required = true, readonly = true)\n    private Set<org.apache.maven.artifact.Artifact> dependencies;\n\n    /**\n     * The user's current project.\n     */\n    @Parameter(defaultValue = \"${project}\", required = true, readonly = true)\n    private MavenProject project;\n\n    /**\n     * Used to look up Artifacts in the remote repository.\n     */\n    @Component(role = RepositorySystem.class)\n    private RepositorySystem repositorySystem;\n\n    /**\n     * The user's local repository.\n     */\n    @Parameter(defaultValue = \"${repositorySystemSession}\", required = true, readonly = true)\n    private RepositorySystemSession repositorySystemSession;\n\n    /**\n     * The artifact resolver used to grab the binary bits that launch4j needs.\n     */\n    @Component(role = ArtifactResolver.class)\n    private ArtifactResolver resolver;\n\n    /**\n     * The dependencies of this plugin.\n     * Used to get the Launch4j artifact version.\n     */\n    @Parameter(defaultValue = \"${plugin.artifacts}\")\n    private List<org.apache.maven.artifact.Artifact> oldPluginArtifacts;\n\n    /**\n     * The base of the current project.\n     */\n    @Parameter(defaultValue = \"${project.basedir}\", required = true, readonly = true)\n    private File basedir;\n\n    /**\n     * Whether you want a gui or console app.\n     * Valid values are \"gui\" and \"console.\"\n     * If you say gui, then launch4j will run your app from javaw instead of java\n     * in order to avoid opening a DOS window.\n     * Choosing gui also enables other options like taskbar icon and a splash screen.\n     */\n    @Parameter(defaultValue = \"console\", required = true)\n    private String headerType;\n\n    /**\n     * The name of the Launch4j native configuration file\n     * The path, if relative, is relative to the pom.xml.\n     */\n    @Parameter\n    private File infile;\n\n    /**\n     * The name of the executable you want launch4j to produce.\n     * The path, if relative, is relative to the pom.xml.\n     */\n    @Parameter(defaultValue = \"${project.build.directory}/${project.artifactId}.exe\")\n    private File outfile;\n\n    /**\n     * The jar to bundle inside the executable.\n     * The path, if relative, is relative to the pom.xml.\n     * <p/>\n     * If you don't want to wrap the jar, then this value should be the runtime path\n     * to the jar relative to the executable. You should also set dontWrapJar to true.\n     * <p/>\n     * You can only bundle a single jar. Therefore, you should either create a jar that contains\n     * your own code plus all your dependencies, or you should distribute your dependencies alongside\n     * the executable.\n     */\n    @Parameter(defaultValue = \"${project.build.directory}/${project.build.finalName}.jar\")\n    private String jar;\n\n    /**\n     * Whether the executable should wrap the jar or not.\n     */\n    @Parameter(defaultValue = \"false\")\n    private boolean dontWrapJar;\n\n    /**\n     * The title of the error popup if something goes wrong trying to run your program,\n     * like if java can't be found. If this is a console app and not a gui, then this value\n     * is used to prefix any error messages, as in ${errTitle}: ${errorMessage}.\n     */\n    @Parameter(defaultValue = \"${project.name}\")\n    private String errTitle;\n\n    /**\n     * downloadUrl (?).\n     */\n    @Parameter\n    private String downloadUrl;\n\n    /**\n     * supportUrl (?).\n     */\n    @Parameter\n    private String supportUrl;\n\n    /**\n     * Constant command line arguments to pass to your program's main method.\n     * Actual command line arguments entered by the user will appear after these.\n     */\n    @Parameter\n    private String cmdLine;\n\n    /**\n     * Changes to the given directory, relative to the executable, before running your jar.\n     * If set to <code>.</code> the current directory will be where the executable is.\n     * If omitted, the directory will not be changed.\n     */\n    @Parameter\n    private String chdir;\n\n    /**\n     * Priority class of windows process.\n     * Valid values are \"normal\" (default), \"idle\" and \"high\".\n     *\n     * @see <a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms685100(v=vs.85).aspx\">MSDN: Scheduling Priorities</a>\n     */\n    @Parameter(defaultValue = \"normal\")\n    private String priority;\n\n\n    /**\n     * If true, the executable waits for the java application to finish before returning its exit code.\n     * Defaults to false for gui applications. Has no effect for console applications, which always wait.\n     */\n    @Parameter(defaultValue = \"false\")\n    private boolean stayAlive;\n\n    /**\n     * If true, when the application exits, any exit code other than 0 is considered a crash and\n     * the application will be started again.\n     */\n    @Parameter(defaultValue = \"false\")\n    private boolean restartOnCrash;\n\n    /**\n     * The icon to use in the taskbar. Must be in ico format.\n     */\n    @Parameter\n    private File icon;\n\n    /**\n     * Whether the executable should ask for admin rights (Windows only).\n     */\n    @Parameter(defaultValue = \"false\")\n    private boolean requireAdminRights;\n\n    /**\n     * Object files to include. Used for custom headers only.\n     */\n    @Parameter\n    private List<String> objs;\n\n    /**\n     * Win32 libraries to include. Used for custom headers only.\n     */\n    @Parameter\n    private List<String> libs;\n\n    /**\n     * Variables to set.\n     */\n    @Parameter\n    private List<String> vars;\n\n    /**\n     * Details about the supported jres.\n     */\n    @Parameter\n    private Jre jre;\n\n    /**\n     * Details about the classpath your application should have.\n     * This is required if you are not wrapping a jar.\n     */\n    @Parameter\n    private ClassPath classPath;\n\n    /**\n     * Details about whether to run as a single instance.\n     */\n    @Parameter\n    private SingleInstance singleInstance;\n\n    /**\n     * Details about the splash screen.\n     */\n    @Parameter\n    private Splash splash;\n\n    /**\n     * Lots of information you can attach to the windows process.\n     */\n    @Parameter\n    private VersionInfo versionInfo;\n\n    /**\n     * If set to true, it will prevent filling out the VersionInfo params with default values.\n     */\n    @Parameter(defaultValue = \"false\")\n    private boolean disableVersionInfoDefaults;\n\n    /**\n     * Various messages you can display.\n     */\n    @Parameter\n    private Messages messages;\n\n    /**\n     * Windows manifest file (a XML file) with the same name as .exe file (myapp.exe.manifest)\n     */\n    @Parameter\n    private File manifest;\n\n    /**\n     * If set to true it will save final config into a XML file\n     */\n    @Parameter(defaultValue = \"false\")\n    private boolean saveConfig = false;\n\n    /**\n     * If {@link #saveConfig} is set to true, config will be written to this file\n     */\n    @Parameter(defaultValue = \"${project.build.directory}/launch4j-config.xml\")\n    private File configOutfile;\n\n    /**\n     * If set to true, a synchronized block will be used to protect resources\n     */\n    @Parameter(defaultValue = \"false\")\n    private boolean parallelExecution = false;\n\n    /**\n     * If set to true, execution of the plugin will be skipped\n     */\n    @Parameter(defaultValue = \"false\")\n    private boolean skip = false;\n\n    private File getJar() {\n        return new File(jar);\n    }\n\n    @Override\n    public void execute() throws MojoExecutionException {\n        if (parallelExecution) {\n            synchronized (Launch4jMojo.class) {\n                doExecute();\n            }\n        } else {\n            doExecute();\n        }\n    }\n\n    private void doExecute() throws MojoExecutionException {\n        if (this.skipExecution()) {\n            getLog().debug(\"Skipping execution of the plugin\");\n            return;\n        }\n\n        processRequireAdminRights();\n\n        fillSensibleJreDefaults();\n\n        if (!disableVersionInfoDefaults) {\n            try {\n                if (versionInfo == null) {\n                    versionInfo = new VersionInfo();\n                }\n                versionInfo.setLog(getLog());\n                versionInfo.tryFillOutByDefaults(project, outfile);\n            } catch (RuntimeException exception) {\n                throw new MojoExecutionException(\"Cannot fill out VersionInfo by defaults\", exception);\n            }\n        }\n\n        final File workDir = setupBuildEnvironment();\n        if (infile != null) {\n            if (infile.exists()) {\n                try {\n                    if (getLog().isDebugEnabled()) {\n                        getLog().debug(\"Trying to load Launch4j native configuration using file=\" + infile.getAbsolutePath());\n                    }\n                    // load launch4j config file from <infile>\n                    ConfigPersister.getInstance().load(infile);\n\n                    // overwrite several properties analogous to the ANT task\n                    // https://sourceforge.net/p/launch4j/git/ci/master/tree/src/net/sf/launch4j/ant/Launch4jTask.java#l84\n\n                    // retrieve the loaded configuration for manipulation\n                    Config c = ConfigPersister.getInstance().getConfig();\n\n                    String jarDefaultValue = project.getBuild().getDirectory() + \"/\" + project.getBuild().getFinalName() + \".jar\";\n                    if (jar != null && !jar.equals(jarDefaultValue)) {\n                        getLog().debug(\"Overwriting config file property 'jar' (='\" + c.getJar().getAbsolutePath() + \"') with local value '\" + getJar().getAbsolutePath() + \"'\");\n                        // only overwrite when != defaultValue (should be != null anytime because of the default value)\n                        c.setJar(getJar());\n                    }\n\n                    File outFileDefaultValue = new File(project.getBuild().getDirectory() + \"/\" + project.getArtifactId() + \".exe\");\n                    if (outfile != null && !outfile.getAbsolutePath().equals(outFileDefaultValue.getAbsolutePath())) {\n                        // only overwrite when != defaultValue (should be != null anytime because of the default value)\n                        getLog().debug(\"Overwriting config file property 'outfile' (='\" + c.getOutfile().getAbsolutePath() + \"') with local value '\" + outfile.getAbsolutePath() + \"'\");\n                        c.setOutfile(outfile);\n                    }\n\n                    if (icon != null) {\n                        c.setIcon(icon);\n                    }\n\n                    if (versionInfo != null) {\n                        if (versionInfo.fileVersion != null) {\n                            getLog().debug(\"Overwriting config file property 'versionInfo.fileVersion' (='\" + c.getVersionInfo().getFileVersion() + \"') with local value '\" + versionInfo.fileVersion + \"'\");\n                            c.getVersionInfo().setFileVersion(versionInfo.fileVersion);\n                        }\n                        if (versionInfo.txtFileVersion != null) {\n                            getLog().debug(\"Overwriting config file property 'versionInfo.txtFileVersion' (='\" + c.getVersionInfo().getTxtFileVersion() + \"') with local value '\" + versionInfo.txtFileVersion + \"'\");\n                            c.getVersionInfo().setTxtFileVersion(versionInfo.txtFileVersion);\n                        }\n                        if (versionInfo.productVersion != null) {\n                            getLog().debug(\"Overwriting config file property 'versionInfo.productVersion' (='\" + c.getVersionInfo().getProductVersion() + \"') with local value '\" + versionInfo.productVersion + \"'\");\n                            c.getVersionInfo().setProductVersion(versionInfo.productVersion);\n                        }\n                        if (versionInfo.txtProductVersion != null) {\n                            getLog().debug(\"Overwriting config file property 'versionInfo.txtProductVersion' (='\" + c.getVersionInfo().getTxtProductVersion() + \"') with local value '\" + versionInfo.txtProductVersion + \"'\");\n                            c.getVersionInfo().setTxtProductVersion(versionInfo.txtProductVersion);\n                        }\n                    }\n\n                    ConfigPersister.getInstance().setAntConfig(c, infile.getParentFile());\n\n                } catch (ConfigPersisterException e) {\n                    getLog().error(e);\n                    throw new MojoExecutionException(\"Could not load Launch4j native configuration file\", e);\n                }\n            } else {\n                throw new MojoExecutionException(\"Launch4j native configuration file [\" + infile.getAbsolutePath() + \"] does not exist!\");\n            }\n        } else {\n            final Config c = new Config();\n\n            c.setHeaderType(headerType);\n            c.setOutfile(outfile);\n            c.setJar(getJar());\n            c.setDontWrapJar(dontWrapJar);\n            c.setErrTitle(errTitle);\n            c.setDownloadUrl(downloadUrl);\n            c.setSupportUrl(supportUrl);\n            c.setCmdLine(cmdLine);\n            c.setChdir(chdir);\n            c.setPriority(priority);\n            c.setStayAlive(stayAlive);\n            c.setRestartOnCrash(restartOnCrash);\n            c.setManifest(manifest);\n            c.setIcon(icon);\n            c.setHeaderObjects(relativizeAndCopy(workDir, objs));\n            c.setLibs(relativizeAndCopy(workDir, libs));\n            c.setVariables(vars);\n\n            if (classPath != null) {\n                c.setClassPath(classPath.toL4j(dependencies));\n            }\n            if (jre != null) {\n                jre.deprecationWarning(getLog());\n                c.setJre(jre.toL4j());\n            }\n            if (singleInstance != null) {\n                c.setSingleInstance(singleInstance.toL4j());\n            }\n            if (splash != null) {\n                c.setSplash(splash.toL4j());\n            }\n            if (versionInfo != null) {\n                c.setVersionInfo(versionInfo.toL4j());\n            }\n            if (messages != null) {\n                if (messages.bundledJreErr != null) {\n                    getLog().warn(\"<bundledJreErr/> is deprecated, use <jreNotFoundErr/> instead!\");\n                }\n                c.setMessages(messages.toL4j());\n            }\n            ConfigPersister.getInstance().setAntConfig(c, getBaseDir());\n        }\n\n        if (getLog().isDebugEnabled()) {\n            printState();\n        }\n\n        final Builder builder = new Builder(new MavenLog(getLog()), workDir);\n        try {\n            builder.build();\n        } catch (BuilderException e) {\n            getLog().error(e);\n            throw new MojoExecutionException(\"Failed to build the executable; please verify your configuration.\", e);\n        }\n\n        if (saveConfig) {\n            try {\n                ConfigPersister.getInstance().save(configOutfile);\n            } catch (ConfigPersisterException e) {\n                throw new MojoExecutionException(\"Cannot save config into a XML file\", e);\n            }\n        }\n    }\n\n    private void fillSensibleJreDefaults() throws MojoExecutionException {\n        if (jre == null) {\n            jre = new Jre();\n        }\n\n        if (jre.path == null) {\n            String pathDef = \"%JAVA_HOME%;%PATH%\";\n            getLog().warn(\"jre.path not set, defaulting to \\\"\" + pathDef + \"\\\"\");\n            jre.path = pathDef;\n        }\n    }\n\n    private void processRequireAdminRights() throws MojoExecutionException {\n        if (requireAdminRights) {\n            getLog().warn(\"Modifying the resulting exe to always require Admin rights.\");\n            getLog().warn(\"Make sure it's necessary. Consider writing your own manifest file.\");\n\n            if (manifest != null) {\n                getLog().warn(\"manifest param is already set, overriding. Make sure that's what's intended.\");\n            }\n\n            try {\n                File metaInfDir = new File(basedir, \"target/classes/META-INF\");\n                metaInfDir.mkdir();\n\n                File manFile = new File(basedir, DEF_REQADMMAN_FILE);\n                byte[] manBytes = ResourceIO.readResourceAsBytes(DEF_REQADMMAN_RES);\n\n                ResourceIO.writeBytesIfDiff(manFile, manBytes);\n\n                byte[] savedBytes = ResourceIO.readBytes(manFile);\n                if (Arrays.equals(manBytes, savedBytes)) {\n                    getLog().info(\"Manifest file written to \" + manFile);\n                }\n\n                manifest = manFile;\n            } catch (Exception e) {\n                getLog().error(e);\n                throw new MojoExecutionException(e);\n            }\n        }\n    }\n\n    /**\n     * Prepares a little directory for launch4j to do its thing. Launch4j needs a bunch of object files\n     * (in the w32api and head directories) and the ld and windres binaries (in the bin directory).\n     * The tricky part is that launch4j picks this directory based on where its own jar is sitting.\n     * In our case, the jar is going to be sitting in the user's ~/.m2 repository. That's okay: we know\n     * maven is allowed to write there. So we'll just add our things to that directory.\n     * <p/>\n     * This approach is not without flaws.\n     * It risks two processes writing to the directory at the same time.\n     * But fortunately, once the binary bits are in place, we don't do any more writing there,\n     * and launch4j doesn't write there either.\n     * Usually ~/.m2 will only be one system or another.\n     * But if it's an NFS mount shared by several system types, this approach will break.\n     * <p/>\n     * Okay, so here is a better proposal: package the plugin without these varying binary files,\n     * and put each set of binaries in its own tarball. Download the tarball you need to ~/.m2 and\n     * unpack it. Then different systems won't contend for the same space. But then I'll need to hack\n     * the l4j code so it permits passing in a work directory and doesn't always base it on\n     * the location of its own jarfile.\n     *\n     * @return the work directory.\n     */\n    private File setupBuildEnvironment() throws MojoExecutionException {\n        createParentFolder();\n        Artifact binaryBits = chooseBinaryBits();\n        if (retrieveBinaryBits(binaryBits)) {\n            return unpackWorkDir(binaryBits);\n        } else {\n            throw new MojoExecutionException(\"Artifact: \" + binaryBits + \" is not available!\");\n        }\n    }\n\n    private void createParentFolder() {\n        if (outfile != null) {\n            File parent = outfile.getParentFile();\n            if (!parent.exists()) {\n                getLog().debug(\"Parent \" + parent.getPath() + \" does not exist, creating it!\");\n                boolean created = parent.mkdirs();\n                if (created) {\n                    getLog().debug(\"Parent \" + parent.getPath() + \" has been created!\");\n                } else {\n                    getLog().warn(\"Cannot create parent \" + parent.getPath() + \"!\");\n                }\n            }\n        }\n    }\n\n    /**\n     * Unzips the given artifact in-place and returns the newly-unzipped top-level directory.\n     * Writes a marker file to prevent unzipping more than once.\n     */\n    private File unpackWorkDir(Artifact artifact) throws MojoExecutionException {\n\n        getLog().debug(\"Trying normal search first, all-repo search if normal fails\");\n        LocalArtifactRequest request = new LocalArtifactRequest(artifact, null, null);\n        LocalArtifactResult localArtifact = repositorySystemSession.getLocalRepositoryManager().find(repositorySystemSession, request);\n        if (localArtifact == null || localArtifact.getFile() == null) {\n            getLog().warn(\"Cannot obtain file path to \" + artifact + \", trying all-repo search\");\n\n            request = new LocalArtifactRequest(artifact, repositories, null);\n            localArtifact = repositorySystemSession.getLocalRepositoryManager().find(repositorySystemSession, request);\n            if (localArtifact == null || localArtifact.getFile() == null) {\n                String err = \"Cannot obtain file path to \" + artifact + \" with both normal and all-repo search\";\n                getLog().error(err);\n                throw new MojoExecutionException(err);\n            }\n        }\n\n        boolean artifactIsSnapshot = !artifact.getVersion().equals(artifact.getBaseVersion());\n\n        getLog().debug(\"Unpacking \" + localArtifact + \" into \" + localArtifact.getFile());\n        File platJar = localArtifact.getFile();\n        File dest = platJar.getParentFile();\n        File marker = new File(dest, platJar.getName() + \".unpacked\");\n        String n = platJar.getName();\n        File workdir = new File(dest, n.substring(0, n.length() - 4));\n\n        // If the artifact is a SNAPSHOT, then a.getVersion() will report the long timestamp,\n        // but getFile() will be 1.1-SNAPSHOT.\n        // Since getFile() doesn't use the timestamp, all timestamps wind up in the same place.\n\n        // WRONG. getFile returns names like\n        // \"lbfork-launch4j-3.53-20240105.004437-1-workdir-win32.jar\" as of\n        // 2024-01-05.\n        // QUESTION: maybe it depends on Maven's version? Need to support both.\n        // FIX: if it contains expanded version replace it back by expandable version.\n        if (artifactIsSnapshot && workdir.toString().contains(artifact.getVersion())) {\n            String oldWorkdirStr = workdir.toString();\n            String newWorkdirStr = oldWorkdirStr.replace(artifact.getVersion(), artifact.getBaseVersion());\n            getLog().info(\"Unexpected workdir, correcting from \" + oldWorkdirStr + \" to \" + newWorkdirStr);\n            workdir = new File(newWorkdirStr);\n        }\n\n        // Therefore we need to expand the jar every time, if the marker file is stale.\n        if (marker.exists() && marker.lastModified() > platJar.lastModified()) {\n            // if (marker.exists() && marker.platJar.getName().indexOf(\"SNAPSHOT\") == -1) {\n            getLog().info(\"Platform-specific work directory already exists: \" + workdir.getAbsolutePath());\n        } else {\n            // trying to use plexus-archiver here is a miserable waste of time:\n            try (JarFile jf = new JarFile(platJar)) {\n                Enumeration<JarEntry> en = jf.entries();\n                while (en.hasMoreElements()) {\n                    JarEntry je = en.nextElement();\n                    File outFile = new File(dest, je.getName());\n                    if (!outFile.toPath().normalize().startsWith(dest.toPath().normalize())) {\n                        throw new RuntimeException(\"Bad zip entry\");\n                    }\n                    File parent = outFile.getParentFile();\n                    if (parent != null) parent.mkdirs();\n                    if (je.isDirectory()) {\n                        outFile.mkdirs();\n                    } else {\n                        try (InputStream in = jf.getInputStream(je)) {\n                            try (FileOutputStream fout = new FileOutputStream(outFile)) {\n                                byte[] buf = new byte[1024];\n                                int len;\n                                while ((len = in.read(buf)) >= 0) {\n                                    fout.write(buf, 0, len);\n                                }\n                            }\n                        }\n                        outFile.setLastModified(je.getTime());\n                    }\n                }\n            } catch (IOException e) {\n                throw new MojoExecutionException(\"Error unarchiving \" + platJar, e);\n            }\n\n            try {\n                marker.createNewFile();\n                marker.setLastModified(new Date().getTime());\n            } catch (IOException e) {\n                getLog().warn(\"Trouble creating marker file \" + marker, e);\n            }\n        }\n\n        setPermissions(workdir);\n        getLog().info(\"Using workdir \" + workdir);\n        return workdir;\n    }\n\n    /**\n     * Chmods the helper executables ld and windres on systems where that is necessary.\n     */\n    private void setPermissions(File workdir) {\n        if (!System.getProperty(\"os.name\").startsWith(\"Windows\")) {\n            try {\n                new ProcessBuilder(\"chmod\", \"755\", workdir + \"/bin/ld\").start().waitFor();\n                new ProcessBuilder(\"chmod\", \"755\", workdir + \"/bin/windres\").start().waitFor();\n            } catch (InterruptedException e) {\n                getLog().warn(\"Interrupted while chmodding platform-specific binaries\", e);\n            } catch (IOException e) {\n                getLog().warn(\"Unable to set platform-specific binaries to 755\", e);\n            }\n        }\n    }\n\n    /**\n     * If custom header objects or libraries shall be linked, they need to sit inside the launch4j working dir.\n     */\n    private List<String> relativizeAndCopy(File workdir, List<String> paths) throws MojoExecutionException {\n        if (paths == null) return null;\n\n        List<String> result = new ArrayList<>();\n        for (String path : paths) {\n            Path source = basedir.toPath().resolve(path);\n            Path dest = workdir.toPath().resolve(basedir.toPath().relativize(source));\n\n            if (!source.startsWith(basedir.toPath())) {\n                throw new MojoExecutionException(\"File must reside in the project directory: \" + path);\n            }\n\n            if (Files.exists(source)) {\n                try {\n                    Files.createDirectories(dest.getParent());\n                    Path target = Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING);\n                    result.add(workdir.toPath().relativize(target).toString());\n                } catch (IOException e) {\n                    throw new MojoExecutionException(\"Can't copy file to workdir\", e);\n                }\n            } else {\n                result.add(path);\n            }\n        }\n\n        return result;\n    }\n\n    /**\n     * Downloads the platform-specific parts, if necessary.\n     */\n    private boolean retrieveBinaryBits(Artifact a) throws MojoExecutionException {\n\n        getLog().debug(\"Retrieving artifact: \" + a + \" stored in \" + a.getFile());\n\n        try {\n            ArtifactRequest request = new ArtifactRequest(a, repositories, null);\n            return repositorySystem.resolveArtifact(repositorySystemSession, request).isResolved();\n        } catch (IllegalArgumentException e) {\n            throw new MojoExecutionException(\"Illegal Argument Exception\", e);\n        } catch (ArtifactResolutionException e) {\n            throw new MojoExecutionException(\"Can't retrieve platform-specific components\", e);\n        }\n    }\n\n    /**\n     * Decides which platform-specific bundle we need, based on the current operating system.\n     */\n    private Artifact chooseBinaryBits() throws MojoExecutionException {\n        String plat;\n        String os = System.getProperty(\"os.name\");\n        String arch = System.getProperty(\"os.arch\");\n        getLog().debug(\"OS = \" + os);\n        getLog().debug(\"Architecture = \" + arch);\n\n        // See here for possible values of os.name:\n        // http://lopica.sourceforge.net/os.html\n        if (os.startsWith(\"Windows\")) {\n            plat = \"win32\";\n        } else if (\"Linux\".equals(os)) {\n            if (\"amd64\".equals(arch)) {\n                plat = \"linux64\";\n            } else {\n                plat = \"linux\";\n            }\n        } else if (\"Solaris\".equals(os) || \"SunOS\".equals(os)) {\n            plat = \"solaris\";\n        } else if (\"Mac OS X\".equals(os) || \"Darwin\".equals(os)) {\n            plat = \"mac\";\n        } else {\n            throw new MojoExecutionException(\"Sorry, Launch4j doesn't support the '\" + os + \"' OS.\");\n        }\n\n        Artifact artifact = new DefaultArtifact(launch4jGroupId, launch4jArtifactId, \"workdir-\" + plat, \"jar\", getLaunch4jVersion());\n        try {\n            ArtifactRequest request = new ArtifactRequest(artifact, repositories, null);\n\n            return repositorySystem.resolveArtifact(repositorySystemSession, request).getArtifact();\n        } catch (ArtifactResolutionException e) {\n            throw new MojoExecutionException(e);\n        }\n    }\n\n    private File getBaseDir() {\n        return basedir;\n    }\n\n    /**\n     * Just prints out how we were configured.\n     */\n    private void printState() {\n        Log log = getLog();\n        Config c = ConfigPersister.getInstance().getConfig();\n\n        log.debug(\"headerType = \" + c.getHeaderType());\n        log.debug(\"outfile = \" + c.getOutfile());\n        log.debug(\"jar = \" + c.getJar());\n        log.debug(\"dontWrapJar = \" + c.isDontWrapJar());\n        log.debug(\"errTitle = \" + c.getErrTitle());\n        log.debug(\"downloadUrl = \" + c.getDownloadUrl());\n        log.debug(\"supportUrl = \" + c.getSupportUrl());\n        log.debug(\"cmdLine = \" + c.getCmdLine());\n        log.debug(\"chdir = \" + c.getChdir());\n        log.debug(\"priority = \" + c.getPriority());\n        log.debug(\"stayAlive = \" + c.isStayAlive());\n        log.debug(\"restartOnCrash = \" + c.isRestartOnCrash());\n        log.debug(\"icon = \" + c.getIcon());\n        log.debug(\"objs = \" + c.getHeaderObjects());\n        log.debug(\"libs = \" + c.getLibs());\n        log.debug(\"vars = \" + c.getVariables());\n        if (c.getSingleInstance() != null) {\n            log.debug(\"singleInstance.mutexName = \" + c.getSingleInstance().getMutexName());\n            log.debug(\"singleInstance.windowTitle = \" + c.getSingleInstance().getWindowTitle());\n        } else {\n            log.debug(\"singleInstance = null\");\n        }\n        if (c.getJre() != null) {\n            log.debug(\"jre.path = \" + c.getJre().getPath());\n            log.debug(\"jre.minVersion = \" + c.getJre().getMinVersion());\n            log.debug(\"jre.maxVersion = \" + c.getJre().getMaxVersion());\n            log.debug(\"jre.requiresJdk = \" + c.getJre().getRequiresJdk());\n            log.debug(\"jre.requires64Bit = \" + c.getJre().getRequires64Bit());\n            log.debug(\"jre.initialHeapSize = \" + c.getJre().getInitialHeapSize());\n            log.debug(\"jre.initialHeapPercent = \" + c.getJre().getInitialHeapPercent());\n            log.debug(\"jre.maxHeapSize = \" + c.getJre().getMaxHeapSize());\n            log.debug(\"jre.maxHeapPercent = \" + c.getJre().getMaxHeapPercent());\n            log.debug(\"jre.opts = \" + c.getJre().getOptions());\n        } else {\n            log.debug(\"jre = null\");\n        }\n        if (c.getClassPath() != null) {\n            log.debug(\"classPath.mainClass = \" + c.getClassPath().getMainClass());\n        }\n        if (classPath != null) {\n            log.debug(\"classPath.addDependencies = \" + classPath.addDependencies);\n            log.debug(\"classPath.jarLocation = \" + classPath.jarLocation);\n            log.debug(\"classPath.preCp = \" + classPath.preCp);\n            log.debug(\"classPath.postCp = \" + classPath.postCp);\n        } else {\n            log.info(\"classpath = null\");\n        }\n        if (c.getSplash() != null) {\n            log.debug(\"splash.file = \" + c.getSplash().getFile());\n            log.debug(\"splash.waitForWindow = \" + c.getSplash().getWaitForWindow());\n            log.debug(\"splash.timeout = \" + c.getSplash().getTimeout());\n            log.debug(\"splash.timoutErr = \" + c.getSplash().isTimeoutErr());\n        } else {\n            log.debug(\"splash = null\");\n        }\n        if (c.getVersionInfo() != null) {\n            log.debug(\"versionInfo.fileVersion = \" + c.getVersionInfo().getFileVersion());\n            log.debug(\"versionInfo.txtFileVersion = \" + c.getVersionInfo().getTxtFileVersion());\n            log.debug(\"versionInfo.fileDescription = \" + c.getVersionInfo().getFileDescription());\n            log.debug(\"versionInfo.copyright = \" + c.getVersionInfo().getCopyright());\n            log.debug(\"versionInfo.productVersion = \" + c.getVersionInfo().getProductVersion());\n            log.debug(\"versionInfo.txtProductVersion = \" + c.getVersionInfo().getTxtProductVersion());\n            log.debug(\"versionInfo.productName = \" + c.getVersionInfo().getProductName());\n            log.debug(\"versionInfo.companyName = \" + c.getVersionInfo().getCompanyName());\n            log.debug(\"versionInfo.internalName = \" + c.getVersionInfo().getInternalName());\n            log.debug(\"versionInfo.originalFilename = \" + c.getVersionInfo().getOriginalFilename());\n            log.debug(\"versionInfo.language = \" + c.getVersionInfo().getLanguage());\n            log.debug(\"versionInfo.languageIndex = \" + c.getVersionInfo().getLanguageIndex());\n            log.debug(\"versionInfo.trademarks = \" + c.getVersionInfo().getTrademarks());\n        } else {\n            log.debug(\"versionInfo = null\");\n        }\n        if (c.getMessages() != null) {\n            log.debug(\"messages.startupErr = \" + c.getMessages().getStartupErr());\n            log.debug(\"messages.jreNotFoundErr = \" + c.getMessages().getJreNotFoundErr());\n            log.debug(\"messages.jreVersionErr = \" + c.getMessages().getJreVersionErr());\n            log.debug(\"messages.launcherErr = \" + c.getMessages().getLauncherErr());\n            log.debug(\"messages.instanceAlreadyExistsMsg = \" + c.getMessages().getInstanceAlreadyExistsMsg());\n        } else {\n            log.debug(\"messages = null\");\n        }\n    }\n\n    /**\n     * A version of the Launch4j used by the plugin.\n     * We want to download the platform-specific bundle whose version matches the Launch4j version,\n     * so we have to figure out what version the plugin is using.\n     *\n     * @return version of Launch4j\n     * @throws MojoExecutionException when version is null\n     */\n    private String getLaunch4jVersion() throws MojoExecutionException {\n        String version = null;\n\n        Set<Artifact> pluginArtifacts = oldPluginArtifacts.stream().map(old ->\n                new DefaultArtifact(old.getGroupId(), old.getArtifactId(), old.getClassifier(), null, old.getVersion())\n        ).collect(Collectors.toSet());\n\n        for (Artifact artifact : pluginArtifacts) {\n            if (launch4jGroupId.equals(artifact.getGroupId()) &&\n                    launch4jArtifactId.equals(artifact.getArtifactId())\n                    && \"core\".equals(artifact.getClassifier())) {\n\n                version = artifact.getVersion();\n                getLog().info(\"Found launch4j version \" + version);\n                break;\n            }\n        }\n\n        if (version == null) {\n            throw new MojoExecutionException(\"Impossible to find which Launch4j version to use, no compatible version found in classpath\");\n        }\n\n        return version;\n    }\n\n    /**\n     * Checks if execution of the plugin should be skipped\n     *\n     * @return true to skip execution\n     */\n    private boolean skipExecution() {\n        getLog().debug(\"skip = \" + this.skip);\n        getLog().debug(\"skipLaunch4j = \" + System.getProperty(\"skipLaunch4j\"));\n        return skip || System.getProperty(\"skipLaunch4j\") != null;\n    }\n\n    @Override\n    public String toString() {\n        return \"Launch4jMojo{\" +\n                \"headerType='\" + headerType + '\\'' +\n                \", infile=\" + infile +\n                \", outfile=\" + outfile +\n                \", jar='\" + jar + '\\'' +\n                \", dontWrapJar=\" + dontWrapJar +\n                \", errTitle='\" + errTitle + '\\'' +\n                \", downloadUrl='\" + downloadUrl + '\\'' +\n                \", supportUrl='\" + supportUrl + '\\'' +\n                \", cmdLine='\" + cmdLine + '\\'' +\n                \", chdir='\" + chdir + '\\'' +\n                \", priority='\" + priority + '\\'' +\n                \", stayAlive=\" + stayAlive +\n                \", restartOnCrash=\" + restartOnCrash +\n                \", icon=\" + icon +\n                \", requireAdminRights=\" + requireAdminRights +\n                \", objs=\" + objs +\n                \", libs=\" + libs +\n                \", vars=\" + vars +\n                \", jre=\" + jre +\n                \", classPath=\" + classPath +\n                \", singleInstance=\" + singleInstance +\n                \", splash=\" + splash +\n                \", versionInfo=\" + versionInfo +\n                \", disableVersionInfoDefaults=\" + disableVersionInfoDefaults +\n                \", messages=\" + messages +\n                \", manifest=\" + manifest +\n                \", saveConfig=\" + saveConfig +\n                \", configOutfile=\" + configOutfile +\n                \", parallelExecution=\" + parallelExecution +\n                \", skip=\" + skip +\n                '}';\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/MavenLog.java",
    "content": "/*\n * Maven Launch4j Plugin\n * Copyright (c) 2006 Paul Jungwirth\n * Copyright (c) 2011-2025 Lukasz Lenart\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport org.apache.maven.plugin.logging.Log;\n\npublic class MavenLog extends net.sf.launch4j.Log {\n\n    Log _log;\n\n    public MavenLog(Log log) {\n        _log = log;\n    }\n\n    @Override\n    public void clear() {\n        _log.info(\"\");\n    }\n\n    @Override\n    public void append(String line) {\n        _log.info(\"launch4j: \" + line);\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/Messages.java",
    "content": "/*\n * Maven Launch4j Plugin\n * Copyright (c) 2006 Paul Jungwirth\n * Copyright (c) 2011-2025 Lukasz Lenart\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport net.sf.launch4j.config.Msg;\nimport org.apache.maven.plugins.annotations.Parameter;\n\n/**\n * Details about messages you can pass.\n */\npublic class Messages {\n\n    @Parameter\n    String startupErr;\n\n    @Parameter\n    @Deprecated\n    String bundledJreErr;\n\n    @Parameter\n    String jreVersionErr;\n\n    @Parameter\n    String launcherErr;\n\n    @Parameter\n    String instanceAlreadyExistsMsg;\n\n    @Parameter\n    String jreNotFoundErr;\n\n    Msg toL4j() {\n        Msg ret = new Msg();\n\n        ret.setStartupErr(startupErr);\n        ret.setJreVersionErr(jreVersionErr);\n        ret.setLauncherErr(launcherErr);\n        ret.setInstanceAlreadyExistsMsg(instanceAlreadyExistsMsg);\n\n        /* since Launch4j 3.50 */\n        ret.setJreNotFoundErr(jreNotFoundErr);\n        return ret;\n    }\n\n    @Override\n    public String toString() {\n        return \"Messages{\" +\n                \"startupErr='\" + startupErr + '\\'' +\n                \", jreVersionErr='\" + jreVersionErr + '\\'' +\n                \", launcherErr='\" + launcherErr + '\\'' +\n                \", instanceAlreadyExistsMsg='\" + instanceAlreadyExistsMsg + '\\'' +\n                \", jreNotFoundErr='\" + jreNotFoundErr + '\\'' +\n                '}';\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/SingleInstance.java",
    "content": "/*\n * Maven Launch4j Plugin\n * Copyright (c) 2006 Paul Jungwirth\n * Copyright (c) 2011-2025 Lukasz Lenart\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport org.apache.maven.plugins.annotations.Parameter;\n\n/**\n * Details about running your application as a single instance.\n */\npublic class SingleInstance {\n\n    @Parameter\n    String mutexName;\n\n    @Parameter\n    String windowTitle;\n\n    net.sf.launch4j.config.SingleInstance toL4j() {\n        net.sf.launch4j.config.SingleInstance ret = new net.sf.launch4j.config.SingleInstance();\n\n        ret.setMutexName(mutexName);\n        ret.setWindowTitle(windowTitle);\n\n        return ret;\n    }\n\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/Splash.java",
    "content": "/*\n * Maven Launch4j Plugin\n * Copyright (c) 2006 Paul Jungwirth\n * Copyright (c) 2011-2025 Lukasz Lenart\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport java.io.*;\n\nimport org.apache.maven.plugins.annotations.Parameter;\n\npublic class Splash {\n\n    /**\n     * The path (relative to the executable when distributed) to the splash page image.\n     */\n    @Parameter\n    File file;\n\n    /**\n     * If true, the splash screen will close automatically as soon as an error window or java window appears.\n     * If false, the splash screen will not close until {@link #timeout} sections. Defaults to true.\n     */\n    @Parameter(defaultValue = \"true\")\n    boolean waitForWindow;\n\n    /**\n     * The number of seconds to keep the splash screen open before automatically closing it.\n     * Defaults to 60.\n     */\n    @Parameter(defaultValue = \"60\")\n    int timeout;\n\n    /**\n     * If true, an error message will appear if the app hasn't started in {@link #timeout} seconds.\n     * If false, the splash screen will close quietly. Defaults to true.\n     */\n    @Parameter(defaultValue = \"true\")\n    boolean timeoutErr;\n\n    net.sf.launch4j.config.Splash toL4j() {\n        net.sf.launch4j.config.Splash ret = new net.sf.launch4j.config.Splash();\n\n        ret.setFile(file);\n        ret.setWaitForWindow(waitForWindow);\n        ret.setTimeout(timeout);\n        ret.setTimeoutErr(timeoutErr);\n\n        return ret;\n    }\n\n    @Override\n    public String toString() {\n        return \"Splash{\" +\n                \"file=\" + file +\n                \", waitForWindow=\" + waitForWindow +\n                \", timeout=\" + timeout +\n                \", timeoutErr=\" + timeoutErr +\n                '}';\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/VersionInfo.java",
    "content": "/*\n * Maven Launch4j Plugin\n * Copyright (c) 2006 Paul Jungwirth\n * Copyright (c) 2011-2025 Lukasz Lenart\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport com.akathist.maven.plugins.launch4j.generators.CopyrightGenerator;\nimport com.akathist.maven.plugins.launch4j.generators.Launch4jFileVersionGenerator;\nimport net.sf.launch4j.config.LanguageID;\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.maven.model.Organization;\nimport org.apache.maven.plugin.logging.Log;\nimport org.apache.maven.plugins.annotations.Parameter;\nimport org.apache.maven.project.MavenProject;\n\nimport java.io.File;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Information that appears in the Windows Explorer.\n */\npublic class VersionInfo {\n    private static final Map<String, LanguageID> LANGUAGE_TO_LANGUAGE_ID;\n\n    static {\n        LANGUAGE_TO_LANGUAGE_ID = new HashMap<>();\n        for (LanguageID languageID : LanguageID.values()) {\n            LANGUAGE_TO_LANGUAGE_ID.put(languageID.name(), languageID);\n        }\n    }\n\n    /**\n     * Version number in x.x.x.x format.\n     */\n    @Parameter\n    String fileVersion;\n\n    /**\n     * Free-form version number, like \"1.20.RC1.\"\n     */\n    @Parameter\n    String txtFileVersion;\n\n    /**\n     * File description shown to the user.\n     */\n    @Parameter\n    String fileDescription;\n\n    /**\n     * Legal copyright.\n     */\n    @Parameter\n    String copyright;\n\n    /**\n     * Version number in x.x.x.x format.\n     */\n    @Parameter\n    String productVersion;\n\n    /**\n     * Free-form version number, like \"1.20.RC1.\"\n     */\n    @Parameter\n    String txtProductVersion;\n\n    /**\n     * The product name.\n     */\n    @Parameter\n    String productName;\n\n    /**\n     * The company name.\n     */\n    @Parameter\n    String companyName;\n\n    /**\n     * The internal name. For instance, you could use the filename without extension or the module name.\n     */\n    @Parameter\n    String internalName;\n\n    /**\n     * The original filename without path. Setting this lets you determine whether a user has renamed the file.\n     */\n    @Parameter\n    String originalFilename;\n\n    /**\n     * Language to be used during installation, default ENGLISH_US\n     */\n    @Parameter\n    String language = LanguageID.ENGLISH_US.name();\n\n    /**\n     * Trademarks of author\n     */\n    @Parameter\n    String trademarks;\n\n    private Log log;\n\n    public VersionInfo() {\n    }\n\n    public VersionInfo(String fileVersion, String txtFileVersion, String fileDescription,\n                       String copyright, String productVersion, String txtProductVersion,\n                       String productName, String companyName, String internalName,\n                       String originalFilename, String language, String trademarks,\n                       Log log) {\n        this.fileVersion = fileVersion;\n        this.txtFileVersion = txtFileVersion;\n        this.fileDescription = fileDescription;\n        this.copyright = copyright;\n        this.productVersion = productVersion;\n        this.txtProductVersion = txtProductVersion;\n        this.productName = productName;\n        this.companyName = companyName;\n        this.internalName = internalName;\n        this.originalFilename = originalFilename;\n        this.language = language;\n        this.trademarks = trademarks;\n        this.log = log;\n    }\n\n    public void setLog(Log log) {\n        this.log = log;\n    }\n\n    net.sf.launch4j.config.VersionInfo toL4j() {\n        net.sf.launch4j.config.VersionInfo ret = new net.sf.launch4j.config.VersionInfo();\n\n        ret.setFileVersion(fileVersion);\n        ret.setTxtFileVersion(txtFileVersion);\n        ret.setFileDescription(fileDescription);\n        ret.setCopyright(copyright);\n        ret.setProductVersion(productVersion);\n        ret.setTxtProductVersion(txtProductVersion);\n        ret.setProductName(productName);\n        ret.setCompanyName(companyName);\n        ret.setInternalName(internalName);\n        ret.setOriginalFilename(originalFilename);\n        setLanguage(ret);\n        ret.setTrademarks(trademarks);\n\n        return ret;\n    }\n\n    private void setLanguage(net.sf.launch4j.config.VersionInfo ret) {\n        LanguageID languageID = LANGUAGE_TO_LANGUAGE_ID.get(language);\n        if (languageID == null) {\n            languageID = LanguageID.ENGLISH_US;\n        }\n        ret.setLanguage(languageID);\n    }\n\n    void tryFillOutByDefaults(MavenProject project, File outfile) {\n        if (project == null) {\n            throw new IllegalArgumentException(\"'project' is required, but it is null.\");\n        }\n        if (outfile == null) {\n            throw new IllegalArgumentException(\"'outfile' is required, but it is null.\");\n        }\n\n        String version = getDefaultWhenSourceIsBlankAndLogWarn(project.getVersion(), \"1.0.0\", \"project.version\");\n        Organization organization = project.getOrganization();\n        String organizationName = \"Default organization\";\n        if(organization == null) {\n            logWarningAboutDummyValue(\"project.organization.name\", organizationName);\n        } else {\n            organizationName = getDefaultWhenSourceIsBlankAndLogWarn(organization.getName(), organizationName, \"project.organization.name\");\n        }\n\n        tryFillOutByDefaultVersionInL4jFormat(version);\n        tryFillOutCopyrightByDefaults(\n                getDefaultWhenSourceIsBlankAndLogWarn(project.getInceptionYear(), \"2020\", \"project.inceptionYear\"),\n                organizationName\n        );\n        tryFillOutOrganizationRelatedDefaults(organizationName);\n        tryFillOutSimpleValuesByDefaults(\n                version,\n                getDefaultWhenSourceIsBlankAndLogWarn(project.getName(), \"Java Project\", \"project.name\"),\n                getDefaultWhenSourceIsBlankAndLogWarn(project.getArtifactId(), \"java-project\", \"project.artifactId\"),\n                getDefaultWhenSourceIsBlankAndLogWarn(project.getDescription(), \"A Java project.\", \"project.description\")\n        );\n\n        String outfileName = getDefaultWhenSourceIsBlankAndLogWarn(outfile.getName(), \"app.exe\", \"outfile\");\n        originalFilename = getDefaultWhenSourceIsBlank(originalFilename, outfileName);\n    }\n\n    private void tryFillOutByDefaultVersionInL4jFormat(String version) {\n        String defaultFileVersion = Launch4jFileVersionGenerator.generate(version);\n\n        fileVersion = getDefaultWhenSourceIsBlank(fileVersion, defaultFileVersion);\n        productVersion = getDefaultWhenSourceIsBlank(productVersion, defaultFileVersion);\n    }\n\n    private void tryFillOutCopyrightByDefaults(String inceptionYear, String organizationName) {\n        final String defaultCopyright = CopyrightGenerator.generate(inceptionYear, organizationName);\n        copyright = getDefaultWhenSourceIsBlank(copyright, defaultCopyright);\n    }\n\n    private void tryFillOutOrganizationRelatedDefaults(String organizationName) {\n        companyName = getDefaultWhenSourceIsBlank(companyName, organizationName);\n        trademarks = getDefaultWhenSourceIsBlank(trademarks, organizationName);\n    }\n\n    private void tryFillOutSimpleValuesByDefaults(String version,\n                                                  String name,\n                                                  String artifactId,\n                                                  String description) {\n        txtFileVersion = getDefaultWhenSourceIsBlank(txtFileVersion, version);\n        txtProductVersion = getDefaultWhenSourceIsBlank(txtProductVersion, version);\n        productName = getDefaultWhenSourceIsBlank(productName, name);\n        internalName = getDefaultWhenSourceIsBlank(internalName, artifactId);\n        fileDescription = getDefaultWhenSourceIsBlank(fileDescription, description);\n    }\n\n    private String getDefaultWhenSourceIsBlank(final String source, final String defaultValue) {\n        if (StringUtils.isBlank(source)) {\n            return defaultValue;\n        }\n\n        return source;\n    }\n\n    private String getDefaultWhenSourceIsBlankAndLogWarn(final String source,\n                                                         final String defaultValue,\n                                                         final String sourceParamName) {\n        if (StringUtils.isBlank(source)) {\n            logWarningAboutDummyValue(sourceParamName, defaultValue);\n\n            return defaultValue;\n        }\n\n        return source;\n    }\n\n    private void logWarningAboutDummyValue(final String sourceParamName, final String dummyValue) {\n        log.warn(\"Configuration param ${\" + sourceParamName + \"} is empty, so a dummy value \\\"\" + dummyValue + \"\\\" \" +\n                \"might be used instead to fulfill some of VersionInfo params by defaults.\");\n    }\n\n    @Override\n    public String toString() {\n        return \"VersionInfo{\" +\n                \"fileVersion='\" + fileVersion + '\\'' +\n                \", txtFileVersion='\" + txtFileVersion + '\\'' +\n                \", fileDescription='\" + fileDescription + '\\'' +\n                \", copyright='\" + copyright + '\\'' +\n                \", productVersion='\" + productVersion + '\\'' +\n                \", txtProductVersion='\" + txtProductVersion + '\\'' +\n                \", productName='\" + productName + '\\'' +\n                \", companyName='\" + companyName + '\\'' +\n                \", internalName='\" + internalName + '\\'' +\n                \", originalFilename='\" + originalFilename + '\\'' +\n                \", language='\" + language + '\\'' +\n                \", trademarks='\" + trademarks + '\\'' +\n                '}';\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/generators/CopyrightGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\npackage com.akathist.maven.plugins.launch4j.generators;\n\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.time.LocalDate;\n\npublic class CopyrightGenerator {\n    private CopyrightGenerator() {\n    }\n\n    /**\n     * Parameters should be taken from MavenProject properties:\n     * @param projectInceptionYear as ${project.inceptionYear}\n     * @param projectOrganizationName as ${project.organization.name}\n     * @return a string representing copyrights\n     */\n    public static String generate(String projectInceptionYear, String projectOrganizationName) {\n        String inceptionYear = generateInceptionYear(projectInceptionYear);\n        int buildYear = LocalDate.now().getYear();\n        String organizationName = generateOrganizationName(projectOrganizationName);\n\n        return String.format(\"Copyright © %s%d%s. All rights reserved.\", inceptionYear, buildYear, organizationName);\n    }\n\n    private static String generateInceptionYear(String projectInceptionYear) {\n        if(StringUtils.isNotBlank(projectInceptionYear)) {\n            return projectInceptionYear + \"-\";\n        }\n\n        return \"\";\n    }\n\n    private static String generateOrganizationName(String projectOrganizationName) {\n        if(StringUtils.isNotBlank(projectOrganizationName)) {\n            return \" \" + projectOrganizationName;\n        }\n\n        return \"\";\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/generators/Launch4jFileVersionGenerator.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\npackage com.akathist.maven.plugins.launch4j.generators;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\npublic class Launch4jFileVersionGenerator {\n    private static final int REQUIRED_NESTED_VERSION_LEVELS = 4;\n    private static final String SIMPLE_PROJECT_VERSION_REGEX = \"^((\\\\d(\\\\.)?)*\\\\d+)(-\\\\w+)?(?:-(?<prerelease>[\\\\w.-]+))?(?:\\\\+(?<build>[\\\\w.-]+))?$\";\n    private static final Pattern simpleProjectVersionPattern = Pattern.compile(\n            SIMPLE_PROJECT_VERSION_REGEX, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE\n    );\n\n    private Launch4jFileVersionGenerator() {\n    }\n\n    /**\n     * Converts projectVersion into a format \"x.x.x.x\" ('x' as a number), which is required by Launch4j.\n     * <p>\n     * For shorter versions like \"x.x.x\" it will append zeros (to the 4th level) at the end like \"x.x.x.0\".\n     * Every text flag like \"-SNAPSHOT\" or \"-alpha\" will be cut off.\n     * Too many nested numbers (more than 4 levels) will be cut off as well: \"1.2.3.4.5.6\" into \"1.2.3.4\".\n     * Leading zeros in version components are stripped to avoid \"digit exceeds base\" errors in windres.\n     * <p>\n     * Param should be taken from MavenProject property:\n     * @param projectVersion as ${project.version}\n     * @return a string representing a file version of format x.x.x.x\n     */\n    public static String generate(String projectVersion) {\n        if(projectVersion == null) {\n            return null;\n        }\n        if(!simpleProjectVersionPattern.matcher(projectVersion).matches()) {\n            throw new IllegalArgumentException(\"'project.version' is in invalid format. Regex pattern: \" + SIMPLE_PROJECT_VERSION_REGEX);\n        }\n\n        String versionLevels = removeTextFlags(projectVersion);\n        String normalizedVersionLevels = stripLeadingZeros(versionLevels);\n        String limitedVersionLevels = cutOffTooManyNestedLevels(normalizedVersionLevels);\n\n        return appendMissingNestedLevelsByZeros(limitedVersionLevels);\n    }\n\n    private static String removeTextFlags(String version) {\n        Pattern pattern = Pattern.compile(\"[-+]\");\n        Matcher matcher = pattern.matcher(version);\n        if (matcher.find()) {\n            return version.substring(0, matcher.start());\n        } else {\n            return version;\n        }\n    }\n\n    /**\n     * Strips leading zeros from each version component to prevent \"digit exceeds base\" errors in windres.\n     * For example, \"302.08.01\" becomes \"302.8.1\".\n     * Special case: \"0\" remains \"0\" (doesn't become empty string).\n     * \n     * @param version version string with components separated by dots\n     * @return version string with leading zeros stripped from each component\n     */\n    private static String stripLeadingZeros(String version) {\n        String[] levels = version.split(\"\\\\.\");\n        \n        for (int i = 0; i < levels.length; i++) {\n            // Parse as integer and convert back to string to remove leading zeros\n            // This handles the special case where \"000\" becomes \"0\"\n            try {\n                levels[i] = String.valueOf(Integer.parseInt(levels[i]));\n            } catch (NumberFormatException e) {\n                // This should not happen given the regex validation, but keep original if it does\n                // The existing validation should have caught invalid numbers already\n                throw new IllegalArgumentException(\"Invalid number format in version component: \" + levels[i], e);\n            }\n        }\n        \n        return String.join(\".\", levels);\n    }\n\n    private static String cutOffTooManyNestedLevels(String versionLevels) {\n        String[] levels = versionLevels.split(\"\\\\.\");\n\n        if(levels.length > REQUIRED_NESTED_VERSION_LEVELS) {\n            List<String> limitedLevels = Arrays.asList(levels)\n                    .subList(0, REQUIRED_NESTED_VERSION_LEVELS);\n            return String.join(\".\", limitedLevels);\n        }\n\n        return versionLevels;\n    }\n\n    private static String appendMissingNestedLevelsByZeros(String versionLevels) {\n        String[] levels = versionLevels.split(\"\\\\.\");\n\n        StringBuilder filledLevels = new StringBuilder(versionLevels);\n        for (int i = levels.length; i < REQUIRED_NESTED_VERSION_LEVELS; i++) {\n            filledLevels.append(\".0\");\n        }\n\n        return filledLevels.toString();\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/akathist/maven/plugins/launch4j/tools/ResourceIO.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\npackage com.akathist.maven.plugins.launch4j.tools;\n\nimport java.io.BufferedInputStream;\nimport java.io.BufferedOutputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Arrays;\n\nfinal public class ResourceIO {\n\n    private static final int DEFAULT_BUFFER_SIZE = 4 * 1024;\n\n    private ResourceIO() {\n        // avoids creating an instance of this class\n    }\n\n    private static byte[] readAllBytes(InputStream is) throws IOException {\n        ByteArrayOutputStream baos = new ByteArrayOutputStream();\n\n        byte[] buf = new byte[DEFAULT_BUFFER_SIZE];\n        int bytesRead;\n        while ((bytesRead = is.read(buf)) != -1) {\n            baos.write(buf, 0, bytesRead);\n        }\n\n        return baos.toByteArray();\n    }\n\n    public static byte[] readResourceAsBytes(String resName) throws IOException {\n        ClassLoader cl = Thread.currentThread().getContextClassLoader();\n        try (InputStream is = cl.getResourceAsStream(resName)) {\n            if (is == null) {\n                throw new IOException(\"Resource not found: \" + resName);\n            }\n            return readAllBytes(is);\n        }\n    }\n\n    public static void writeBytesIfDiff(File outFile, byte[] outBytes) throws IOException {\n        if (outFile.exists()) {\n            byte[] existingBytes = readBytes(outFile);\n            if (Arrays.equals(outBytes, existingBytes)) {\n                return;\n            }\n        }\n        writeBytes(outFile, outBytes);\n    }\n\n    public static byte[] readBytes(File inFile) throws IOException {\n        try (\n                FileInputStream fis = new FileInputStream(inFile);\n                BufferedInputStream bis = new BufferedInputStream(fis)\n        ) {\n            return readAllBytes(bis);\n        }\n    }\n\n    public static void writeBytes(File outFile, byte[] outBytes) throws IOException {\n        try (\n                FileOutputStream fos = new FileOutputStream(outFile, false);\n                BufferedOutputStream bos = new BufferedOutputStream(fos)\n        ) {\n            bos.write(outBytes);\n            bos.flush();\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/legal/LICENSE.txt",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "src/main/legal/XStream.LICENSE.txt",
    "content": "Copyright (c) 2003-2006, Joe Walnes\nCopyright (c) 2006-2015 XStream Committers\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of\nconditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of\nconditions and the following disclaimer in the documentation and/or other materials provided\nwith the distribution.\n\n3. Neither the name of XStream nor the names of its contributors may be used to endorse\nor promote products derived from this software without specific prior written\npermission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\nSHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY\nWAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGE.\n"
  },
  {
    "path": "src/main/legal/commons.LICENSE.txt",
    "content": "\r\n                                 Apache License\r\n                           Version 2.0, January 2004\r\n                        http://www.apache.org/licenses/\r\n\r\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r\n\r\n   1. Definitions.\r\n\r\n      \"License\" shall mean the terms and conditions for use, reproduction,\r\n      and distribution as defined by Sections 1 through 9 of this document.\r\n\r\n      \"Licensor\" shall mean the copyright owner or entity authorized by\r\n      the copyright owner that is granting the License.\r\n\r\n      \"Legal Entity\" shall mean the union of the acting entity and all\r\n      other entities that control, are controlled by, or are under common\r\n      control with that entity. For the purposes of this definition,\r\n      \"control\" means (i) the power, direct or indirect, to cause the\r\n      direction or management of such entity, whether by contract or\r\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r\n      outstanding shares, or (iii) beneficial ownership of such entity.\r\n\r\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\r\n      exercising permissions granted by this License.\r\n\r\n      \"Source\" form shall mean the preferred form for making modifications,\r\n      including but not limited to software source code, documentation\r\n      source, and configuration files.\r\n\r\n      \"Object\" form shall mean any form resulting from mechanical\r\n      transformation or translation of a Source form, including but\r\n      not limited to compiled object code, generated documentation,\r\n      and conversions to other media types.\r\n\r\n      \"Work\" shall mean the work of authorship, whether in Source or\r\n      Object form, made available under the License, as indicated by a\r\n      copyright notice that is included in or attached to the work\r\n      (an example is provided in the Appendix below).\r\n\r\n      \"Derivative Works\" shall mean any work, whether in Source or Object\r\n      form, that is based on (or derived from) the Work and for which the\r\n      editorial revisions, annotations, elaborations, or other modifications\r\n      represent, as a whole, an original work of authorship. For the purposes\r\n      of this License, Derivative Works shall not include works that remain\r\n      separable from, or merely link (or bind by name) to the interfaces of,\r\n      the Work and Derivative Works thereof.\r\n\r\n      \"Contribution\" shall mean any work of authorship, including\r\n      the original version of the Work and any modifications or additions\r\n      to that Work or Derivative Works thereof, that is intentionally\r\n      submitted to Licensor for inclusion in the Work by the copyright owner\r\n      or by an individual or Legal Entity authorized to submit on behalf of\r\n      the copyright owner. For the purposes of this definition, \"submitted\"\r\n      means any form of electronic, verbal, or written communication sent\r\n      to the Licensor or its representatives, including but not limited to\r\n      communication on electronic mailing lists, source code control systems,\r\n      and issue tracking systems that are managed by, or on behalf of, the\r\n      Licensor for the purpose of discussing and improving the Work, but\r\n      excluding communication that is conspicuously marked or otherwise\r\n      designated in writing by the copyright owner as \"Not a Contribution.\"\r\n\r\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\r\n      on behalf of whom a Contribution has been received by Licensor and\r\n      subsequently incorporated within the Work.\r\n\r\n   2. Grant of Copyright License. Subject to the terms and conditions of\r\n      this License, each Contributor hereby grants to You a perpetual,\r\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r\n      copyright license to reproduce, prepare Derivative Works of,\r\n      publicly display, publicly perform, sublicense, and distribute the\r\n      Work and such Derivative Works in Source or Object form.\r\n\r\n   3. Grant of Patent License. Subject to the terms and conditions of\r\n      this License, each Contributor hereby grants to You a perpetual,\r\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r\n      (except as stated in this section) patent license to make, have made,\r\n      use, offer to sell, sell, import, and otherwise transfer the Work,\r\n      where such license applies only to those patent claims licensable\r\n      by such Contributor that are necessarily infringed by their\r\n      Contribution(s) alone or by combination of their Contribution(s)\r\n      with the Work to which such Contribution(s) was submitted. If You\r\n      institute patent litigation against any entity (including a\r\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\r\n      or a Contribution incorporated within the Work constitutes direct\r\n      or contributory patent infringement, then any patent licenses\r\n      granted to You under this License for that Work shall terminate\r\n      as of the date such litigation is filed.\r\n\r\n   4. Redistribution. You may reproduce and distribute copies of the\r\n      Work or Derivative Works thereof in any medium, with or without\r\n      modifications, and in Source or Object form, provided that You\r\n      meet the following conditions:\r\n\r\n      (a) You must give any other recipients of the Work or\r\n          Derivative Works a copy of this License; and\r\n\r\n      (b) You must cause any modified files to carry prominent notices\r\n          stating that You changed the files; and\r\n\r\n      (c) You must retain, in the Source form of any Derivative Works\r\n          that You distribute, all copyright, patent, trademark, and\r\n          attribution notices from the Source form of the Work,\r\n          excluding those notices that do not pertain to any part of\r\n          the Derivative Works; and\r\n\r\n      (d) If the Work includes a \"NOTICE\" text file as part of its\r\n          distribution, then any Derivative Works that You distribute must\r\n          include a readable copy of the attribution notices contained\r\n          within such NOTICE file, excluding those notices that do not\r\n          pertain to any part of the Derivative Works, in at least one\r\n          of the following places: within a NOTICE text file distributed\r\n          as part of the Derivative Works; within the Source form or\r\n          documentation, if provided along with the Derivative Works; or,\r\n          within a display generated by the Derivative Works, if and\r\n          wherever such third-party notices normally appear. The contents\r\n          of the NOTICE file are for informational purposes only and\r\n          do not modify the License. You may add Your own attribution\r\n          notices within Derivative Works that You distribute, alongside\r\n          or as an addendum to the NOTICE text from the Work, provided\r\n          that such additional attribution notices cannot be construed\r\n          as modifying the License.\r\n\r\n      You may add Your own copyright statement to Your modifications and\r\n      may provide additional or different license terms and conditions\r\n      for use, reproduction, or distribution of Your modifications, or\r\n      for any such Derivative Works as a whole, provided Your use,\r\n      reproduction, and distribution of the Work otherwise complies with\r\n      the conditions stated in this License.\r\n\r\n   5. Submission of Contributions. Unless You explicitly state otherwise,\r\n      any Contribution intentionally submitted for inclusion in the Work\r\n      by You to the Licensor shall be under the terms and conditions of\r\n      this License, without any additional terms or conditions.\r\n      Notwithstanding the above, nothing herein shall supersede or modify\r\n      the terms of any separate license agreement you may have executed\r\n      with Licensor regarding such Contributions.\r\n\r\n   6. Trademarks. This License does not grant permission to use the trade\r\n      names, trademarks, service marks, or product names of the Licensor,\r\n      except as required for reasonable and customary use in describing the\r\n      origin of the Work and reproducing the content of the NOTICE file.\r\n\r\n   7. Disclaimer of Warranty. Unless required by applicable law or\r\n      agreed to in writing, Licensor provides the Work (and each\r\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\r\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r\n      implied, including, without limitation, any warranties or conditions\r\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r\n      PARTICULAR PURPOSE. You are solely responsible for determining the\r\n      appropriateness of using or redistributing the Work and assume any\r\n      risks associated with Your exercise of permissions under this License.\r\n\r\n   8. Limitation of Liability. In no event and under no legal theory,\r\n      whether in tort (including negligence), contract, or otherwise,\r\n      unless required by applicable law (such as deliberate and grossly\r\n      negligent acts) or agreed to in writing, shall any Contributor be\r\n      liable to You for damages, including any direct, indirect, special,\r\n      incidental, or consequential damages of any character arising as a\r\n      result of this License or out of the use or inability to use the\r\n      Work (including but not limited to damages for loss of goodwill,\r\n      work stoppage, computer failure or malfunction, or any and all\r\n      other commercial damages or losses), even if such Contributor\r\n      has been advised of the possibility of such damages.\r\n\r\n   9. Accepting Warranty or Additional Liability. While redistributing\r\n      the Work or Derivative Works thereof, You may choose to offer,\r\n      and charge a fee for, acceptance of support, warranty, indemnity,\r\n      or other liability obligations and/or rights consistent with this\r\n      License. However, in accepting such obligations, You may act only\r\n      on Your own behalf and on Your sole responsibility, not on behalf\r\n      of any other Contributor, and only if You agree to indemnify,\r\n      defend, and hold each Contributor harmless for any liability\r\n      incurred by, or claims asserted against, such Contributor by reason\r\n      of your accepting any such warranty or additional liability.\r\n\r\n   END OF TERMS AND CONDITIONS\r\n\r\n   APPENDIX: How to apply the Apache License to your work.\r\n\r\n      To apply the Apache License to your work, attach the following\r\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\r\n      replaced with your own identifying information. (Don't include\r\n      the brackets!)  The text should be enclosed in the appropriate\r\n      comment syntax for the file format. We also recommend that a\r\n      file or class name and description of purpose be included on the\r\n      same \"printed page\" as the copyright notice for easier\r\n      identification within third-party archives.\r\n\r\n   Copyright [yyyy] [name of copyright owner]\r\n\r\n   Licensed under the Apache License, Version 2.0 (the \"License\");\r\n   you may not use this file except in compliance with the License.\r\n   You may obtain a copy of the License at\r\n\r\n       http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n   Unless required by applicable law or agreed to in writing, software\r\n   distributed under the License is distributed on an \"AS IS\" BASIS,\r\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n   See the License for the specific language governing permissions and\r\n   limitations under the License.\r\n"
  },
  {
    "path": "src/main/resources/META-INF/resources/manifest-require_admin_rights-v1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<!--\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n *  http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n-->\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\n    <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n        <security>\n            <requestedPrivileges>\n                <requestedExecutionLevel level=\"requireAdministrator\" uiAccess=\"false\"/>\n            </requestedPrivileges>\n        </security>\n    </trustInfo>\n</assembly>\n"
  },
  {
    "path": "src/main/resources/MOJO.md",
    "content": "# Launch4j Maven plugin – launch4j:launch4j\n\n**Description**:\n\nWraps a jar in a Windows executable.\n\n**Attributes**:\n\n*   Requires a Maven project to be executed.\n*   Requires dependency resolution of artifacts in scope: `runtime`.\n*   The goal is thread-safe and supports parallel builds.\n*   Binds by default to the [lifecycle phase](http://maven.apache.org/ref/current/maven-core/lifecycles.html): `package`.\n\n### Parameter Details\n\n#### **\\<chdir>**\n\nChanges to the given directory, relative to the executable, before running your jar. If set to `.` the current directory will be where the executable is. If omitted, the directory will not be changed.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<classPath>**\n\nDetails about the classpath your application should have. This is required if you are not wrapping a jar.\n\n*   **Type**: `com.akathist.maven.plugins.launch4j.ClassPath`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<cmdLine>**\n\nConstant command line arguments to pass to your program's main method. Actual command line arguments entered by the user will appear after these.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<configOutfile>**\n\nIf `saveConfig` is set to true, config will be written to this file\n\n*   **Type**: `java.io.File`\n*   **Required**: `No`\n*   **Default**: `${project.build.directory}/launch4j-config.xml`\n\n* * *\n\n#### **\\<dontWrapJar>**\n\nWhether the executable should wrap the jar or not.\n\n*   **Type**: `boolean`\n*   **Required**: `No`\n*   **Default**: `false`\n\n* * *\n\n#### **\\<downloadUrl>**\n\ndownloadUrl (?).\n\n*   **Type**: `java.lang.String`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<errTitle>**\n\nThe title of the error popup if something goes wrong trying to run your program, like if java can't be found. If this is a console app and not a gui, then this value is used to prefix any error messages, as in ${errTitle}: ${errorMessage}.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `No`\n*   **Default**: `${project.name}`\n\n* * *\n\n#### **\\<headerType>**\n\nWhether you want a gui or console app. Valid values are \"gui\" and \"console.\" If you say gui, then launch4j will run your app from javaw instead of java in order to avoid opening a DOS window. Choosing gui also enables other options like taskbar icon and a splash screen.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<icon>**\n\nThe icon to use in the taskbar. Must be in ico format.\n\n*   **Type**: `java.io.File`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<infile>**\n\nThe name of the Launch4j native configuration file The path, if relative, is relative to the pom.xml.\n\n*   **Type**: `java.io.File`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<jar>**\n\nThe jar to bundle inside the executable. The path, if relative, is relative to the pom.xml. If you don't want to wrap the jar, then this value should be the runtime path to the jar relative to the executable. You should also set dontWrapJar to true. You can only bundle a single jar. Therefore, you should either create a jar that contains your own code plus all your dependencies, or you should distribute your dependencies alongside the executable.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `No`\n*   **Default**: `${project.build.directory}/${project.build.finalName}.jar`\n\n* * *\n\n#### **\\<jre>**\n\nDetails about the supported jres.\n\n*   **Type**: `com.akathist.maven.plugins.launch4j.Jre`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<libs>**\n\nWin32 libraries to include. Used for custom headers only.\n\n*   **Type**: `java.util.List`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<manifest>**\n\nWindows manifest file (a XML file) with the same name as .exe file (myapp.exe.manifest)\n\n*   **Type**: `java.io.File`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<messages>**\n\nVarious messages you can display.\n\n*   **Type**: `com.akathist.maven.plugins.launch4j.Messages`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<objs>**\n\nObject files to include. Used for custom headers only.\n\n*   **Type**: `java.util.List`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<outfile>**\n\nThe name of the executable you want launch4j to produce. The path, if relative, is relative to the pom.xml.\n\n*   **Type**: `java.io.File`\n*   **Required**: `No`\n*   **Default**: `${project.build.directory}/${project.artifactId}.exe`\n\n* * *\n\n#### **\\<parallelExecution>**\n\nIf set to true, a synchronized block will be used to protect resources\n\n*   **Type**: `boolean`\n*   **Required**: `No`\n*   **Default**: `false`\n\n* * *\n\n#### **\\<pluginArtifacts>**\n\nThe dependencies of this plugin. Used to get the Launch4j artifact version.\n\n*   **Type**: `java.util.List`\n*   **Required**: `No`\n*   **Default**: `${plugin.artifacts}`\n\n* * *\n\n#### **\\<priority>**\n\nPriority class of windows process. Valid values are \"normal\" (default), \"idle\" and \"high\".\n\n*   **Type**: `java.lang.String`\n*   **Required**: `No`\n*   **Default**: `normal`\n\n* * *\n\n#### **\\<restartOnCrash>**\n\nIf true, when the application exits, any exit code other than 0 is considered a crash and the application will be started again.\n\n*   **Type**: `boolean`\n*   **Required**: `No`\n*   **Default**: `false`\n\n* * *\n\n#### **\\<saveConfig>**\n\nIf set to true it will save final config into a XML file\n\n*   **Type**: `boolean`\n*   **Required**: `No`\n*   **Default**: `false`\n\n* * *\n\n#### **\\<singleInstance>**\n\nDetails about whether to run as a single instance.\n\n*   **Type**: `com.akathist.maven.plugins.launch4j.SingleInstance`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<skip>**\n\nIf set to true, execution of the plugin will be skipped\n\n*   **Type**: `boolean`\n*   **Required**: `No`\n*   **Default**: `false`\n\n* * *\n\n#### **\\<splash>**\n\nDetails about the splash screen.\n\n*   **Type**: `com.akathist.maven.plugins.launch4j.Splash`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<stayAlive>**\n\nIf true, the executable waits for the java application to finish before returning its exit code. Defaults to false for gui applications. Has no effect for console applications, which always wait.\n\n*   **Type**: `boolean`\n*   **Required**: `No`\n*   **Default**: `false`\n\n* * *\n\n#### **\\<supportUrl>**\n\nsupportUrl (?).\n\n*   **Type**: `java.lang.String`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<vars>**\n\nVariables to set.\n\n*   **Type**: `java.util.List`\n*   **Required**: `No`\n\n* * *\n\n#### **\\<versionInfo>**\n\nLots of information you can attach to the windows process.\n\n*   **Type**: `com.akathist.maven.plugins.launch4j.VersionInfo`\n*   **Required**: `No`\n\nThe full list of all the `VersionInfo` parameters is available [here](./VERSIONINFO.md).\n\n* * * \n\n#### **\\<disableVersionInfoDefaults>**\n\nIf `disableVersionInfoDefaults` is set to true, it will prevent filling out the VersionInfo params with default values.\n\n*   **Type**: `boolean`\n*   **Required**: `No`\n*   **Default**: `false`\n\n* * *"
  },
  {
    "path": "src/main/resources/README.adoc",
    "content": "= Maven Launch4j Plugin\n\nCopyright (C) 2006 Paul Jungwirth with additional changes by Lukasz Lenart\nversion 1.7.4, 13 February 2015\n\n:toc:\n\n== Description\n\nhttp://launch4j.sourceforge.net/[Launch4j] by Grzegorz Kowal wraps a jar file\nin a Windows executable to ease deployment of Java desktop applications. You \ncan either bundle a JRE or tell Launch4j to search the hard drive for an \nexisting one. If none is found, then Launch4j will show the user a download \npage. Launch4j has many features. You can create either GUI or console \napplications. You can show a splash screen while the JRE loads, give your \napplication a custom icon in the Windows task bar, set a more descriptive \nprocess name (other than \"java\"), and set a variety of other process attributes.\n\nYou can run Launch4j on Windows, Linux, Solaris, or OS X. You specify the \nconfiguration through an XML file. Please see the Launch4j site for more \ninformation on this file. You can also set your configuration via the Launch4j \nGUI.\n\nThe Maven plugin for Launch4j lets you generate the Launch4j executable as part \nof the Maven build process. It supports Maven 2.0.4 and Launch4j 3.x.\nDepending on your operating system, the plugin will download an additional artifact\ncontaining platform-specific binaries that Launch4j uses to create the \nexecutable. This artifact is treated like any other Maven dependency, so it is \nonly downloaded the first time you need it.\n\n== Adding plugin to pom.xml\n\nUsing the Maven plugin, you specify the Launch4j configuration in your POM. I \nhope to add support for external configuration files, but right now you have to \nuse the POM. The format of this configuration is very similar to the standard \nLaunch4j XML format. There are two main differences. First, any lists of \nlike-named elements must appear in a wrapper element. For example, you can't \nsay:\n\n[source,xml]\n----\n    <icon>logo.bin</icon>\n    <var>this=that</var>\n    <var>foo=bar</var>\n    <var>blep=blurp</var>\n----\n\nYou must say:\n\n[source,xml]\n----\n    <icon>logo.bin</icon>\n    <vars>\n        <var>this=that</var>\n        <var>foo=bar</var>\n        <var>blep=blurp</var>\n    </vars>\n----\n\nLikewise for `<lib>` and `<obj>` elements.\n\nSecond, the sub-elements of the `<classPath>` element are a little different.\nThis is so you can set the classpath based on your dependencies. `<classPath>`\nstill takes a `<mainClass>` element, but it does not take `<cp>`. Instead, it\nsupports these children:\n\n * `<addDependencies>` - If you set this to \"true,\" the plugin will build your\n                         classpath based on all dependencies in the runtime and\n                         compile scopes. This is on by default.\n\n * `<jarLocation>` - If you are using the addDependencies feature, you can\n                     use this option to add a prefix before each jar's name.\n                     This is useful if you are bundling your app with the\n                     executable alongside a lib directory that contains all\n                     your jars. If that's what you're doing, you would specify\n                     `<jarLocation>lib/</jarLocation>`.\n\n * `<preCp>` - Use this to add classpath entries before the automatically-\n               generated list. This element functions whether you have\n               enabled `<addDependencies>` or not. Entries in the list should\n               be separated by semicolons, as in a Windows-style `CLASSPATH`\n               variable.\n\n * `<postCp>` - Use this to add classpath entries after the automatically-\n                generated list. This element functions whether you have\n                enabled `<addDependencies>` or not. Entries in the list should\n                be separated by semicolons, as in a Windows-style `CLASSPATH`\n                variable.\n\nOther than these changes, the XML format is just like Launch4j's standard \nformat.\n\n== Examples\n\n=== Single-module project\n\nBy default, the Launch4j plugin is bound to the package phase. Suppose you have \na single-module project named encc. It is a console application, not a GUI. It \nis packaged as a jar, so the jarring runs automatically during the package \nphase before anything else. You want to use launch4j to create an executable \nand then use the assembly plugin to bundle everything up. You could bind both\nlaunch4j and assembly to the package phase with a POM like this:\n\n\n[source,xml]\n----\n  <project>\n    . . .\n    <groupId>com.akathist.encc</groupId>\n    <artifactId>encc</artifactId>\n    <packaging>jar</packaging>\n    . . .\n    <build>\n      <plugins>\n        <plugin>\n          <groupId>com.akathist.maven.plugins.launch4j</groupId>\n          <artifactId>launch4j-maven-plugin</artifactId>\n          <executions>\n            <execution>\n              <id>l4j-clui</id>\n              <phase>package</phase>\n              <goals><goal>launch4j</goal></goals>\n              <configuration>\n                <headerType>console</headerType>\n                <outfile>target/encc.exe</outfile>\n                <jar>target/encc-1.0.jar</jar>\n                <errTitle>encc</errTitle>\n                <classPath>\n                  <mainClass>com.akathist.encc.Clui</mainClass>\n                  <addDependencies>false</addDependencies>\n                  <preCp>anything</preCp>\n                </classPath>\n                <jre>\n                  <minVersion>1.5.0</minVersion>\n                  <opts>\n                    <opt>-Djava.endorsed.dirs=./endorsed</opt>\n                  </opts>\n                </jre>\n                <versionInfo>\n                  <fileVersion>1.2.3.4</fileVersion>\n                  <txtFileVersion>txt file version?</txtFileVersion>\n                  <fileDescription>a description</fileDescription>\n                  <copyright>my copyright</copyright>\n                  <productVersion>4.3.2.1</productVersion>\n                  <txtProductVersion>txt product version</txtProductVersion>\n                  <productName>E-N-C-C</productName>\n                  <internalName>ccne</internalName>\n                  <originalFilename>original.exe</originalFilename>\n                </versionInfo>\n              </configuration>\n            </execution>\n          </executions>\n        </plugin>\n        <plugin>\n          <artifactId>maven-assembly-plugin</artifactId>\n          <executions>\n            <execution>\n              <id>assembly</id>\n              <phase>package</phase>\n              <goals><goal>single</goal></goals>\n              <configuration>\n                <descriptors>\n                  <descriptor>assembly.xml</descriptor>\n                </descriptors>\n              </configuration>\n            </execution>\n          </executions>\n        </plugin>\n      </plugins>\n    </build>\n    . . .\n  </project>\n----\n\nNote that when you bind the assembly plugin to a phase, you must use \n`assembly:single`, not `assembly:assembly`, to prevent its forking a parallel\nlifecycle and running everything twice.\n\n=== GUI and console mode\n\nOr suppose your application can run in either GUI or console mode, and you want \nto create separate executables for each. Then your POM would look like this:\n\n[source,xml]\n----\n  <project>\n    . . .\n    <groupId>com.akathist.encc</groupId>\n    <artifactId>encc</artifactId>\n    <packaging>jar</packaging>\n    . . .\n    <build>\n      <plugins>\n        <plugin>\n          <groupId>com.akathist.maven.plugins.launch4j</groupId>\n          <artifactId>launch4j-maven-plugin</artifactId>\n          <executions>\n            <execution>\n              <id>l4j-clui</id>\n              <phase>package</phase>\n              <goals><goal>launch4j</goal></goals>\n              <configuration>\n                <headerType>console</headerType>\n                <outfile>target/encc.exe</outfile>\n                <jar>target/encc-1.0.jar</jar>\n                <errTitle>encc</errTitle>\n                <classPath>\n                  <mainClass>com.akathist.encc.Clui</mainClass>\n                  <addDependencies>false</addDependencies>\n                  <preCp>anything</preCp>\n                </classPath>\n                <jre>\n                  <minVersion>1.5.0</minVersion>\n                </jre>\n                <versionInfo>\n                  <fileVersion>1.2.3.4</fileVersion>\n                  <txtFileVersion>txt file version?</txtFileVersion>\n                  <fileDescription>a description</fileDescription>\n                  <copyright>my copyright</copyright>\n                  <productVersion>4.3.2.1</productVersion>\n                  <txtProductVersion>txt product version</txtProductVersion>\n                  <productName>E-N-C-C</productName>\n                  <internalName>ccne</internalName>\n                  <originalFilename>original.exe</originalFilename>\n                </versionInfo>\n              </configuration>\n            </execution>\n                <execution>\n                  <id>l4j-gui</id>\n                  <phase>package</phase>\n                  <goals><goal>launch4j</goal></goals>\n                  <configuration>\n                    <headerType>gui</headerType>\n                    <outfile>target/enccg.exe</outfile>\n                    <jar>target/encc-1.0.jar</jar>\n                    <errTitle>enccg</errTitle>\n                    <classPath>\n                      <mainClass>com.akathist.encc.Gui</mainClass>\n                    </classPath>\n                    <jre>\n                      <minVersion>1.5.0</minVersion>\n                    </jre>\n                    <versionInfo>\n                      <fileVersion>1.2.3.4</fileVersion>\n                      <txtFileVersion>txt file version?</txtFileVersion>\n                      <fileDescription>a description</fileDescription>\n                      <copyright>my copyright</copyright>\n                      <productVersion>4.3.2.1</productVersion>\n                      <txtProductVersion>txt product version</txtProductVersion>\n                      <productName>E-N-C-C</productName>\n                      <internalName>ccne</internalName>\n                      <originalFilename>original.exe</originalFilename>\n                    </versionInfo>\n                  </configuration>\n                </execution>\n          </executions>\n        </plugin>\n        <plugin>\n          <artifactId>maven-assembly-plugin</artifactId>\n          <executions>\n            <execution>\n              <id>assembly</id>\n              <phase>package</phase>\n              <goals><goal>single</goal></goals>\n              <configuration>\n                <descriptors>\n                  <descriptor>assembly.xml</descriptor>\n                </descriptors>\n              </configuration>\n            </execution>\n          </executions>\n        </plugin>\n      </plugins>\n    </build>\n    . . .\n  </project>\n----\n\n=== Example `assembly.xml`\n\nHere is a simple assmbly defintion to build a zip file with executable artifact included.\n\n----\n<assembly xmlns=\"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2\"\n          xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n          xsi:schemaLocation=\"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd\">\n    <id>cdc-upgrade</id>\n    <formats>\n        <format>zip</format>\n    </formats>\n    <includeBaseDirectory>false</includeBaseDirectory>\n    <fileSets>\n        <fileSet>\n            <directory>${project.build.directory}/package</directory>\n            <outputDirectory>/</outputDirectory>\n            <includes>\n                <include>*.exe</include>\n            </includes>\n        </fileSet>\n    </fileSets>\n</assembly>\n----\n\nIf you have any questions, please register a ticket!\n\nEnjoy!\n"
  },
  {
    "path": "src/main/resources/TODO",
    "content": "+ Instead of distributing all the binary files together,\n  distrubte them separately and pull down the right one as needed, based on a system property.\n  Look at maven-dependency-plugin for code on grabbing dependencies--and unpacking them.\n\n+ give version ranges for our dependencies so we play nice in people's projects.\n\n+ By default, generate the <cp> element automatically from the dependencies.\n\n- What is up with downloading xstream every time?\n\n+ Add a license file of my own.\n\n+ Add license comment blocks to all files.\n\n+ Use mvn site to generate a site for this plugin.\n    - javadoc should include private fields.\n\t- put something like the README in the index.html file.\n\n+ Use maven to generate a source distro for this plugin.\n\n- Use maven release to release new versions.\n\n- Add to <classPath>:\n\t<excludes>\n\t\t<exclude>\n\t\t\t<groupId></groupId>\n\t\t\t<artifactId></artifactId>\n\t\t</exclude>\n\t\t...\n\t</excludes>\n\n+ Use ftp in <distributionManagement> to make updating my online repository easy.\n  But don't put this in the POM with username & password, because that gets posted publicly!\n    + getting NPE from ftp-wagon. (this was because I was missing a matching <server> in ~/.m2/settings.xml)\n\n- add a snapshot repository, too.\n\n- Don't run launch4j unless the inputs are newer than the output?\n\n+ Improve logic on whether to unjar:\n    + After unjarring, write the marker file.\n\t+ If the marker is there and newer than the jar, don't unjar.\n\t+ But if the jar is newer, unjar anyway.\n\t+ After unjarring, either write the marker file or touch it.\n\n- dontWrapJar doesn't work?\n\tfrom an email:\n\tHowever (sorry!) I can't get <dontWrapJar> to work.  I have tried every combination of \"target/\" or \"./\", including using backslashes (in case of a platform specific-issue) but each results in:\n\t\"Specify runtime path of the jar relative to executable\"\n\n\tI would expect the following config should have worked. I have confirmed that it works from the root of the project using the commandline launch4j.\n\n\t<outfile>target/app.exe</outfile>\n\t<jar>app-1.0.jar</jar>\n\n- support bundling the JRE (or figure out what parameters already allow this)\n.\n\n"
  },
  {
    "path": "src/main/resources/VERSIONINFO.md",
    "content": "# VersionInfo parameters\n\n### Description.\n\nThis file describes the `VersionInfo` parameters.\n\n*   **Type**: `com.akathist.maven.plugins.launch4j.VersionInfo`\n\nEvery parameter (including their parent `VersionInfo`) have a default value defined.\nTo fulfill them by default values you need to make sure that **\\<disableVersionInfoDefaults>** inside plugin configuration is set to `false`.\n\n### Parameter Details\n\n#### **\\<fileVersion>**\n\nVersion number in `x.x.x.x` format.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `${project.version}` converted into a `x.x.x.x` format.\n\nConversion into a `x.x.x.x` format have specific constraints:\n*   `x` as a number\n*   shorter project versions like `x.x.x` will have appended zeros (to the 4th level) like `x.x.x.0`\n*   every text flag like \"-SNAPSHOT\" or \"-alpha\" will be cut off\n*   too many nested levels (>4) will be cut off as well. Example input: `1.2.3.4.5.6`, output: `1.2.3.4`.\n\n* * *\n\n#### **\\<txtFileVersion>**\n\nFree-form version number, like \"1.20.RC1.\"\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `${project.version}`\n\n* * *\n\n#### **\\<fileDescription>**\n\nFile description shown to the user.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `${project.description}`\n\n* * *\n\n#### **\\<copyright>**\n\nLegal copyright.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `Copyright © ${project.inceptionYear}-${currentYear} ${project.organization.name}. All rights reserved.`. \n\nWhere: \n*   `${project.inceptionYear}` is not mandatory.\n*   `${currentYear}` is generated programmatically.\n*   `${project.organization.name}` is not mandatory.\n\n* * *\n\n#### **\\<productVersion>**\n\nVersion number in `x.x.x.x` format.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `${project.version}` converted into a `x.x.x.x` format. The same conversion such the one described regarding `fileVersion` parameter above.\n\n* * *\n\n#### **\\<txtProductVersion>**\n\nFree-form version number, like \"1.20.RC1.\"\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `${project.version}`\n\n* * *\n\n#### **\\<productName>**\n\nThe product name.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `${project.name}`\n\n* * *\n\n#### **\\<companyName>**\n\nThe company name.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `${project.organization.name}`\n\n* * *\n\n#### **\\<internalName>**\n\nThe internal name. For instance, you could use the filename without extension or the module name.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `${project.artifactId}`\n\n* * *\n\n#### **\\<originalFilename>**\n\nThe original filename without path. Setting this lets you determine whether a user has renamed the file.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: last path segment of the `${outfile}` configuration\n\n* * *\n\n#### **\\<language>**\n\nLanguage to be used during installation.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `ENGLISH_US`\n\n* * *\n\n#### **\\<trademarks>**\n\nTrademarks of author.\n\n*   **Type**: `java.lang.String`\n*   **Required**: `Yes`\n*   **Default**: `${project.organization.name}`\n\n* * *"
  },
  {
    "path": "src/site/site.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *  http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n-->\n<project name=\"Launch4j Maven plugin\">\n    <publishDate position=\"left\"/>\n    <version position=\"right\"/>\n    <body>\n        <menu ref=\"reports\"/>\n    </body>\n</project>\n"
  },
  {
    "path": "src/test/java/com/akathist/maven/plugins/launch4j/Launch4jMojoTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport org.apache.maven.plugin.testing.AbstractMojoTestCase;\n\nimport java.io.File;\n\npublic class Launch4jMojoTest extends AbstractMojoTestCase {\n    public void testPrintOutFulfilledConfiguration() throws Exception {\n        File testPom = new File(getBasedir(), \"src/test/resources/unit/launch4j-config/launch4j-full-plugin-config.xml\");\n\n        Launch4jMojo mojo = (Launch4jMojo) lookupMojo(\"launch4j\", testPom);\n\n        assertNotNull(mojo);\n\n        assertEquals(\"Launch4jMojo{\" +\n                \"headerType='gui', \" +\n                \"infile=null, \" +\n                \"outfile=${project.build.directory}\" + File.separator + \"app.exe, \" +\n                \"jar='${project.build.directory}/${project.artifactId}-${project.version}.jar', \" +\n                \"dontWrapJar=false, \" +\n                \"errTitle='null', \" +\n                \"downloadUrl='https://java.com/download', \" +\n                \"supportUrl='null', \" +\n                \"cmdLine='null', \" +\n                \"chdir='null', \" +\n                \"priority='null', \" +\n                \"stayAlive=false, \" +\n                \"restartOnCrash=false, \" +\n                \"icon=null, \" +\n                \"requireAdminRights=false, \" +\n                \"objs=null, \" +\n                \"libs=null, \" +\n                \"vars=null, \" +\n                \"jre=Jre{\" +\n                \"path='%JAVA_HOME%;%PATH%', \" +\n                \"requires64Bit=false, \" +\n                \"minVersion='1.8', \" +\n                \"maxVersion='null', \" +\n                \"requiresJdk=true,\" +\n                \" initialHeapSize=0, \" +\n                \"initialHeapPercent=0, \" +\n                \"maxHeapSize=0, \" +\n                \"maxHeapPercent=0, \" +\n                \"opts=[-Dname=Lukasz]\" +\n                \"}, \" +\n                \"classPath=ClassPath{\" +\n                \"mainClass='pl.org.lenart.launch4j.App', \" +\n                \"addDependencies=true, \" +\n                \"jarLocation='null', \" +\n                \"preCp='anything', \" +\n                \"postCp='null'\" +\n                \"}, \" +\n                \"singleInstance=null, \" +\n                \"splash=null, \" +\n                \"versionInfo=VersionInfo{\" +\n                \"fileVersion='1.0.0.0', \" +\n                \"txtFileVersion='${project.version}', \" +\n                \"fileDescription='Launch4j Demo App', \" +\n                \"copyright='Lukasz Lenart', \" +\n                \"productVersion='1.0.0.0', \" +\n                \"txtProductVersion='1.0.0.0', \" +\n                \"productName='App', \" +\n                \"companyName='Lukasz Lenart', \" +\n                \"internalName='app', \" +\n                \"originalFilename='app.exe', \" +\n                \"language='ENGLISH_US', \" +\n                \"trademarks='Luk ™'\" +\n                \"}, \" +\n                \"disableVersionInfoDefaults=true, \" +\n                \"messages=Messages{\" +\n                \"startupErr='null', \" +\n                \"jreVersionErr='null', \" +\n                \"launcherErr='null', \" +\n                \"instanceAlreadyExistsMsg='null', \" +\n                \"jreNotFoundErr='null'\" +\n                \"}, \" +\n                \"manifest=null, \" +\n                \"saveConfig=false, \" +\n                \"configOutfile=null, \" +\n                \"parallelExecution=false, \" +\n                \"skip=false\" +\n                \"}\", mojo.toString());\n    }\n}"
  },
  {
    "path": "src/test/java/com/akathist/maven/plugins/launch4j/VersionInfoTest.java",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\npackage com.akathist.maven.plugins.launch4j;\n\nimport net.sf.launch4j.config.LanguageID;\nimport org.apache.maven.model.Organization;\nimport org.apache.maven.plugin.logging.Log;\nimport org.apache.maven.project.MavenProject;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.Mock;\nimport org.mockito.junit.MockitoJUnitRunner;\n\nimport java.io.File;\nimport java.time.LocalDate;\nimport java.util.Arrays;\nimport java.util.List;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertNotEquals;\nimport static org.junit.Assert.assertNotNull;\nimport static org.junit.Assert.assertTrue;\nimport static org.mockito.Mockito.doReturn;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\n\n@RunWith(MockitoJUnitRunner.class)\npublic class VersionInfoTest {\n    // VersionInfo test params\n    private String fileVersion = \"1.0.0.0\";\n    private String txtFileVersion = \"1.0.0.0\";\n    private String fileDescription = \"Launch4j Test Application\";\n    private String copyright = \"Copyright Orphan OSS\";\n    private String productVersion = \"1.0.0.0\";\n    private String txtProductVersion = \"1.0.0.0\";\n    private String productName = \"Test App\";\n    private String companyName = \"Orphan OSS Company\";\n    private String internalName = \"app\";\n    private String originalFilename = \"app.exe\";\n    private String language = LanguageID.ENGLISH_US.name();\n    private String trademarks = \"Test ™\";\n\n    // Mocks\n    @Mock\n    Organization organization;\n    @Mock\n    MavenProject project;\n    @Mock\n    File outfile;\n    @Mock\n    Log log;\n\n    // Subject\n    private VersionInfo versionInfo;\n\n    @Before\n    public void buildVersionInfoFromTestParams() {\n        versionInfo = new VersionInfo(fileVersion, txtFileVersion, fileDescription,\n                copyright, productVersion, txtProductVersion,\n                productName, companyName, internalName,\n                originalFilename, language, trademarks,\n                log);\n    }\n\n    @Test\n    public void shouldConvertIntoL4jFormatProperly() {\n        // when\n        net.sf.launch4j.config.VersionInfo l4jVersionInfo = versionInfo.toL4j();\n\n        // then\n        assertEquals(versionInfo.fileVersion, l4jVersionInfo.getFileVersion());\n        assertEquals(versionInfo.txtFileVersion, l4jVersionInfo.getTxtFileVersion());\n        assertEquals(versionInfo.fileDescription, l4jVersionInfo.getFileDescription());\n        assertEquals(versionInfo.copyright, l4jVersionInfo.getCopyright());\n        assertEquals(versionInfo.productVersion, l4jVersionInfo.getProductVersion());\n        assertEquals(versionInfo.txtProductVersion, l4jVersionInfo.getTxtProductVersion());\n        assertEquals(versionInfo.productName, l4jVersionInfo.getProductName());\n        assertEquals(versionInfo.companyName, l4jVersionInfo.getCompanyName());\n        assertEquals(versionInfo.internalName, l4jVersionInfo.getInternalName());\n        assertEquals(versionInfo.originalFilename, l4jVersionInfo.getOriginalFilename());\n        assertEquals(versionInfo.trademarks, l4jVersionInfo.getTrademarks());\n        assertEquals(versionInfo.language, l4jVersionInfo.getLanguage().name());\n    }\n\n    @Test\n    public void shouldConvertIntoL4jFormat_For_All_Languages() {\n        for (LanguageID languageId : LanguageID.values()) {\n            // given\n            versionInfo.language = languageId.name();\n\n            // when\n            net.sf.launch4j.config.VersionInfo l4jVersionInfo = versionInfo.toL4j();\n\n            // then\n            assertEquals(languageId, l4jVersionInfo.getLanguage());\n        }\n    }\n\n    @Test(expected = IllegalArgumentException.class)\n    public void shouldThrowException_WhenTryingToFillOutDefaults_WithEmptyProject() {\n        // expect throws\n        versionInfo.tryFillOutByDefaults(null, outfile);\n    }\n\n    @Test(expected = IllegalArgumentException.class)\n    public void shouldThrowException_WhenTryingToFillOutDefaults_WithEmptyOutfile() {\n        // expect throws\n        versionInfo.tryFillOutByDefaults(project, null);\n    }\n\n    @Test\n    public void should_Not_FillOut_ByDefaultVersion_InL4jFormat_When_VersionInfoPropsWere_Filled() {\n        // given\n        String projectVersion = \"4.3.2.1\";\n        doReturn(projectVersion).when(project).getVersion();\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertNotEquals(projectVersion, versionInfo.fileVersion);\n        assertEquals(fileVersion, versionInfo.fileVersion);\n        assertNotEquals(projectVersion, versionInfo.productVersion);\n        assertEquals(productVersion, versionInfo.productVersion);\n    }\n\n    @Test\n    public void shouldFillOut_ByDefaultVersion_InL4jFormat_When_VersionInfoPropsWere_Empty() {\n        // given\n        String projectVersion = \"1.2.3.4\";\n        doReturn(projectVersion).when(project).getVersion();\n\n        versionInfo.fileVersion = null;\n        versionInfo.productVersion = null;\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertEquals(projectVersion, versionInfo.fileVersion);\n        assertNotEquals(fileVersion, versionInfo.fileVersion);\n        assertEquals(projectVersion, versionInfo.productVersion);\n        assertNotEquals(productVersion, versionInfo.productVersion);\n    }\n\n    @Test\n    public void should_Not_FillOut_Copyright_ByDefault_When_ItWas_Filled() {\n        // given\n        String projectInceptionYear = \"2017\";\n        doReturn(projectInceptionYear).when(project).getInceptionYear();\n\n        String organizationName = \"Another OSS\";\n        doReturn(organizationName).when(organization).getName();\n        doReturn(organization).when(project).getOrganization();\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertNotNull(versionInfo.copyright);\n        assertEquals(copyright, versionInfo.copyright);\n        assertFalse(versionInfo.copyright.contains(projectInceptionYear));\n        assertFalse(versionInfo.copyright.contains(organizationName));\n    }\n\n    @Test\n    public void shouldFillOut_Copyright_ByDefault_When_ItWas_Empty() {\n        // given\n        String projectInceptionYear = \"2019\";\n        doReturn(projectInceptionYear).when(project).getInceptionYear();\n\n        String organizationName = \"Some OSS\";\n        doReturn(organizationName).when(organization).getName();\n        doReturn(organization).when(project).getOrganization();\n\n        versionInfo.copyright = null;\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertNotNull(versionInfo.copyright);\n        assertNotEquals(copyright, versionInfo.copyright);\n        assertTrue(versionInfo.copyright.contains(projectInceptionYear));\n        assertTrue(versionInfo.copyright.contains(organizationName));\n    }\n\n    @Test\n    public void should_Not_FillOutByDefaults_From_OrganizationName_When_VersionInfoPropsWere_Filled() {\n        // given\n        String organizationName = \"Example OSS\";\n        doReturn(organizationName).when(organization).getName();\n        doReturn(organization).when(project).getOrganization();\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertNotEquals(organizationName, versionInfo.companyName);\n        assertEquals(companyName, versionInfo.companyName);\n        assertNotEquals(organizationName, versionInfo.trademarks);\n        assertEquals(trademarks, versionInfo.trademarks);\n    }\n\n    @Test\n    public void shouldFillOutByDefaults_From_OrganizationName_When_OrganizationWas_Filled() {\n        // given\n        String organizationName = \"Other OSS\";\n        doReturn(organizationName).when(organization).getName();\n        doReturn(organization).when(project).getOrganization();\n\n        versionInfo.companyName = null;\n        versionInfo.trademarks = null;\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertEquals(organizationName, versionInfo.companyName);\n        assertEquals(organizationName, versionInfo.trademarks);\n    }\n\n    @Test\n    public void should_Not_FillOutByDefaults_SimpleValues_From_MavenProject_When_VersionInfoPropsWere_Filled() {\n        // given\n        String projectVersion = \"1.21.1\";\n        doReturn(projectVersion).when(project).getVersion();\n\n        String projectName = \"launch4j-test-app\";\n        doReturn(projectName).when(project).getName();\n\n        String projectArtifactId = \"launch4j-test\";\n        doReturn(projectArtifactId).when(project).getArtifactId();\n\n        String projectDescription = \"Launch4j Test App\";\n        doReturn(projectDescription).when(project).getDescription();\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertNotEquals(projectVersion, versionInfo.txtFileVersion);\n        assertEquals(txtFileVersion, versionInfo.txtFileVersion);\n        assertNotEquals(projectVersion, versionInfo.txtProductVersion);\n        assertEquals(txtProductVersion, versionInfo.txtProductVersion);\n        assertNotEquals(projectName, versionInfo.productName);\n        assertEquals(productName, versionInfo.productName);\n        assertNotEquals(projectArtifactId, versionInfo.internalName);\n        assertEquals(internalName, versionInfo.internalName);\n        assertNotEquals(projectDescription, versionInfo.fileDescription);\n        assertEquals(fileDescription, versionInfo.fileDescription);\n    }\n\n    @Test\n    public void shouldFillOutByDefaults_SimpleValues_From_MavenProject_When_VersionInfoPropsWere_Empty() {\n        // given\n        String projectVersion = \"1.21.1\";\n        doReturn(projectVersion).when(project).getVersion();\n        versionInfo.txtFileVersion = null;\n        versionInfo.txtProductVersion = null;\n\n        String projectName = \"launch4j-test-app\";\n        doReturn(projectName).when(project).getName();\n        versionInfo.productName = null;\n\n        String projectArtifactId = \"launch4j-test\";\n        doReturn(projectArtifactId).when(project).getArtifactId();\n        versionInfo.internalName = null;\n\n        String projectDescription = \"Launch4j Test App\";\n        doReturn(projectDescription).when(project).getDescription();\n        versionInfo.fileDescription = null;\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertEquals(projectVersion, versionInfo.txtFileVersion);\n        assertEquals(projectVersion, versionInfo.txtProductVersion);\n        assertEquals(projectName, versionInfo.productName);\n        assertEquals(projectArtifactId, versionInfo.internalName);\n        assertEquals(projectDescription, versionInfo.fileDescription);\n    }\n\n    @Test\n    public void should_Not_FillOut_ByDefault_LastSegmentOfOutfilePath_When_OriginalFilenameWas_Filled() {\n        // given\n        String outfileName = \"testApp.exe\";\n        doReturn(outfileName).when(outfile).getName();\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertNotEquals(outfileName, versionInfo.originalFilename);\n        assertEquals(originalFilename, versionInfo.originalFilename);\n    }\n\n    @Test\n    public void shouldFillOut_ByDefault_LastSegmentOfOutfilePath_When_OriginalFilenameWas_Empty() {\n        // given\n        String outfileName = \"testApp.exe\";\n        doReturn(outfileName).when(outfile).getName();\n        versionInfo.originalFilename = null;\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertEquals(outfileName, versionInfo.originalFilename);\n    }\n\n    @Test\n    public void shouldLogWarningsAboutDummyValues() {\n        // given\n        ArgumentCaptor<String> logMessageCaptor = ArgumentCaptor.forClass(String.class);\n        List<String> missingParamNames = Arrays.asList(\n                \"project.version\",\n                \"project.name\",\n                \"project.artifactId\",\n                \"project.description\",\n                \"project.inceptionYear\",\n                \"project.organization.name\",\n                \"outfile\"\n        );\n\n        // when\n        versionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        verify(log, times(missingParamNames.size())).warn(logMessageCaptor.capture());\n        List<String> logMessages = logMessageCaptor.getAllValues();\n\n\n        missingParamNames.forEach(missingParamName -> {\n            assertTrue(logMessages.stream().anyMatch(message -> message.contains(missingParamName)));\n        });\n    }\n\n    @Test\n    public void shouldFillOut_ByDummyValues_When_OriginalValues_Empty_And_ProjectParams_Empty() {\n        // given\n        final String buildYear = String.valueOf(LocalDate.now().getYear());\n\n        VersionInfo emptyValuesVersionInfo = new VersionInfo();\n        emptyValuesVersionInfo.setLog(log);\n\n        // when\n        emptyValuesVersionInfo.tryFillOutByDefaults(project, outfile);\n\n        // then\n        assertEquals(\"1.0.0.0\", emptyValuesVersionInfo.fileVersion);\n        assertEquals(\"1.0.0\", emptyValuesVersionInfo.txtFileVersion);\n        assertEquals(\"A Java project.\", emptyValuesVersionInfo.fileDescription);\n        assertEquals(\"Copyright © 2020-\" + buildYear + \" Default organization. All rights reserved.\", emptyValuesVersionInfo.copyright);\n        assertEquals(\"1.0.0.0\", emptyValuesVersionInfo.productVersion);\n        assertEquals(\"1.0.0\", emptyValuesVersionInfo.txtProductVersion);\n        assertEquals(\"Java Project\", emptyValuesVersionInfo.productName);\n        assertEquals(\"Default organization\", emptyValuesVersionInfo.companyName);\n        assertEquals(\"java-project\", emptyValuesVersionInfo.internalName);\n        assertEquals(\"Default organization\", emptyValuesVersionInfo.trademarks);\n        assertEquals(\"app.exe\", emptyValuesVersionInfo.originalFilename);\n    }\n\n    @Test\n    public void shouldGenerateString_WithTestParams() {\n        // when\n        String result = versionInfo.toString();\n\n        // then\n        assertNotNull(result);\n        assertTrue(containsParam(result, \"fileVersion\", fileVersion));\n        assertTrue(containsParam(result, \"txtFileVersion\", txtFileVersion));\n        assertTrue(containsParam(result, \"fileDescription\", fileDescription));\n        assertTrue(containsParam(result, \"copyright\", copyright));\n        assertTrue(containsParam(result, \"productVersion\", productVersion));\n        assertTrue(containsParam(result, \"txtProductVersion\", txtProductVersion));\n        assertTrue(containsParam(result, \"productName\", productName));\n        assertTrue(containsParam(result, \"companyName\", companyName));\n        assertTrue(containsParam(result, \"internalName\", internalName));\n        assertTrue(containsParam(result, \"originalFilename\", originalFilename));\n        assertTrue(containsParam(result, \"language\", language));\n        assertTrue(containsParam(result, \"trademarks\", trademarks));\n    }\n\n    private boolean containsParam(String result, String paramName, String paramValue) {\n        return result.contains(paramName + \"='\" + paramValue + \"'\");\n    }\n}\n"
  },
  {
    "path": "src/test/java/com/akathist/maven/plugins/launch4j/generators/CopyrightGeneratorTest.java",
    "content": "package com.akathist.maven.plugins.launch4j.generators;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.time.LocalDate;\n\nimport static org.junit.Assert.*;\n\npublic class CopyrightGeneratorTest {\n    private static final String COPYRIGHT_PREFIX = \"Copyright © \";\n    private static final String COPYRIGHT_POSTFIX = \". All rights reserved.\";\n\n    private String buildYear;\n\n    @Before\n    public void initializeBuildYear() {\n        buildYear = String.valueOf(\n                LocalDate.now().getYear()\n        );\n    }\n\n    @Test\n    public void shouldContain_BuildYear() {\n        // when\n        final String copyright = CopyrightGenerator.generate(null, null);\n\n        // then\n        String expected = concatAndWrapWithCopyright(buildYear);\n        assertEquals(expected, copyright);\n    }\n\n    @Test\n    public void shouldContain_InceptionYear_And_BuildYear() {\n        // given\n        final String projectInceptionYear = \"2019\";\n\n        // when\n        final String copyright = CopyrightGenerator.generate(projectInceptionYear, null);\n\n        // then\n        String expected = concatAndWrapWithCopyright(\n                projectInceptionYear, \"-\", buildYear\n        );\n        assertEquals(expected, copyright);\n    }\n\n    @Test\n    public void shouldContain_BuildYear_And_OrganizationName() {\n        // given\n        final String organizationName = \"SoftwareMill\";\n\n        // when\n        final String copyright = CopyrightGenerator.generate(null, organizationName);\n\n        // then\n        String expected = concatAndWrapWithCopyright(\n                buildYear, \" \", organizationName\n        );\n        assertEquals(expected, copyright);\n    }\n\n    @Test\n    public void shouldContain_InceptionYear_And_BuildYear_And_OrganizationName() {\n        // given\n        final String projectInceptionYear = \"2020\";\n        final String organizationName = \"Orphan OSS\";\n\n        // when\n        final String copyright = CopyrightGenerator.generate(projectInceptionYear, organizationName);\n\n        // then\n        String expected = concatAndWrapWithCopyright(\n                projectInceptionYear, \"-\", buildYear, \" \", organizationName\n        );\n        assertEquals(expected, copyright);\n    }\n\n    private String concatAndWrapWithCopyright(String... elements) {\n        StringBuilder builder = new StringBuilder(COPYRIGHT_PREFIX);\n\n        for (String element : elements) {\n            builder.append(element);\n        }\n\n        builder.append(COPYRIGHT_POSTFIX);\n\n        return builder.toString();\n    }\n}\n"
  },
  {
    "path": "src/test/java/com/akathist/maven/plugins/launch4j/generators/Launch4jFileVersionGeneratorTest.java",
    "content": "package com.akathist.maven.plugins.launch4j.generators;\n\nimport junitparams.JUnitParamsRunner;\nimport junitparams.Parameters;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n@RunWith(JUnitParamsRunner.class)\npublic class Launch4jFileVersionGeneratorTest {\n    @Test\n    public void shouldReturnNull_WhenProjectVersionIsNull() {\n        // given\n        String projectVersion = null;\n\n        // expect\n        assertNull(Launch4jFileVersionGenerator.generate(projectVersion));\n    }\n\n    @Test(expected = IllegalArgumentException.class)\n    @Parameters({\n        \"\",\n        \" \",\n        \"null\",\n        \"alpha-1.2.3\",\n        \"1a.2.3\",\n        \"1.X.3\",\n        \"1.2.3_11\",\n        \"1.2.3;4\",\n        \"1.2.3.4SNAPSHOT\",\n        \"1.2.3.4.SNAPSHOT\"\n    })\n    public void shouldThrowException_WhenProjectVersion_HaveWrongFormat(String projectVersion) {\n        // expect throws\n        Launch4jFileVersionGenerator.generate(projectVersion);\n    }\n\n    @Test\n    @Parameters({\n        \"0, 0.0.0.0\",\n        \"1, 1.0.0.0\",\n        \"2, 2.0.0.0\",\n        \"3.14, 3.14.0.0\",\n        \"4.0.1, 4.0.1.0\",\n        \"55.44.33, 55.44.33.0\"\n    })\n    public void shouldFillMissingPlacesByZeros(String projectVersion, String expected) {\n        // when\n        final String launch4jFileVersion = Launch4jFileVersionGenerator.generate(projectVersion);\n\n        // then\n        assertEquals(expected, launch4jFileVersion);\n    }\n\n    @Test\n    @Parameters({\n        \"1-SNAPSHOT, 1.0.0.0\",\n        \"1.2.1-alpha, 1.2.1.0\",\n        \"1.2.3.4-beta, 1.2.3.4\",\n        \"0.0.1-snapshot, 0.0.1.0\",\n        \"1.2.3.4-alpha+001, 1.2.3.4\",\n        \"1.2.3-alpha+001, 1.2.3.0\",\n        \"1.2.3.4-alpha+001, 1.2.3.4\",\n        \"1.2.3+20130313144700, 1.2.3.0\",\n        \"1.2.3.4+20130313144700, 1.2.3.4\",\n        \"1.2.3-beta+exp.sha.5114f85, 1.2.3.0\",\n        \"1.2.3.4-beta+exp.sha.5114f85, 1.2.3.4\",\n    })\n    public void shouldCutOffTextFlags(String projectVersion, String expected) {\n        // when\n        final String launch4jFileVersion = Launch4jFileVersionGenerator.generate(projectVersion);\n\n        // then\n        assertEquals(expected, launch4jFileVersion);\n    }\n\n    @Test\n    @Parameters({\n        \"0.0.0.0.1, 0.0.0.0\",\n        \"1.22.333.4444.55555.666666, 1.22.333.4444\",\n        \"9.8.7.6.5-SNAPSHOT, 9.8.7.6\",\n        \"3.0.1.12.44.62.1.0.0.0.1-alpha, 3.0.1.12\",\n    })\n    public void shouldCutOffTooManyNestedDigits(String projectVersion, String expected) {\n        // when\n        final String launch4jFileVersion = Launch4jFileVersionGenerator.generate(projectVersion);\n\n        // then\n        assertEquals(expected, launch4jFileVersion);\n    }\n\n    @Test\n    @Parameters({\n        \"302.08, 302.8.0.0\",\n        \"1.02.3, 1.2.3.0\",\n        \"01.02.03.04, 1.2.3.4\",\n        \"10.00.01, 10.0.1.0\",\n        \"0.08.09, 0.8.9.0\",\n        \"302.08-SNAPSHOT, 302.8.0.0\",\n        \"1.02.03.04.05.06, 1.2.3.4\",\n        \"000.001.002, 0.1.2.0\"\n    })\n    public void shouldStripLeadingZerosFromVersionComponents(String projectVersion, String expected) {\n        // when\n        final String launch4jFileVersion = Launch4jFileVersionGenerator.generate(projectVersion);\n\n        // then\n        assertEquals(expected, launch4jFileVersion);\n    }\n\n    @Test\n    @Parameters({\n        \"0, 0.0.0.0\",\n        \"00, 0.0.0.0\",\n        \"000, 0.0.0.0\",\n        \"0.0, 0.0.0.0\",\n        \"00.00, 0.0.0.0\",\n        \"000.000, 0.0.0.0\"\n    })\n    public void shouldHandleZeroVersionsCorrectly(String projectVersion, String expected) {\n        // when\n        final String launch4jFileVersion = Launch4jFileVersionGenerator.generate(projectVersion);\n\n        // then\n        assertEquals(expected, launch4jFileVersion);\n    }\n}"
  },
  {
    "path": "src/test/resources/unit/launch4j-config/launch4j-full-plugin-config.xml",
    "content": "<!--\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *  http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n-->\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>com.akathist.maven.plugins.launch4j.unit</groupId>\n    <artifactId>launch4j-default</artifactId>\n    <version>1.0-SNAPSHOT</version>\n    <packaging>jar</packaging>\n\n    <name>launch4j-full</name>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>com.akathist.maven.plugins.launch4j</groupId>\n                <artifactId>launch4j-maven-plugin</artifactId>\n                <configuration>\n                    <headerType>gui</headerType>\n                    <jar>${project.build.directory}/${project.artifactId}-${project.version}.jar</jar>\n                    <outfile>${project.build.directory}/app.exe</outfile>\n                    <downloadUrl>https://java.com/download</downloadUrl>\n                    <classPath>\n                        <mainClass>pl.org.lenart.launch4j.App</mainClass>\n                        <preCp>anything</preCp>\n                    </classPath>\n                    <jre>\n                        <path>%JAVA_HOME%;%PATH%</path>\n                        <minVersion>1.8</minVersion>\n                        <bundledJreAsFallback>true</bundledJreAsFallback>\n                        <jdkPreference>preferJre</jdkPreference>\n                        <requiresJdk>true</requiresJdk>\n                        <bundledJre64Bit>true</bundledJre64Bit>\n                        <runtimeBits>32</runtimeBits>\n                        <opts>\n                            <opt>-Dname=Lukasz</opt>\n                        </opts>\n                    </jre>\n                    <disableVersionInfoDefaults>true</disableVersionInfoDefaults>\n                    <messages>\n                        <bundledJreErr>Test bundledJreErr</bundledJreErr>\n                    </messages>\n                    <versionInfo>\n                        <fileVersion>1.0.0.0</fileVersion>\n                        <txtFileVersion>${project.version}</txtFileVersion>\n                        <fileDescription>Launch4j Demo App</fileDescription>\n                        <copyright>Lukasz Lenart</copyright>\n                        <productVersion>1.0.0.0</productVersion>\n                        <txtProductVersion>1.0.0.0</txtProductVersion>\n                        <productName>App</productName>\n                        <companyName>Lukasz Lenart</companyName>\n                        <internalName>app</internalName>\n                        <originalFilename>app.exe</originalFilename>\n                        <trademarks>Luk ™</trademarks>\n                    </versionInfo>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n\n</project>"
  }
]