javafx maven集成採用javafx-maven-plugin,
主要分爲幾個目標:
jfx:jar
jfx:web
jfx:native
jfx:fix-classpath
jfx:generate-key-store
jfx:run
但是在
mvn clean jfx:run
時遇到了問題:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
解決方法:
<build>
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<mainClass>net.jalbright.scratch.App</mainClass>
</configuration>
<dependencies>
<dependency>
<groupId>org.twdata.maven</groupId>
<artifactId>mojo-executor</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
maven jre版本問題:
<profile>
<id>jdk-1.8</id>
<activation>
<jdk>1.8</jdk>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
參考:http://www.zenjava.com/2013/05/26/javafx-maven-plugin-2-0-alpha-feedback-needed/
http://zenjava.com/javafx/maven/index.html
http://stackoverflow.com/questions/19407959/javafx-maven-plugin-and-api-incompatibility