-
Notifications
You must be signed in to change notification settings - Fork 147
Description
JavaPackager version
1.7.6
Operating system
Linux
OS version
Ubuntu 25.10
Build tool
Maven
JDK version
openjdk 17.0.18 2026-01-20
Short description
org.apache.maven.plugin.MojoExecutionException: Cannot fill out VersionInfo by defaults: 'project.version' is in invalid format. Regex pattern: ^((\d(\.)?)*\d+)(-\w+)?$
When using 0.1-20260316-NIGHTLY as project.version
Steps to reproduce
- use
0.1-20260316-NIGHTLYas project.version, or something isn't strictly numbers separated by dots and use0.1.20260316aswinVersion
And
<winConfig>
<fileVersion>${winVersion}</fileVersion>
<txtFileVersion>${winVersion}</txtFileVersion>
<productVersion>${winVersion}</productVersion>
<txtProductVersion>${winVersion}</txtProductVersion>
</winConfig>
<version>${winVersion}</version>
- try packaging for windows
Expected behavior
It should use winVersion, which is in the correct format and not throw an error
Actual behavior
Java packager throws an error because it still checks project.version, even when it isn't referenced anywhere.
It should probably allow for any text in the project.version, because this also restricts versions like -SNAPSHOT.
I also took a loot at target/launch4j/app.exe.manifest and it looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity version="1.0.0.0" processorArchitecture="x86" name="name..." type="win32"/>
<description>desc...</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 / Windows Server 2016 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
<!-- Windows 8.1 / Windows Server 2012 R2 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 8 / Windows Server 2012 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 7 / Windows Server 2008 R2 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows Vista / Windows Server 2008 -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
</application>
</compatibility>
</assembly>
I can't figure out where version="1.0.0.0" comes from, I though it was the default value for <productVersion>1.0.0.0</productVersion> and <fileVersion>1.0.0.0</fileVersion> but I overwrite them in the plugin configuration. (https://github.com/javapackager/JavaPackager/blob/master/docs/windows-specific-properties.md)
Logs and output
[INFO] PackagerSettings [outputDirectory=/ssd2/workspaces/java2/plant-game/plant-game-core/target/dist/windows, licenseFile=null, iconFile=null, generateInstaller=true, forceInstaller=false, mainClass=lu.kbra.plant_game.PGMain, name=Satisplantory, displayName=Plant Game (Core), version=0.1.20260316, description=The core of a game about plants, url=null, administratorRequired=false, organizationName=ACME, organizationUrl=, organizationEmail=null, bundleJre=true, customizedJre=true, jrePath=null, jdkPath=/usr/lib/jvm/java-21-openjdk-amd64, additionalResources=[], modules=[], additionalModules=[], platform=windows, envPath=null, vmArgs=[], runnableJar=null, copyDependencies=true, jreDirectoryName=jre, winConfig=WindowsConfig [icoFile=null, headerType=gui, companyName=ACME, copyright=ACME, fileDescription=The core of a game about plants, fileVersion=0.1.20260316, internalName=Satisplantory, language=null, originalFilename=Satisplantory.exe, productName=Satisplantory, productVersion=0.1.20260316, trademarks=ACME, txtFileVersion=0.1.20260316, txtProductVersion=0.1.20260316, shortcutName=Plant Game (Core), disableDirPage=true, disableProgramGroupPage=true, disableFinishedPage=true, disableRunAfterInstall=true, disableWelcomePage=true, createDesktopIconTask=true, generateSetup=true, generateMsi=true, generateMsm=false, msiUpgradeCode=b914743f-bcfc-4ead-9365-fd72b91ec0dc, wrapJar=true, setupLanguages={english=compiler:Default.isl, spanish=compiler:Languages\Spanish.isl}, setupMode=installForAllUsers, signing=null, registry=Registry [entries=[]], removeOldLibs=false, exeCreationTool=launch4j, vmLocation=null], linuxConfig=null, macConfig=null, createTarball=false, tarballName=null, createZipball=false, zipballName=null, extra=null, useResourcesAsWorkingDir=true, assetsDir=/ssd2/workspaces/java2/plant-game/plant-game-core/assets, classpath=null, jreMinVersion=null, manifest=null, additionalModulePaths=[], fileAssociations=[], packagingJdk=/usr/lib/jvm/java-21-openjdk-amd64, scripts=Scripts [bootstrap=null, preInstall=null, postInstall=null], arch=x64, templates=[Template [name=windows/iss.vtl, bom=true]]]
[ERROR] Failed to execute goal io.github.fvarrui:javapackager:1.7.6:package (package-windows) on project plant-game-core: org.apache.maven.plugin.MojoExecutionException: Cannot fill out VersionInfo by defaults: 'project.version' is in invalid format. Regex pattern: ^((\d(\.)?)*\d+)(-\w+)?$ -> [Help 1]
Checklist
- I searched for existing related issues
- I can provide a minimal reproducible example if needed