fvarrui / JavaPackager

:package: Gradle/Maven plugin to package Java applications as native Windows, MacOS, or Linux executables and create installers for them.
GNU General Public License v3.0
1.06k stars 132 forks source link

Mac platform packaging process stuck problem #357

Closed 983183947 closed 4 months ago

983183947 commented 1 year ago

I am using the maven plug-in 1.7.3. When packaging the mac, I found that the progress has been stuck as follows:

[INFO]     Bundling JRE ... with /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home
[INFO]         Embedding JRE from /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home
[INFO]         Copying folder content [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Copying folder [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/demo] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' -R /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/demo /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home
[INFO]         Copying folder [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/man] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' -R /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/man /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home
[INFO]         Copying file [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/DISCLAIMER] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/DISCLAIMER /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home/DISCLAIMER
[INFO]         Copying folder [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/bin] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' -R /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/bin /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home
[INFO]         Copying folder [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/include] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' -R /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/include /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home
[INFO]         Copying file [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/release] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/release /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home/release
[INFO]         Copying file [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/Welcome.html] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/Welcome.html /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home/Welcome.html
[INFO]         Copying folder [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/lib] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' -R /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/lib /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home
[INFO]         Copying file [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/readme.txt] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/readme.txt /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home/readme.txt
[INFO]         Copying folder [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/legal] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' -R /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/legal /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home
[INFO]         Copying folder [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/conf] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' -R /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/conf /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home
[INFO]         Copying folder [/Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/jmods] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' -R /Users/zhengzijian/Library/Java/JavaVirtualMachines/azul-17.0.6/Contents/Home/jmods /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home
[INFO]         Removing folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home/legal]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'rm' -fr /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home/legal
[INFO]         Removing folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home/man]
[INFO]         Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'rm' -fr /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home/man
[INFO]     JRE bundled in /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Home!
[INFO]     
[INFO]     RuntimeInfo.plist file created in /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/PlugIns/jre.jre/Contents/Info.plist
[INFO]     Copying file [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core-3.0.0-SNAPSHOT-runnable.jar] to folder [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/Resources/Java]
[INFO]     Executing command: /bin/sh -c cd '/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/.' && 'cp' /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core-3.0.0-SNAPSHOT-runnable.jar /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/Resources/Java/mapper-generator-javafx-core-3.0.0-SNAPSHOT-runnable.jar
[INFO]     Copying resource [/mac/universalJavaApplicationStub.sh] to file [/Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/MacOS/universalJavaApplicationStub]
[INFO]     Startup script file created in /Users/zhengzijian/Documents/mapper-generator-javafx-master/mapper-generator-javafx-core/target/mapper-generator-javafx-core/mapper-generator-javafx-core.app/Contents/MacOS/universalJavaApplicationStub

This is my configuration:

  <executions>
    <execution>
        <phase>package</phase>
        <goals>
            <goal>package</goal>
        </goals>
        <configuration>
            <name>${artifactId}</name>
            <displayName>mybatis-friend</displayName>
            <additionalResources>
                <additionalResource>target/classes/template/</additionalResource>
            </additionalResources>
            <vmArgs>
                <arg>-Denv=pro</arg>
                <!--                                <arg>&#45;&#45;add-opens java.base/java.lang.reflect=com.jfoenix</arg>-->
                <!--                                <arg>&#45;&#45;add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls</arg>-->
            </vmArgs>
            <mainClass>com.alan344.MapperGenApplication</mainClass>
            <!-- optional -->
            <bundleJre>true</bundleJre>
            <jrePath>${java.home}</jrePath>
            <customizedJre>false</customizedJre>
            <copyDependencies>true</copyDependencies>
            <generateInstaller>false</generateInstaller>
            <forceInstaller>true</forceInstaller>
            <winConfig>
                <headerType>gui</headerType>
            </winConfig>
            <macConfig>
                <generatePkg>true</generatePkg>
                <generateDmg>true</generateDmg>
                <macStartup>SCRIPT</macStartup>
                <!--                                <macStartup>SCRIPT|UNIVERSAL|X86_64|ARM64</macStartup>-->
                <codesignApp>false</codesignApp>
                <!--                                <hardenedCodesign>false</hardenedCodesign>-->
                <volumeName>${name}</volumeName>
            </macConfig>
        </configuration>
    </execution>
</executions>
fvarrui commented 1 year ago

Hi @983183947!

Yes, this problem was already reported https://github.com/fvarrui/JavaPackager/issues/352 😢 ... I'm not being able to reproduce it, so I don't now how to proceed.

Maybe trying to build the app using some CI solution (CircleCI or GitHub Actions) ... Sorry!! I hope we can find a solution soon. 🤷‍♂️

Knowing the development environment where the app is being built would be helpful to try to narrow down the problem.

qq1014853731 commented 11 months ago

@fvarrui Hi! this is my debug log

[INFO] Using packager io.github.fvarrui.javapackager.packagers.MacPackager
[INFO] Creating app ...
[INFO]     Initializing packager ...
[INFO]         PackagerSettings [outputDirectory=/Users/chukongxiang/Project/pgsql-runner/target, licenseFile=null, iconFile=null, generateInstaller=true, forceInstaller=false, mainClass=com.dyt.pgsql.runner.RunnerApplication, name=pgsql-runner, displayName=pgsql-runner, version=1.0, description=Parent pom providing dependency and plugin management for applications built with Maven, url=http://maven.apache.org, administratorRequired=true, organizationName=ACME, organizationUrl=, organizationEmail=null, bundleJre=false, customizedJre=true, jrePath=null, jdkPath=/Users/chukongxiang/Project/pgsql-runner/Java/lib/java, additionalResources=[/Users/chukongxiang/Project/pgsql-runner/Java], modules=[], additionalModules=[], platform=mac, envPath=null, vmArgs=[], runnableJar=/Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner-1.0.jar, copyDependencies=false, jreDirectoryName=jre, winConfig=null, linuxConfig=null, macConfig=MacConfig [icnsFile=null, backgroundImage=null, windowWidth=540, windowHeight=360, windowX=10, windowY=60, iconSize=128, textSize=16, iconX=52, iconY=116, appsLinkIconX=360, appsLinkIconY=116, volumeIcon=null, volumeName=null, generateDmg=true, generatePkg=true, relocateJar=true, appId=com.dyt.pgsql.runner.RunnerApplication, developerId=-, entitlements=null, provisionProfile=null, customLauncher=null, customInfoPlist=null, customRuntimeInfoPlist=null, codesignApp=true, notarizeApp=false, keyChainProfile=null, infoPlist=InfoPlist [additionalEntries=, bundlePackageType=BNDL], hardenedCodesign=true, macStartup=SCRIPT], createTarball=false, tarballName=null, createZipball=false, zipballName=null, extra=null, useResourcesAsWorkingDir=true, assetsDir=/Users/chukongxiang/Project/pgsql-runner/assets, classpath=null, jreMinVersion=null, manifest=null, additionalModulePaths=[], fileAssociations=[], packagingJdk=/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre, scripts=Scripts [bootstrap=null, preInstall=null, postInstall=null], arch=x64, templates=[Template [name=windows/iss.vtl, bom=true]]]
[INFO]     Packager initialized!
[INFO]     
[INFO]     Creating app structure ...
[INFO]         App folder created: /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner
[INFO]         Assets folder created: /Users/chukongxiang/Project/pgsql-runner/target/assets
[INFO]         App file folder created: /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app
[INFO]         Contents folder created: /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents
[INFO]         Resources folder created: /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources
[INFO]         Java folder created: /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources/Java
[INFO]         MacOS folder created: /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/MacOS
[INFO]     App structure created!
[INFO]     
[INFO]     Resolving resources ...
[INFO]         Trying to resolve license from POM ...
[INFO]             File downloaded from [https://www.apache.org/licenses/LICENSE-2.0] to [/Users/chukongxiang/Project/pgsql-runner/target/assets/LICENSE]
[INFO]         License resolved /Users/chukongxiang/Project/pgsql-runner/target/assets/LICENSE!
[INFO]         
[INFO]         License file found: /Users/chukongxiang/Project/pgsql-runner/target/assets/LICENSE
[INFO]         Copying resource [/mac/default-icon.icns] to file [/Users/chukongxiang/Project/pgsql-runner/target/assets/pgsql-runner.icns]
[INFO]         Icon file resolved: /Users/chukongxiang/Project/pgsql-runner/target/assets/pgsql-runner.icns
[INFO]         Effective additional resources [/Users/chukongxiang/Project/pgsql-runner/Java, /Users/chukongxiang/Project/pgsql-runner/target/assets/LICENSE, /Users/chukongxiang/Project/pgsql-runner/target/assets/pgsql-runner.icns]
[INFO]     Resources resolved!
[INFO]     
[INFO]     Copying additional resources
[INFO]         Copying folder [/Users/chukongxiang/Project/pgsql-runner/Java] to folder [/Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources]
[INFO]         Executing command: /bin/sh -c cd '/Users/chukongxiang/Project/pgsql-runner/.' && 'cp' -R /Users/chukongxiang/Project/pgsql-runner/Java /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources
[INFO]         Copying file [/Users/chukongxiang/Project/pgsql-runner/target/assets/LICENSE] to folder [/Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources]
[INFO]         Executing command: /bin/sh -c cd '/Users/chukongxiang/Project/pgsql-runner/.' && 'cp' /Users/chukongxiang/Project/pgsql-runner/target/assets/LICENSE /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources/LICENSE
[INFO]         Copying file [/Users/chukongxiang/Project/pgsql-runner/target/assets/pgsql-runner.icns] to folder [/Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources]
[INFO]         Executing command: /bin/sh -c cd '/Users/chukongxiang/Project/pgsql-runner/.' && 'cp' /Users/chukongxiang/Project/pgsql-runner/target/assets/pgsql-runner.icns /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources/pgsql-runner.icns
[INFO]     All additional resources copied!
[INFO]     
[INFO]     Copying all dependencies ...
[INFO]     Dependencies copied to null!
[INFO]     
[INFO]     Using runnable JAR: /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner-1.0.jar
[WARNING]     JRE artifact generation skipped!
[INFO]     Copying file [/Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner-1.0.jar] to folder [/Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources/Java]
[INFO]     Executing command: /bin/sh -c cd '/Users/chukongxiang/Project/pgsql-runner/.' && 'cp' /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner-1.0.jar /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/Resources/Java/pgsql-runner-1.0.jar
[DEBUG] Initializing Velocity, Calling init()...
[DEBUG] Starting Apache Velocity v2.3
[DEBUG] Default Properties resource: org/apache/velocity/runtime/defaults/velocity.properties
[DEBUG] ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.FileResourceLoader
[DEBUG] FileResourceLoader: adding path '/Users/chukongxiang/Project/pgsql-runner/assets'
[DEBUG] ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
[DEBUG] initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl) with class java.util.Collections$SynchronizedMap cache map.
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Stop
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Define
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Break
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Evaluate
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[DEBUG] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[DEBUG] Created '20' parsers.
[DEBUG] "velocimacro.library.path" is not set. Trying default library: velocimacros.vtl
[DEBUG] Could not load resource 'velocimacros.vtl' from ResourceLoader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
[DEBUG] Default library velocimacros.vtl not found. Trying old default library: VM_global_library.vm
[DEBUG] Could not load resource 'VM_global_library.vm' from ResourceLoader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
[DEBUG] Old default library VM_global_library.vm not found.
[DEBUG] allowInline = true: VMs can be defined inline in templates
[DEBUG] allowInlineToOverride = false: VMs defined inline may NOT replace previous VM definitions
[DEBUG] allowInlineLocal = false: VMs defined inline will be global in scope if allowed.
[DEBUG] autoload off: VM system will not automatically reload global library macros
[DEBUG] ResourceManager: found mac/startup.vtl with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
[DEBUG] Null reference [template 'mac/startup.vtl', line 4, column 48]: $SCRIPTPATH cannot be resolved.
[INFO]     Startup script file created in /Users/chukongxiang/Project/pgsql-runner/target/pgsql-runner/pgsql-runner.app/Contents/MacOS/startup
[DEBUG] ResourceManager: found mac/Info.plist.vtl with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
[DEBUG] Null reference [template 'mac/Info.plist.vtl', line 112, column 33]: $APP_PACKAGE cannot be resolved.
[DEBUG] Null reference [template 'mac/Info.plist.vtl', line 115, column 33]: $APP_PACKAGE cannot be resolved.

pom.xml

    <build>
        <finalName>${jarName}</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                    <mainClass>com.dyt.pgsql.runner.RunnerApplication</mainClass>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.github.fvarrui</groupId>
                <artifactId>javapackager</artifactId>
                <version>1.7.5</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>package</goal>
                        </goals>
                        <configuration>
                            <mainClass>com.dyt.pgsql.runner.RunnerApplication</mainClass>
                            <bundleJre>false</bundleJre>
<!--                            <packagingJdk>false</packagingJdk>-->
                            <jdkPath>./Java/lib/java</jdkPath>
                            <copyDependencies>false</copyDependencies>
                            <generateInstaller>true</generateInstaller>
                            <administratorRequired>true</administratorRequired>
                            <platform>auto</platform>
                            <runnableJar>${project.basedir}/target/${jarName}.jar</runnableJar>
                            <additionalResources>
                                <additionalResource>${project.basedir}/Java</additionalResource>
                            </additionalResources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
aomn commented 9 months ago

I also encountered this problem. After many tests, it seems to be related to starting the network proxy. It will look like this when the network proxy is turned on, and it will be normal if it is turned off.

fvarrui commented 4 months ago

So, is it not related to JavaPackager?

fvarrui commented 4 months ago

https://github.com/fvarrui/JavaPackager/issues/352#issuecomment-1894878986