Giter Club home page Giter Club logo

appbundle-maven-plugin's People

Contributors

dependabot[bot] avatar federkasten avatar gideonlegrange avatar iovuio avatar johnvasquez avatar marioestrella avatar robotniko avatar sbamamoto avatar wrongcoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appbundle-maven-plugin's Issues

Version 1.2.1 release?

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?

Path error of jre when running in windows

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'.

NPE with version 1.2.0

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?

How to package resources in to "Contents/Resources"?

My packaged application on OS X has the "Contents" folder, and in it:

  • Java
  • MacOS
  • Plugins
  • Resources

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?

dictionaryFile does not work

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

Support for Retina Display (HiDPI)

Is there a reason why the bundled application does not support Retina Display?
While during development and by launching the app with java command resolution is fine, the bundled version is at lower resolution so it is "pixelled"
screenshot

.

You can’t open the application “MMOViewer.app” because it may be damaged or incomplete.

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.

NPE throwed when setting the <javaLauncherName>

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)

Maven option for including local JRE

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

Can't start app on OSX

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.

Need to add more files to the bundle

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?

Cannot run app bundler as part of maven module build

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.

Skip missing

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.

passing arguments to the application

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?

App won't run when compiled on a different computer

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?

ICNS files not copied correctly to app folder

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.

NullPointer with SWT

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?

Some issues with iconFile, fails with multi module maven projects

There are a couple of issues with iconFile:

  1. It looks for the path in target/classes relative to the current working directory, which breaks
    when you have a multi module project such as https://github.com/nresare/javapasswordsafe
  2. When iconFile lookup fails it fails silently, with no indication that anything went wrong
  3. The file is expected to be located resources, that gets copied to target/classes which gets
    included in any jars built, resulting in two copies of the icon in the .app. If
    appbundle-maven-plugin were to look for the directly in the project directory you could exclude
    it from the jar. (As a datapoint, AppIcon.icns for i.e. Numbers.app is 331KiB)

JVM options issue with macOS dark mode key/value

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!

Embedding JVM and using it

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

Autoupdate

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.

appbundle-maven-plugin/build.sh: clang: not found

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 !

Doesn't build the DMG on macOS 10.12.6

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) {

App includes full maven-built jar instead of 'original' jar

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.

Missing documentation about executable permissions

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.

Error: Could not find resource for template Info.plist

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.

DMG creation support?

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?

<dictionaryFile> fails for submodules

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.

Issue with custom dictionary

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

Adding multiple JVMOptions app cannot start

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.

Open associated file and Splash Files

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

Java 9+ non-compatibility

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

Enhancement: Symlink doesn't work under Linux

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.