I'm trying to build a native bundle on macos and add a custom icon instead of default java.
I put my 128x128 icns file in src/main/deploy/package/macosx, add javafx-maven-plugin in pom.xml and run command mvn jfx:build-native (or mvn jfx:native). And nothing happens. Meaning it is successfully built, but still uses default icon. What am I'm doing wrong?
Here is my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>StarWars</groupId>
<artifactId>Minesweeper</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>example.minesweeper.Main</mainClass>
<application.title>${project.artifactId}</application.title>
<copyright>Han Solo</copyright>
</properties>
<organization>
<name>Star Wars</name>
</organization>
<name>Minesweeper</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-core</artifactId>
<version>4.0.6-alpha</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-junit</artifactId>
<version>4.0.6-alpha</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<vendor>AndreySerebryanskiy</vendor>
<mainClass>example.minesweeper.Main</mainClass>
<deployDir>${project.basedir}/src/main/deploy</deployDir>
</configuration>
</plugin>
</plugins>
</build>
</project>
And here is a screenshot of my project structure.
By the way, I'm using IntelliJ IDEA 2017.1.4. I also have seen this range of questions:
- JavaFX native bundle icon OS X
- including an icon into a self-contained JavaFX application (.exe) I also tried to put package/macosx in the project folder but it didn't work.
- How to set custom icon for javafx native package icon on Windows
I also saw a simple way of accomplishing this task in NetBeansIDE (for example here). But I do not want to change IDE because of such simple issue. Thank you in advance!
Edit 31.07
After turning verbose mode on I found that it was expecting Minesweeper-1.0.icns instead of Minesweeper.icns. Adding appName field in conficurations of javafx-maven-plugin solved my problem.