我一直在尝试创建使用maven的JavaFX应用程序。我已经使用了NetBeans创建器(Maven - > JavaFX应用程序)。一切正常,直到我决定为weka添加依赖。我在控制台中获得了以下信息:
cd C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_74" cmd /c "\"\"D:\\Program files\\NetBeans 8.2\\java\\maven\\bin\\mvn.bat\" -Drunfx.args=\"-jar \\\"${project.build.directory}/${project.build.finalName}.jar\\\" \" -Dmaven.ext.class.path=\"D:\\Program files\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 clean package org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""
Scanning for projects...
------------------------------------------------------------------------
Building ProjektWekaWino 0.1
------------------------------------------------------------------------
--- maven-clean-plugin:2.4.1:clean (default-clean) @ ProjektWekaWino ---
Deleting C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target
--- maven-resources-plugin:2.5:resources (default-resources) @ ProjektWekaWino ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
Copying 2 resources
--- maven-compiler-plugin:3.1:compile (default-compile) @ ProjektWekaWino ---
Changes detected - recompiling the module!
Compiling 2 source files to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes
--- maven-resources-plugin:2.5:testResources (default-testResources) @ ProjektWekaWino ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\src\test\resources
--- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ ProjektWekaWino ---
Nothing to compile - all classes are up to date
--- maven-surefire-plugin:2.16:test (default-test) @ ProjektWekaWino ---
No tests to run.
--- maven-jar-plugin:2.3.2:jar (default-jar) @ ProjektWekaWino ---
Building jar: C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\ProjektWekaWino-0.1.jar
--- maven-dependency-plugin:2.6:unpack-dependencies (unpack-dependencies) @ ProjektWekaWino ---
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\netlib-native_system-win-i686\1.1\netlib-native_system-win-i686-1.1-natives.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\nz\ac\waikato\cms\weka\thirdparty\java-cup-11b\2015.03.26\java-cup-11b-2015.03.26.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\core\1.1\core-1.1.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\netlib-native_ref-linux-i686\1.1\netlib-native_ref-linux-i686-1.1-natives.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\netlib-native_ref-linux-armhf\1.1\netlib-native_ref-linux-armhf-1.1-natives.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\googlecode\netlib-java\netlib-java\1.1\netlib-java-1.1.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\nz\ac\waikato\cms\weka\weka-stable\3.8.0\weka-stable-3.8.0.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\netlib-native_system-linux-armhf\1.1\netlib-native_system-linux-armhf-1.1-natives.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\googlecode\matrix-toolkits-java\mtj\1.0.4\mtj-1.0.4.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\net\sourceforge\f2j\arpack_combined_all\0.1\arpack_combined_all-0.1.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\netlib-native_ref-win-x86_64\1.1\netlib-native_ref-win-x86_64-1.1-natives.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\nz\ac\waikato\cms\weka\thirdparty\java-cup-11b-runtime\2015.03.26\java-cup-11b-runtime-2015.03.26.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\nz\ac\waikato\cms\weka\thirdparty\bounce\0.18\bounce-0.18.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\native_ref-java\1.1\native_ref-java-1.1.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\netlib-native_ref-win-i686\1.1\netlib-native_ref-win-i686-1.1-natives.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\netlib-native_ref-osx-x86_64\1.1\netlib-native_ref-osx-x86_64-1.1-natives.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\native_system-java\1.1\native_system-java-1.1.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\netlib-native_system-win-x86_64\1.1\netlib-native_system-win-x86_64-1.1-natives.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\netlib-native_system-linux-x86_64\1.1\netlib-native_system-linux-x86_64-1.1-natives.jar to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
Unpacking C:\Users\Druid\.m2\repository\com\github\fommil\netlib\all\1.1.2\all-1.1.2.pom to C:\Users\Druid\Documents\NetBeansProjects\ProjektWekaWino\target\classes with includes "" and excludes ""
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 47.783s
Finished at: Sat Jun 16 20:55:46 CEST 2018
Final Memory: 22M/215M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.6:unpack-dependencies (unpack-dependencies) on project ProjektWekaWino: Unknown archiver type: No such archiver: 'pom'. -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
下面是我的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>com.summa</groupId>
<artifactId>ProjektWekaWino</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<name>ProjektWekaWino</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>com.summa.projektwekawino.MainApp</mainClass>
</properties>
<organization>
<!-- Used as the 'Vendor' for JNLP generation -->
<name>Your Organisation</name>
</organization>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludeScope>system</excludeScope>
<excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${java.home}/../bin/javafxpackager</executable>
<arguments>
<argument>-createjar</argument>
<argument>-nocss2bin</argument>
<argument>-appclass</argument>
<argument>${mainClass}</argument>
<argument>-srcdir</argument>
<argument>${project.build.directory}/classes</argument>
<argument>-outdir</argument>
<argument>${project.build.directory}</argument>
<argument>-outfile</argument>
<argument>${project.build.finalName}.jar</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>default-cli</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${java.home}/bin/java</executable>
<commandlineArgs>${runfx.args}</commandlineArgs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</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.16</version>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>nz.ac.waikato.cms.weka</groupId>
<artifactId>weka-stable</artifactId>
<version>3.8.0</version>
</dependency>
</dependencies>
</project>
有谁能告诉我我做错了什么?我已经在我的另一个maven项目中使用了weka,它工作得非常好。为什么它不适用于JavaFX?