2017-10-25 5 views
0

すべてのlibファイルを実行可能なjarファイルにパックするソリューションが必要です.MavenとMavenプラグインjavafx-maven-plugin,maven-compiler-pluginおよびmaven-surefire-pluginを使用します。私はまだこれらのプラグインに基づいて私の問題のための解決策を見つけていない。Maven:JavaFX:1つのJarファイルでバンドルを束ねる

誰かが私を助けてくれることを願っています。プラグインの設定を以下に示します。

<build> 
    <plugins> 
     <!-- https://github.com/javafx-maven-plugin/javafx-maven-plugin --> 
     <plugin> 
      <groupId>com.zenjava</groupId> 
      <artifactId>javafx-maven-plugin</artifactId> 
      <version>8.1.4</version> 
      <configuration> 
       <mainClass>${exec.mainClass}</mainClass> 
       <verbose>true</verbose> 
       <jfxAppOutputDir>${project.basedir}/target/output</jfxAppOutputDir> 
       <jfxMainAppJarName>${project.name}.jar</jfxMainAppJarName> 
       <allPermissions>true</allPermissions> 
       <manifestAttributes> 
        <Specification-Title>${project.name}</Specification-Title> 
        <Specification-Version>${project.version}</Specification-Version> 
        <Specification-Vendor>${project.organization.name}</Specification-Vendor> 
        <Implementation-Title>${project.name}</Implementation-Title> 
        <Implementation-Version>${build.number}</Implementation-Version> 
        <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id> 
        <Implementation-Vendor>${project.organization.name}</Implementation-Vendor> 
        <Implementation-URL>${project.organization.url}</Implementation-URL> 
       </manifestAttributes> 
      </configuration> 
      <executions> 
       <execution> 
        <id>create-jfxjar</id> 
        <phase>package</phase> 
        <goals> 
         <goal>build-jar</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>${java.version}</source> 
       <target>${java.version}</target> 
       <compilerArguments> 
        <bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath> 
       </compilerArguments> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.19</version> 
      <configuration> 
       <skipTests>false</skipTests> 
       <properties> 
        <property> 
         <name>listener</name> 
         <value>org.sonar.java.jacoco.JUnitListener</value> 
        </property> 
       </properties> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 
+0

あなたは[javapackager](https://docs.oracle.com/javase/8/docs/technotes/toolsを使用しないでください:あなたは、次のmaven-プラグインを使用することができます/unix/javapackager.html)? –

+0

私は 'mvn clean package'を使用します – Lars

答えて

2

あなたが探しているのは、ウーファージャーまたはシェードジャーと呼ばれます。

Maven Shade Plugin

Selecting Contents for Uber JAR

+0

javapackager AFAIKを使います。ファイン。 –

+0

私は 'maven-assembly-plugin'で解決策を見つけましたが、ありがとうございます:+1: – Lars

関連する問題