federkasten / appbundle-maven-plugin Goto Github PK
View Code? Open in Web Editor NEWMaven plugin that creates an Application Bundle for OS X containing all your project dependencies and the necessary metadata
License: Apache License 2.0
Maven plugin that creates an Application Bundle for OS X containing all your project dependencies and the necessary metadata
License: Apache License 2.0
I've seen a few fixes pulled in last year, is there a plan to push 1.2.1-SNAPSHOT to maven central containing these fixes anytime soon?
Hey! My machine of development is windows 10. When running the plugin in windows i get this error:
[ERROR] Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.1.0:bundle (default) on project org.hive2hive.client: Error copying folder C:\ambiente_neomind_util\jre8 to C:\ambiente_neomind\workspace\Fus
ionBox\temp\fusionbox-client\target\org.hive2hive.client-1.1.1-SNAPSHOT\Hive2Hive Client.app\Contents\PlugIns\JRE\Contents\Home\jre: Source directory doesn't exists (C:\ambiente_neomind_util\jre8\Contents\Home). ->
[Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I believe this error ocurred by the plugin get the path adding '\Contents\Home'.
I am getting a NPE. Configuration:
plugin>
groupId>sh.tak.appbundler
artifactId>appbundle-maven-plugin
version>1.2.0
configuration>
mainClass>redacted
jvmVersion>1.8+
jvmOptions>
/jvmOptions>
/configuration>
executions>
execution>
phase>package
goals>
goal>bundle
/goals>
/execution>
/executions>
/plugin>
and the stack trace is:
[ERROR] Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle (default) on project nag-osx-tbwa: Execution default of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle (default) on project nag-osx-tbwa: Execution default of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: java.lang.NullPointerException
at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1071)
at sh.tak.appbundler.CreateApplicationBundleMojo.copyDependencies(CreateApplicationBundleMojo.java:514)
at sh.tak.appbundler.CreateApplicationBundleMojo.execute(CreateApplicationBundleMojo.java:338)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
I see it is trying to copy something. What am I missing?
My packaged application on OS X has the "Contents" folder, and in it:
I figured that "Resources" would be a good place to put my resources instead of packing them inside a JAR.
Does this plugin help in doing that?
It would be nice to have a configuration option to include symlink to the Applications folder into DMG file.
Something like createApplicationSymbolicLink parameter in this project:
https://github.com/RomanKisilenko/osxappbundle
I migrated from osxappbundle-maven-plugin
but my dictionaryFile
seems to no longer work.
My pom.xml
has
<dictionaryFile>${basedir}/src/main/app-resources/Info.plist</dictionaryFile>
and it used to work, but now I get
Could not find resource for template /Users/chen/maven/chatter/src/main/app-resources/Info.plist
Hi,
This is more a question than an issue,
do you think your plugin is compatible with tycho project ?
Best
SR
Hi.
I followed the instructions to create an app bundle, but this message is appearing:
"You can’t open the application “MyApp.app” because it may be damaged or incomplete."
Here is my plugin configuration:
<plugin>
<groupId>sh.tak.appbundler</groupId>
<artifactId>appbundle-maven-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<mainClass>_39dev.com.mmoviewer.view.MainFrame</mainClass>
<dictionaryFile>Info.plist</dictionaryFile>
<iconFile>Icon.icns</iconFile>
<jvmVersion>1.8+</jvmVersion>
<jrePath>/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk</jrePath>
<generateDiskImageFile>true</generateDiskImageFile>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
</plugin>
And here is my Info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>MMOViewer</string>
<key>CFBundleIconFile</key>
<string>Icon</string>
<key>CFBundleIdentifier</key>
<string>br.com.mmo.mmoviewer</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>MMOViewer</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.10.0</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 MMO Ltda. All rights reserved.</string>
</dict>
</plist>
The icon of my app has a "stop" sign over it.
Isn't a security issue, because I already changed my Settings to allow apps from anywhere. I also tried ctrl + "Open", but the message continues appearing.
Some clue why this is happening?
Thanks in advance.
Obs: I'm running on a El Captain 10.11.6.
Setting any strings to javaLauncherName
other than the default one, like <javaLauncherName>DMS</javaLauncherName>
or <javaLauncherName>${project.name.short}</javaLauncherName>
make the build throw NPE.
EDIT: Under Linux OS.
[INFO] Copying the native Java Application Stub
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:19 min
[INFO] Finished at: 2018-06-06T01:31:10+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle (MakeDMG) on project dms: Execution MakeDMG of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle (MakeDMG) on project dms: Execution MakeDMG of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution MakeDMG of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.NullPointerException
at org.codehaus.plexus.util.IOUtil.copy (IOUtil.java:189)
at org.codehaus.plexus.util.IOUtil.copy (IOUtil.java:175)
at sh.tak.appbundler.CreateApplicationBundleMojo.execute (CreateApplicationBundleMojo.java:315)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Hello,
I went over the documentation here https://java.net/downloads/appbundler/appbundler.html in order to better understand what you do in the mojo code.
Nonetheless, I cannot figure out if I need to copy the jre myself manually into a location (which location?) within the generated .app bundle or if there is an option for it.
It seems that the option in the ant task is called "runtime", but looking over your code in the mojo I can't find a similar one.
Could you provide some insight on the above?
Thank you,
Fotis
This is my first time trying this. It would save me an immense amount of time if I could get it working. I followed the instructions in the README and it did, in fact, create the .app file!
Unfortunately, when I try to start the app, the icon shows in the command bar, then disappears. Can't seem to get it to start.
I need to add more files to the bundle, how do I do this?
Alternately, I have a shaded jar that has everything already bundled, and simply need the .app to run java -jar my_shaded.jar
. How would I do this?
When I run appbuilder as part of a module build, I get the following error.
ResourceManager : unable to find resource 'Info.plist' in any resource loader
When I run the maven project standalone, it succeeds.
The plugin needs a skip property to match most other Maven plugins. There doesn't currently seem to be a way of dynamically skipping its execution.
https://java.net/projects/appbundler/lists/dev/archive/2013-11/message/0
describes the issue of command-line arguments not being transferred to the java program and has a patch.
Hi
I wanted to ask if there was a way to pass arguments to the application
I have custom Info.plist where i have
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Lost Victories Launcher</string>
<key>CFBundleURLSchemes</key>
<array>
<string>lostvic</string>
</array>
</dict>
</array>
which successfully launches the installed application when a user clicks on
<a href="lostvic://lostVictoriesLauncher/game=eyJpZCI6ImJhdHRsZV9....
but i need a way to pass thew clicked url as an argument to the application which can read game=
in applescript this can be done by this techinque
Is there a way to do this in your current project?
If not would it be easy for me to do?
I have created an app using this plugin and when I compile it on my mac using maven, it runs fine on my mac. However, if I compile it using mvn on the server where I make it available online, and then try to run it on my mac, I get the following error message:
"WorldJam" is damaged and can’t be opened. You should move it to the Trash. Safari downloaded this file today at 2:12 PM from [url of the server I put it on]
(WorldJam is the name of the program
How do I prevent this problem, and create a copy of the app that can be opened on a mac that is not necessarily the one that it was compiled on?
The icns file that is copied to the Resources folder of the app contents is somehow broken in the process and is not an icon file: it is larger and not recognized by Preview or Icon Composer, for example. I have tested this by using known icns files such as netbeans.icns in addition to the icon for my app. I think it is related to how the resource stream is read from the class loader. I can replace the icns file in the Resources folder after the app is built and it works fine. One of my students has made a robust resource extractor that works in jars and wars in addition to normal directory structures:
https://github.com/CIRDLES/Commons/blob/master/src/main/java/org/cirdles/commons/util/ResourceExtractor.java
I will experiment with this, but wanted to bring it to everyone's attention.
Hi,
I have a problem packaging a jar into a mac app bundle.
With these two plugins I can package everything into one single jar file that I can start on the command line:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>at.spot.velocityeditor.Application</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
Now I want to use this plugin:
<plugin>
<groupId>sh.tak.appbundler</groupId>
<artifactId>appbundle-maven-plugin</artifactId>
<version>1.0.4</version>
<configuration>
<jvmOptions>
<jvmOption>-XstartOnFirstThread</jvmOption>
</jvmOptions>
<mainClass>at.spot.velocityeditor.Application</mainClass>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
</plugin>
But unfortunately I get this stacktrace:
java.lang.NullPointerException
at org.eclipse.swt.widgets.Scrollable.getClientArea(Unknown Source)
at org.eclipse.swt.widgets.ToolBar.relayout(Unknown Source)
at org.eclipse.swt.widgets.ToolBar.createItem(Unknown Source)
at org.eclipse.swt.widgets.ToolItem.<init>(Unknown Source)
at at.spot.velocityeditor.Application.createToolbarButton(Application.java:211)
This indicated that an SWT library has not been found.
Is there any way to add all dependencies to the generated mac app bundle?
There are a couple of issues with iconFile:
So I was trying for the life of me to use a JVM option for macOS's dark mode....
After some investigating I found out why the jvm option in the maven plugin isn't working,
Maven plugin JVM Options
options.append(" ").append("<string>").append(jvmOption).append("</string>").append("\n");
It's entering the JVM option into the info.plist as a String, yet from what I found, the dark mode thing needs to be entered as a key and value, ex:
<key>NSRequiresAquaSystemAppearance</key>
<string>NO</string>
When entering this value into the plist manually, it works as expected :)
Hopefully this is something that can be updated in the plugin as I do love this plugin.
Thank you for reading!
Hello,
first of all greetings for your project it is very well described, implemented and extremely useful to facilitate the distribution of java programs on OSx!
I come with a question for you: I need my application to bundle a correct Java Virtual Machine, because I don't want to force my users to install a Java Virtual Machine on their MAC.
So, I followed your steps, and in fact a JVM is embedded in the Application.App package.
The problem is that when I try to execute the application on a MAC without Java installed (I did this by simply removing my installed JVM), the application does not start because it complains that Java is not installed.
Can you tell me how I can tell OSx to use the embedded Java Virtual Machine, or how I can configure this option?
Thank you very much,
Lorenzo
Hi all,
I am starting with this plugin to generate my application dmg file but I have a question. Is possible auto update the application file?
In my windows version I download setup file from an url and then execute it.
Hope a little :)
I needed to make a few changes in your plugin to adapt to my app, but I couldn't generate the maven plugin and got this error: appbundle-maven-plugin/build.sh: clang: not found.
How am I supposed to generate the plugin ?
Thanks for your help !
Our application requires Java 8 and the bundle does not embed the JRE. The Info.plist contains:
<key>JVMVersion</key>
<string>1.8</string>
I have multiple versions of Java on my system and the JavaAppLauncher picks Java 10. There is no reference to JVMVersion
in https://github.com/federkasten/appbundle-maven-plugin/blob/master/native/main.m.
The project at https://bitbucket.org/infinitekind/appbundler has updated code for finding the appropriate JVM.
This warning is displayed while building using Maven 3.3.9.
It build fine under Linux OS.
I suspect that it come from if (SystemUtils.IS_OS_MAC) {
instead of being:
if (SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_MAC) {
Plugin works great, but the application's jar file is the Maven file with all the libraries in it, so libraries are included twice, making app file twice as large as it needs to be. I successfully swapped out the application's jar file with the Maven-generated 'original' jar file (no libraries included) in the app contents and all works great, while eliminating the bloat! Great job and thank you.
The executable files permissions are removed by this plugin, under macOS or Linux OS.
The files permissions "0755" are correctly set by the maven-assembly-plugin but are removed by this appbundle plugin, so all the embedded binaries are not working as expected with this DMG package generated.
I noticed http://mvnrepository.com/artifact/sh.tak.appbundler/appbundle-maven-plugin does not have the latest version of the plugin?
Hello!
We want to use your appbundler-plugin to create jars and later on dmg-files on OS X Yosemite for RyCON and Routeconverter. I downloaded the files and follow the instructions in the readme.md file.
I use this part in the pom.xml:
<plugin>
<groupId>io.github.appbundler</groupId>
<artifactId>appbundle-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<dictionaryFile>Info.plist</dictionaryFile>
<mainClass>de.ryanthara.ja.rycon.gui.MainApplication</mainClass>
<iconFile>RyCON.icns</iconFile>
<jvmVersion>1.7+</jvmVersion>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
</plugin>
When I try to execute the maven goal with "mvn clean install" I run into the following error messages:
[ERROR] Failed to execute goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle (default) on project RyCON_MacOSX64: Could not find resource for template Info.plist: Unable to find resource 'Info.plist' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle (default) on project RyCON_MacOSX64: Could not find resource for template Info.plist
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not find resource for template Info.plist
at io.github.appbundler.CreateApplicationBundleMojo.writeInfoPlist(CreateApplicationBundleMojo.java:458)
at io.github.appbundler.CreateApplicationBundleMojo.execute(CreateApplicationBundleMojo.java:260)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 25 more
Caused by: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'Info.plist'
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:452)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
at io.github.appbundler.CreateApplicationBundleMojo.writeInfoPlist(CreateApplicationBundleMojo.java:446)
... 28 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :RyCON_MacOSX64
Process finished with exit code 1```
So what is missing or going wrong?
There is a little error in `Use Custom Info.plist and Icon` paragraph in the readme.md.
I noticed that your plugin does not create a DMG file. The code part seems to be commented out.
Is there a specific reason for this?
This issue comes from a discussion in issue #1. In a Maven setup with submodules, I observed a problem during debugging:
File f = new File(TARGET_CLASS_ROOT, dictionaryFile);
When I call f.getAbsolutePath() it points to the directory of the root pom.xml (XXX\target\classes\my\Info.plist.template) and not the directory of the module XXX\XXX-for-MacOSX\target\classes\my\Info.plist.template.
When I copy my Info.plist.template to XXX\target\classes\my\Info.plist.template it works.
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
needs to be added to plist template.
Refer as well to:
https://bugs.openjdk.java.net/browse/JDK-8041900
https://bugs.openjdk.java.net/browse/JDK-8132759
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8041900
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8132759
Starting with java 8u76 the plist option will have proper effect (verified on 8u76 beta 4).
Hi,
First off, great work on this. I have a small problem though, when trying to specify a custom Info.plist with
<dictionaryFile>${basedir}/src/main/resources/Info.plist</dictionaryFile>
I get the error:
[ERROR] Failed to execute goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle (default) on project FacebookNotifications: Could not find resource for template /Users/jackfarrelly/Workspace/Facebook Notifications/src/main/resources/Info.plist: Unable to find resource '/Users/jackfarrelly/Workspace/Facebook Notifications/src/main/resources/Info.plist' -> [Help 1]
The file definitely exists
ls /Users/jackfarrelly/Workspace/Facebook Notifications/src/main/resources/Info.plist
works fine. Is this a bug or something I'm doing wrong?
Cheers
I'm trying to add this JVMOptions to theInfo.plist directly from the pom.xml of my Java application
<jvmOptions>-Xms512m -Xmx4096m</jvmOptions>
But adding these options I've noticed that in the bundled Info.plist they are write as a single row of JVMOptions, and if I try to open my app from terminal I obtain only an anonymous error LSOpenURLsWithRole() failed with error -10810 for the file <path_to_my_app>.
and the application will stop immediately.
I've tried to write multiple rows of JVMOptions in my pom, but the plugin add only the last one in the final plist file.
As a workaround I encode all the JVMOptions directly in an Info.plist template and pass it to the maven plugin. In that way it works fine.
I think it would be nice if we could define a list of JVMOption to write in the plist file.
I'm using a Mac OS X 10.15.6 and I embed a JRE 1.8.0_251 in the app.
Please let me know if do you need more infos.
I have an app where I want to open a file I have associated with the application.
The application takes the filename via the command line and works on Linux and Windows, but I am not sure how to use this wrapper to pass along the file that was clicked on in Finder.
Also, is there a known way to use a splash screen with this wrapper/plugin?
Everything I've tried has not worked (using SplashFile in the Info.plist).
Any info is appreciated!
https://github.com/ZenHarbinger/torgo/tree/platform/mac
I tried running a Maven build with Java 10.0.2 and get the following error from the plugin. It doesn't seem to matter what jvmVersion parameter I specify (even none at all). Specifying an embedded jre doesn't work either, as the jre folder no longer exists in Java 9/10/11 and the plugin tries to copy it. This was using the maven repo version of the plugin.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:181)
... 21 more
Caused by: java.lang.ExceptionInInitializerError
at sh.tak.appbundler.CreateApplicationBundleMojo.execute(CreateApplicationBundleMojo.java:378)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
Caused by: java.lang.NumberFormatException: multiple points
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1914)
at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
at java.base/java.lang.Float.parseFloat(Float.java:455)
at org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat(SystemUtils.java:1117)
at org.apache.commons.lang.SystemUtils.(SystemUtils.java:817)
... 23 more
The symlink is not created under Linux OS while using the setting <includeApplicationsSymlink>true</includeApplicationsSymlink>
I could have missed it but didn't saw this information into the documentation, only while searching why and looked at the code source.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.