Git Product home page Git Product logo

macosappbundler-maven-plugin's Introduction

macOS app bundler Maven plugin

Maven plugin for creating a native macOS bundle containing all dependencies declared by a Maven project.

Maven Central License Build

Requirements

  • Java 9 or newer

Usage

Minimum example

...
    <plugin>
        <groupId>de.perdian.maven.plugins</groupId>
        <artifactId>macosappbundler-maven-plugin</artifactId>
        <version>1.21.0</version>
        <configuration>
            <plist>
                <JVMMainClassName>de.perdian.test.YourApplication</JVMMainClassName>
            </plist>
        </configuration>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>bundle</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
...

Extended example

...
    <plugin>
        <groupId>de.perdian.maven.plugins</groupId>
        <artifactId>macosappbundler-maven-plugin</artifactId>
        <version>1.21.0</version>
        <configuration>
            <plist>
                <CFBundleIconFile>src/bundle/test.icns</CFBundleIconFile>
                <CFBundleDisplayName>My supercool application</CFBundleDisplayName>
                <CFBundleDevelopmentRegion>English</CFBundleDevelopmentRegion>
                <CFBundleURLTypes>
                    <string>msa</string>
                </CFBundleURLTypes>
                <JVMMainClassName>de.perdian.test.YourApplication</JVMMainClassName>
                <JVMVersion>11+</JVMVersion>
                <JVMOptions>
                    <string>-Dfoo=bar</string>
                    <string>-Dx=y</string>
                </JVMOptions>
                <JVMArguments>
                    <string>-example</string>
                    <string>${someProperty}</string>
                </JVMArguments>
            </plist>
            <dmg>
                <generate>true</generate>
                <additionalResources>
                    <additionalResource>
                        <directory>src/bundle/macos/distribution</directory>
                    </additionalResource>
                </additionalResources>
            </dmg>
            <codesign>
                <identity>3rd Party Mac Developer Application: MyName (MyNumber)</identity>
            </codesign>
        </configuration>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>bundle</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
...

Example with Java Module Path

...
    <plugin>
        <groupId>de.perdian.maven.plugins</groupId>
        <artifactId>macosappbundler-maven-plugin</artifactId>
        <version>1.21.0</version>
        <configuration>
            <plist>
                <CFBundleIconFile>src/bundle/test.icns</CFBundleIconFile>
                <CFBundleDisplayName>My supercool application</CFBundleDisplayName>
                <CFBundleDevelopmentRegion>English</CFBundleDevelopmentRegion>
                <CFBundleURLTypes>
                    <string>msa</string>
                </CFBundleURLTypes>
                <JVMMainModuleName>de.perdian.somemodule/de.perdian.test.YourApplication</JVMMainModuleName>
                <JVMVersion>11+</JVMVersion>
                <JVMOptions>
                    <string>-Dfoo=bar</string>
                    <string>-Dx=y</string>
                </JVMOptions>
                <JVMArguments>
                    <string>-example</string>
                    <string>${someProperty}</string>
                </JVMArguments>
            </plist>
            <dmg>
                <generate>true</generate>
                <additionalResources>
                    <additionalResource>
                        <directory>src/bundle/macos/distribution</directory>
                    </additionalResource>
                </additionalResources>
            </dmg>
        </configuration>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>bundle</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
...

Features

After executing the goal during (e.g. during the package phase as shown in the example above) the macOS application bundle will be located in the PROJECT_NAME.app directory inside the target directory, where PROJECT_NAME equals the bundle name entered within the CFBundleName setting inside the plist configuration, or the name of the Maven project (${project.name}) if the value is not present inside the plist configuration.

The plugin will detect whether the project is a Java module by checking if the plist property JVMMainModuleName is present. If that's the case the launcher will use the modulepath. Otherwise the regular classpath will be used.

Configuration

Property list Configuration

The values within the plist element are directly transferred to the Info.plist file within the application bundle. To keep the usage within the code consistent they use the same keys within the pom.xml configuration as they do within the Info.plist.

The following values can be configured:

Key Type Required? Default Description
CFBundleDevelopmentRegion String No English The default language and region for the bundle, as a language ID.
CFBundleDisplayName String No ${project.name} The published name of your application.
CFBundleExecutable String No JavaLauncher The name of the executable within the application bundle. No regular user will ever see this but you may want to change it for debugging purposes when analyzing your application.
CFBundleIconFile File No The icns file that should be used as main icon for the application. The location must be entered relatively to the root of the project in which the plugin is used.
CFBundleIdentifier String No ${groupId}.${artifactId} The macOS bundle identifier of your application.
CFBundleName String No ${project.name} The internal name of your application.
CFBundlePackageType String No APPL A four-letter code specifying the bundle type. For apps, the code is APPL, for frameworks, it' FMWK, and for bundles, it's BNDL (Details)
CFBundleShortVersionString String No ${version} The version of your application.
CFBundleDocumentTypes Array of CFBundleDocumentTypes No Additional information for document types (see details for an extended example).
CFBundleURLTypes Array of Strings No A list of URL schemes (http, ftp, etc.) supported by the application.
JVMArguments Array of Strings No Additional arguments to be passed to the Java runtime.
JVMLogLevel String No INFO The amount of details the launcher will print to the console if called directly from the command line. Possible values: TRACE, DEBUG, INFO, WARN, ERROR.
JVMMainClassName String Yes (if the application is a classic classpath based application) The main class whose main method should be invoked when starting your application.
JVMMainModuleName String Yes (if the application is a module based application) The main module that should be invoked when starting your application.
JVMOptions Array of Strings No Additional parameters (-D parameters) to be passed to the Java runtime.
JVMRuntimePath String No The exact location of the Java runtime.
JVMVersion String No The Java version your application needs to work. Can either be an explicit version String like 11.0.1, a major version like 11 (signalizing that any Java 11 runtime is sufficient) or a value like 11+ (signalizing that any Java 11 or higher runtime is sufficient).
LSUIElement Boolean No Declares if the application is an agent app that runs in the background and doesn't appear in the Dock (Details).
NSAppleMusicUsageDescription String No A message that tells the user why the app is requesting access to the user’s media library.
NSAppSleepDisabled Boolean No Declares if the app is allowed to nap or not.
NSCameraUsageDescription String No A message that tells the user why the app is requesting access to the device's camera (Details).
NSHighResolutionCapable Boolean No true Declares if the application supports rendering in HiDPI (Retina) (Details).
NSHumanReadableCopyright String No A human-readable copyright notice for the bundle (Details).
NSMicrophoneUsageDescription String No A message that tells the user why the application is requesting access to the device's microphone (Details).
NSSupportsAutomatic GraphicsSwitching Boolean No true Declares whether an OpenGL app may utilize the integrated GPU (Details).

CFBundleDocumentTypes configuration example

    <configuration>
        <plist>
            ...
            <CFBundleDocumentTypes>
                <CFBundleDocumentTypes>
                    <CFBundleTypeName>MyDocumentType</CFBundleTypeName>
                    <CFBundleTypeRole>Editor</CFBundleTypeRole>
                    <CFBundleTypeExtensions>
                        <string>foo</string>
                        <string>foobar</string>
                    </CFBundleTypeExtensions>
                </CFBundleDocumentTypes>
                <CFBundleDocumentTypes>
                    <CFBundleTypeName>AnotherDocumentType</CFBundleTypeName>
                    <CFBundleTypeRole>Editor</CFBundleTypeRole>
                    <CFBundleTypeExtensions>
                        <string>x</string>
                        <string>y</string>
                    </CFBundleTypeExtensions>
                </CFBundleDocumentTypes>
            </CFBundleDocumentTypes>
            ...
        </plist>
    </configuration>

Yes, the CFBundleDocumentTypes has to be entered twice: First as the parent for additional configurations and then for each configuration you want to define.

DMG configuration

The following other properties can be added to the dmg element configuring the generation of the DMG file at the end of the build:

Key Type Required? Default Description
generate Boolean No false Whether or not to create a DMG archive.
additionalResources List<Fileset> No List of additional files to be copied into the archive.
createApplicationsSymlink Boolean No true Whether or not to include a link to the Applications folder inside the archive.
useGenIsoImage Boolean No false Whether or not to use genisoimage to create the archive. Default is hdiutil.
autoFallback Boolean No false If true, try the other archive generation method when the first one fails. (e.g. run hdiutil when genisoimage fails and vice-versa)
appendVersion Boolean No true If true, append the version to the .dmg name
dmgFileName String No null If not null and not empty, the supplied string will be used as the file name (.dmg will be appended).

APP configuration

The following other properties can be added to the app element configuring additional files to be included in the app bundle:

Key Type Required? Default Description
additionalResources List<Fileset> No Additional files to be copied into the app bundle.
...
    <configuration>
        <app>
            <additionalResources>
                <resource>
                    <directory>${project.basedir}/src/main/resources</directory>
                    <outputDirectory>Contents/Resources</outputDirectory>
                    <includes>
                        <include>**</include>
                    </includes>
                </resource>
            </additionalResources>
        </app>
    </configuration>
...

Code signing

The plugin can automatically sign the created application bundle if a codesign identiy is given:

...
    <configuration>
        <codesign>
            <identity>3rd Party Mac Developer Application: MyName (MyNumber)</identity>
        </codesign>
    </configuration>
...

The following other properties can be added to the codesign element configuring additional options for signing:

Key Type Required? Default Description
enable Boolean No true Whether or not to sign the created application bundle.
identity String Yes The identity of the signer. Required if the codesign element is present.
preserveMetadata List<String> No entitlements

To sign the application using a local dummy identity (which will only work on the machine where the signing was performed) you can use:

...
    <configuration>
        <codesign>
            <identity>-</identity>
        </codesign>
    </configuration>
...

JDK inclusion

Usually the application bundle built by the plugin will depend upon a Java runtime being available on the machine where the application is executed. To be completely self-sustaining, the plugin supports including the runtime into the target application. That runtime will then be used to launch the application, so there are no dependencies to a JDK being installed locally.

...
    <configuration>
        <jdk>
            <include>true</include>
            <location>/where/your/jdk/is/installed</location>
        </jdk>
    </configuration>
...

The following parameters can be set below the jdk configuration element:

Key Type Required? Default Description
include Boolean No false Whether or not to include the JDK in the generated application bundle.
location String No The location of the JDK to be included. If no location is provided then the currently used JDK (which is the JDK that is used by the Maven binary) will be added to the application.

Dependencies exclusion

By default all declared dependencies (both direct dependencies as well as transient dependencies) are included in the generated application bundle.

If you only want to include the direct application JAR file without any dependencies (e.g. because you've already included the dependencies into the application JAR itself) then you can set the includeDependencies flag of the app configuration to false:

...
    <configuration>
        <app>
            <includeDependencies>false</includeDependencies>
        </app>
    </configuration>
...

Native binary selection

By default the launcher contains a universal binary that allows running the application on both the classic x86_64 as well as the new arm64 architecture.

In case any problems occur with the universal binary (or if you want to support only a specific architecture) you can select which binary should be bundled with your application via the nativeBinary setting:

 ...
    <configuration>
        <nativeBinary>X86_64</nativeBinary>
    </configuration>
 ...

The available values are:

  • UNIVERSAL (the default if no explicit value is given)
  • X86_64
  • ARM_64

Development

Changes are documented in the CHANGELOG.md file.

The project consists of two main parts: The regular Maven plugin (written in Java) and the native macOS launcher (written in Objective C).

Building the native part is fully integrated into the Maven lifecycle, so all you need to do to build the plugin is:

$ git clone https://github.com/perdian/macosappbundler-maven-plugin.git
$ mvn clean install

I am aware that my understanding of Objective C is very basic - I'm not an Objective C developer by heart and going back to using pointers and (somewhat) manual memory management feels pretty strange. So a lot of what's in the code is highly cargo culted from tutorials and answers on Stackoverflow, but hey: It works!

Authors

Donate

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Acknowledgments

I originally used and have been highly influenced by the appbundle-maven-plugin from federkasten. Unfortunately the plugin stopped working with Java versions 10 and above (and didn't provide support for Java 9+ module projects).

macosappbundler-maven-plugin's People

Contributors

akuhtz avatar christopherbruno78 avatar habakke avatar habakke-pexip avatar jazzkuh avatar lfuelling avatar mikefear avatar perdian avatar sebouh137 avatar waqqasjabbar 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

macosappbundler-maven-plugin's Issues

App menu entries in English instead of German

This might not be the right place, but some people complain that my MacOS bundled apps have a menu in English: About, Services, Hide, Hide others, Show all, Quit. I don't know if this is related to packaging or something else, but I thought this would be the right place to ask people who might know.

Any idea?

Microphone not working on bundled application

I am unable to get the microphone input to work on an app I wrote. When running the program through the JVM directly, the microphone works. I suspect there is something wrong with the permissions, which may have changed when I switched over to Monterey.

Digging through material online, I found that this is related to entitlements com.apple.security.device.microphone and com.apple.security.device.audio-input, as well as a plist property NSCameraUsageDescription. Could you fix this, so that my bundled app can run and use the microphone?
Thanks

JVMMainModuleName example

Hi. Great job with this plugin. I love it!
I am using it, but unfortunately my application is not starting - cannot find the main class.
I suspect it is because it is a Java 11 application.

It would be nice if you included an example of the parameter JVMMainModuleName in your README. And also some debugging tips in case the app does not start.

Support file-association plist elements

In porting an application from Ant to Maven (and to more recent versions of Java), one feature of the JarBundler Ant task that this Maven plugin seems to lack any equivalent of is the ability to set up file associations.

In the Ant build.xml, as a child of the <jarbundler> element, I can write something like <documenttype name="My Custom App files" extensions="aaa bbb" role="Editor" />, and looking at the plist file in the generated application bundle, that turns into

<key>CFBundleDocumentTypes</key>
<array>
  <dict>
    <key>CFBundleTypeName</key>
    <string>My Custom App files</string>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>CFBundleTypeExtensions</key>
    <array>
      <string>aaa</string>
      <string>bbb</string>
    </array>
  </dict>
</array>

But as far as I can tell, there's no way to put anything like this under the <plist> element in pom.xml, which would be a very desirable feature for packaging apps that are intended to serve as viewers or editors for files.

Support to add single dependency

Hello,

Is it possible to add a single dependency (e.g. spring boot executable jar) from a different module?

I want to be able to build the jar (with all dependencies included) in a maven module A and build the DMG in a maven module B, and the content of the DMG should be the jar from maven module A.

I was trying to get this to work with this change:
akuhtz@3d53f68
But the build of my project fails with Command 'hdiutil' exited with status 1 and I don't know where to start the search for the cause.

Change working directory

Is there a way to change the working directory? Currently, the "user.dir" is within the app bundle itself.

Cannot open JVM dynamic library

I've been using this plugin for some time to build my MacOS App. I may not have built it for a while (a year or so maybe) and now when attempting to run the built app I get this error:

Cannot open JVM dynamic library at: /Users/xxx/Projects/xxx/target/xxx.app/Contents/Java/runtime/lib/libjli.dylib

I've been experimenting with different configurations with the latest one below. Nothing appears to make a difference. The app runs fine in the IDE and using the built jar. The dylib is present and returns ok with vtool:

vtool -show-build /Users/xxx/Projects/xxx/target/xxx.app/Contents/Java/runtime/lib/libjli.dylib
/Users/xxx/Projects/xxx/target/xxx.app/Contents/Java/runtime/lib/libjli.dylib:
Load command 9
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform MACOS
    minos 11.0
      sdk 11.1
   ntools 1
     tool LD
  version 609.8

Any help would be greatly appreciated, I'm running out of ideas of what might be causing it.

<plugin>
    <groupId>de.perdian.maven.plugins</groupId>
    <artifactId>macosappbundler-maven-plugin</artifactId>
    <version>1.19.0</version>
    <configuration>
        <plist>
            <CFBundleIconFile>src/main/resources/macos_icon.icns</CFBundleIconFile>
            <CFBundleDisplayName>xxx</CFBundleDisplayName>
            <CFBundleName>xxx</CFBundleName>
            <CFBundleDevelopmentRegion>English</CFBundleDevelopmentRegion>
            <JVMMainModuleName>xxx.xxx.xxx/xxx.xxx.xxx</JVMMainModuleName>
            <JVMVersion>17+</JVMVersion>
            <JVMOptions>
                <string>-Dapple.laf.useScreenMenuBar=true</string>
                <string>-Xdock:name=xxx</string>
            </JVMOptions>
            <JVMLogLevel>DEBUG</JVMLogLevel>
        </plist>
        <dmg>
            <generate>false</generate>
        </dmg>
        <jdk>
            <include>true</include>
            <location>/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home</location>
        </jdk>
        <nativeBinary>X86_64</nativeBinary>
        <codesign>
            <identity>xxx (xxx)</identity>
        </codesign>
    </configuration>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>bundle</goal>
            </goals>
        </execution>
    </executions>
</plugin>

MacOS info:

ProductName:		macOS
ProductVersion:		13.4
BuildVersion:		22F66

dmg file size

I have always wondered why the resulting dmg file is so large. My impression is that the bundler uses a minimal JAR (2.5 MB in my case) and bundles all the referenced libraries with that JAR. As libraries have grown, I get a 42 MB dmg file now. The corresponding deb file and the Windows package are some 17 MB large.

So, could you add an option to use the shaded JAR instead of adding each and any file included in some referenced library?

Incorrect value for System Property user.dir

When I launch from a bundled application, I get the wrong value for System.getProperty("user.dir"), which is the working directory. I should get the parent directory of the application bundle. This should be the same value regardless of whether I launch the application bundle, or if I just copy the jar file to my directory and launch that. This makes testing much easier. But here's what I get:

App Bundle: /Users/myself/myFolder/MyApp.app
Jar file: /Users/myself/myFolder

(These are the results when the jar file and the bundle are in the same folder.)

The working directory should be the parent folder of the application bundle folder. That's how the original Mac application bundler worked.

This makes it harder to test my application in my IDE, because it uses a different value for the working directory.

In Info.plist, LSUIElement is boolean, but should be string

The LSUIElement attribute can only be true or false, or it can be missing. This suggests that it's a boolean property, but it's actually a string. (I understand that it used to be boolean, but I'm not sure about that.)

But this plugin treats it as boolean, and it doesn't work that way.

When I go into the Info.plist file and change it to this:

    <key>LSUIElement</key>
    <string>true</string>

it works properly. (It blocks my application from showing on the Dock.)

but the way the bundler handles it, it looks like this:

    <key>LSUIElement</key>
    <true/>

and it has no effect this way.

JavaLauncher requires macOS 10.15

Hi,
while testing the generated .app file on a friend's MacBook running the latest macOS 10.14, I got an error that the application requires macOS 10.15.

I assume the JavaLauncher which afaik is in src/main/native was compiled using 10.15.

I'd suggest using automated (Travis?) builds to compile the executable on multiple macOS versions and offering multiple versions of the app (where e.g. 1.3.0 is for the latest macOS, 1.3.0-hs would be for high sierra, and so on) but this would probably cause errors in Maven repositories allowing -SNAPSHOT versions.

I also can understand if you don't care about this.

App is not opening with doble click but is opening from shell

Hi,
after building (normal, no module) with maven i'm facing this issue:
I can run the app from shell with command: open -a myprogramm.app, but nothing happens when i try to launch it clicking on it... no errors, no messages.

jdk installed is openjdk 11 (with brew)
os Catalina

Thanks!

Copy the executable to the bundle

Hi! I tried to copy the executable to the bundle using the additionalResources field, but after copying, the file lost executable privileges. Are there other ways to achieve this goal?

Question: where does system environment come from (and how to change it)?

Hi @perdian - This isn't an issue at all.. this library has worked great for me!

My question just is how the system environment is set? I noticed when running my app if I call System.getenv() and look for the PATH this is what I get:

PATH : /usr/bin:/bin:/usr/sbin:/sbin

I have several other folders set in my PATH (set in ~/.profile) so those aren't getting picked up.

FWIW here's how my app is setup (pom.xml)

            <plugin>
                <groupId>de.perdian.maven.plugins</groupId>
                <artifactId>macosappbundler-maven-plugin</artifactId>
                <version>1.19.0</version>
                <configuration>
                    <plist>
                        <CFBundleIconFile>resources/device-manager.icns</CFBundleIconFile>
                        <JVMMainClassName>com.jpage4500.devicemanager.MainApplication</JVMMainClassName>
                        <CFBundleDisplayName>Android Device Manager</CFBundleDisplayName>
                        <CFBundleDevelopmentRegion>English</CFBundleDevelopmentRegion>
                        <CFBundleTypeExtensions>
                            <string>apk</string>
                        </CFBundleTypeExtensions>
                    </plist>
                    <jdk>
                        <!-- set to true to package entire JRE (NOTE: resulting app won't be compatible with both arm and x86 macs)-->
                        <include>false</include>
                        <!--<location>/Applications/Android Studio Preview.app/Contents/jbr/Contents/Home</location>-->
                    </jdk>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Requesting way to use existing JAR

I'm currently writing a project that uses JavaFX to display windows. Some of the resources it uses to do that (.fxml files) were not being included in the jar, so I used a different Maven plugin to shade the jar to include those resources.

Now that I want to create MacOS executables, it would be most convenient for me to simply package that JAR in the executable, rather than relying on this plugin to get all of the resources properly. Is this at all possible?

Minor typo in the doc

Hey,
your example in README.md says 1.90.0 but it seems the current version is 1.19.0

CFBundleTypeExtensions stored incorrectly

Currently the plugin adds a CFBundleTypeExtensions key at the root of the plist. But this is not a root key, so it doesn't do anything (i.e. Finder doesn't mark the app as a recommended one within "Open With").

It is one of the keys under the CFBundleDocumentTypes dictionaries.

Example from the DB Browser for SQLite bundle:

	<key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>db</string>
				<string>db3</string>
				<string>sqlite</string>
				<string>sqlite3</string>
			</array>
			<key>CFBundleTypeName</key>
			<string>Database Document</string>
			<key>CFBundleTypeOSTypes</key>
			<array>
				<string>****</string>
			</array>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
		</dict>
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>sqbpro</string>
			</array>
			<key>CFBundleTypeName</key>
			<string>DB Browser for SQLite Project</string>
			<key>CFBundleTypeOSTypes</key>
			<array>
				<string>****</string>
			</array>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
		</dict>
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>*</string>
			</array>
			<key>CFBundleTypeName</key>
			<string>Other Document Type</string>
			<key>CFBundleTypeOSTypes</key>
			<array>
				<string>****</string>
			</array>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
		</dict>
	</array>

Code signing support

Hello,
Thanks for developing this plugin!
I wonder if you had considered adding support for code-signing the bundled application (and JRE, if embedded).
An example of the code signing process is laid out in the Gephi packaging script (written as a Maven Antrun goal):
https://github.com/gephi/gephi/blob/ac43719c48ef8b12d4dd5f3d15ef2f36443b9192/modules/application/pom.xml#L674-L822

It is a bit daunting but that is because they have some dependencies which use native code. For vanilla Java, it seems fairly straightforward.

Way to include JRE in the bundle?

Hi,

the federkasten version did have an option to include a previously downloaded JRE inside the app bundle. This doesn't seem to be possible here, or am I missing something?

Research dylib vs. JAVA_HOME

When explicitely selecting a JDK via the JVMRuntimePath option I had the feeling in the past then the dylib was chosen correctly from the path specified but the classpath was still used by the default JDK located in the system JAVA_HOME location.

TODO: Verify if that's really the case and set JAVA_HOME from within the native launcher if needed.

jspawnhelper malformed by JDK inclusion (ie, Cannot use ProcessBuilder)

I found a very interesting edge case that I think it would probably be easy to fix.

It looks like when the JDK is included, this file Contents/Java/jdk/lib/jspawnhelper is not executable, as it is before it is copied into the bundle).

The result of this is that all attempts to use ProcessBuilder generate a Not Found error.

It took me forever to figure out what was going on here, finally I found this https://macosx-port-dev.openjdk.java.narkive.com/8NdCdcOt/spawning-a-process-from-an-app-packaged-with-appbundler-impossible

Swing Colors Change

Enjoying this plugin. So easy to make a MacOS app out of my Java Swing app.

When I create a .app with the bundler plugin for my modular Java Swing app it works fine, but the button colors and some other UI colors wind up quite different from when I run it from the IDE or from an executable JAR file. It seems to be ignoring the colors I've set and choosing some rather bad colors instead. It's quite strange. Any idea what might be going on?

Thanks,

Jon

Encoding error UTF-8

By using the plugin as shown below:

<plugin>
	<groupId>de.perdian.maven.plugins</groupId>
	<artifactId>macosappbundler-maven-plugin</artifactId>
	<version>1.7.0</version>
	<configuration>
		<jdk>
			<include>true</include>
		</jdk>
		<plist>
			<CFBundleIconFile>/src/main/resources/images/image.icns</CFBundleIconFile>
			<JVMMainClassName>test.javafxTest.Main</JVMMainClassName>
			<CFBundleDisplayName>TEST</CFBundleDisplayName>
		</plist>
		<dmg>
			<generate>true</generate>
			<dmgFileName>TEST</dmgFileName>
			<appendVersion>true</appendVersion>
		</dmg>
	</configuration>
	<dependencies>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.6</version>
		</dependency>
	</dependencies>
	<executions>
		<execution>
			<phase>package</phase>
			<goals>
				<goal>bundle</goal>
			</goals>
		</execution>
	</executions>
</plugin>

The JDK is included but when I run the .app application it runs normally except that the JDK loads the UTF-8 raw application, so the application is displayed with special characters.
I can't find how to correct this problem.
image

Does anyone have any ideas?

jLink

Hi,

Thanks for this initiative. It's a very cool project.

Would be really nice to have a "jLink" that would package a mini JRE image with Java9+ modules.
I think this would make the end DMG significantly smaller, compared to

<jdk>
       <include>true</include>
</jdk>

Regards
Carlos

Add support for LSUIElement in Info.plist

In order to create applications that run in system tray only, we need to be able to set LSUIElement to 1 in Info.plist. Can you please add support for this value in your plist configuration? Thanks!

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.