それは、ProGuardのとJavaFXのを使用することが可能である、あなたはjavaf-のmaven-pluginのからたとえば、プロジェクトに見てみたいことがあります。設定後
https://github.com/javafx-maven-plugin/javafx-maven-plugin/tree/master/src/it/08-build-with-proguard
が使用されます。
-dontoptimize
# Save meta-data for stack traces
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
# Rename FXML files together with related views
-adaptresourcefilenames **.fxml,**.png,**.css
-adaptresourcefilecontents **.fxml
-adaptclassstrings
# Keep all annotations and meta-data
-keepattributes *Annotation*,Signature,EnclosingMethod
# Keep entry-point class
-keep class com.zenjava.test.javafx_and_proguard.MainApp {
public static void main(java.lang.String[]);
}
# Keep all classes inside application
-keep,allowobfuscation class com.zenjava.test.javafx_and_proguard.** {
}
# Keep names of fields marked with @FXML attribute
-keepclassmembers class * {
@javafx.fxml.FXML *;
}
EDIT:ドキュメント・完全性について、不足しているPOM-の構成部分
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.10</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardVersion>5.2</proguardVersion>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/ext/jfxrt.jar</lib>
<lib>${java.home}/lib/jce.jar</lib>
</libs>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>5.2.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
免責事項:私はJavaFXの-のmaven-pluginののメンテナだ、私は答えを見つけた)