I am adding another answer because it is long and it shows how I am doing to generate a signed jar and a JNLP web start file.
So, first I create a certificate to be able to sign the bank (you will be asked to enter some information, I used "superpass" for passwords, see where it is used in pom):
cd src/main/java mkdir jnlp cd jnlp keytool -genkey -alias signFiles -keystore keystore.jks
And then I use this pom.xml (which has a parent pom, but it does not contain anything related to javafx):
<?xml version="1.0" encoding="UTF-8"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <artifactId>testfx</artifactId> <groupId>ch.pgras</groupId> <version>1.0-SNAPSHOT</version> </parent> <groupId>ch.pgras</groupId> <artifactId>hellofx</artifactId> <version>1.0-SNAPSHOT</version> <name>hellofx</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>com.oracle</groupId> <artifactId>javafx</artifactId> <version>2.0</version> <systemPath>${javafx.rt.jar}</systemPath> <scope>system</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-dependencies</id> <phase>package</phase> <configuration> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>false</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> </configuration> <goals> <goal>copy-dependencies</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>package</phase> <configuration> <target> <taskdef name="jfxdeploy" classname="com.sun.javafx.tools.ant.DeployFXTask" classpathref="maven.plugin.classpath"/> <taskdef name="jfxsignjar" classname="com.sun.javafx.tools.ant.FXSignJarTask" classpathref="maven.plugin.classpath"/> <jfxdeploy width="800" height="600" outdir="${project.build.directory}/deploy" outfile="${project.build.finalName}"> <info title="${project.name}"/> <application name="${project.name}" mainclass="webmap.WebMap"/> <resources> <fileset dir="${project.build.directory}" includes="*.jar"/> <fileset dir="${project.build.directory}/dependency" includes="*.jar"/> </resources> <platform javafx="2.0"> <jvmarg value="-Xms64m"/> <jvmarg value="-Xmx256m"/> </platform> </jfxdeploy> <jfxsignjar destdir="${project.build.directory}/deploy" keystore="${project.basedir}/src/main/java/jnlp/keystore.jks" storepass="superpass" alias="signFiles" keypass="superpass"> <fileset dir="${project.build.directory}/deploy" includes="*.jar"/> </jfxsignjar> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>com.oracle.javafx</groupId> <artifactId>ant-javafx</artifactId> <version>2.0</version> <systemPath>${ant.javafx.jar}</systemPath> <scope>system</scope> </dependency> </dependencies> </plugin> </plugins> </build>
Finally, I run mvn install and the result will be in target / deploy ...
good luck :)
pgras
source share