Maven项目+;JavaFX-无法添加weka依赖项
我一直在尝试创建使用maven的JavaFX应用程序。我已经为此使用了NetBeans creator(Maven->JavaFX应用程序)。在我决定为weka添加依赖项之前,一切都很顺利。我在控制台中获得以下信息:Maven项目+;JavaFX-无法添加weka依赖项,java,maven,javafx,weka,Java,Maven,Javafx,Weka,我一直在尝试创建使用maven的JavaFX应用程序。我已经为此使用了NetBeans creator(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\
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>
4.0.0
com.summa
普罗杰克特韦卡维诺
0.1
罐子
普罗杰克特韦卡维诺
UTF-8
com.summa.projektwekawino.MainApp
您的组织
org.apache.maven.plugins
maven依赖插件
2.6
解包依赖项
包裹
解包依赖项
系统
junit,org.mockito,org.hamcrest
${project.build.directory}/classes
org.codehaus.mojo
execmaven插件
1.2.1
解包依赖项
包裹
执行官
${java.home}/./bin/javafxpacker
-createjar
-nocss2bin
-应用类
${mainClass}
-srcdir
${project.build.directory}/classes
-奥特迪尔
${project.build.directory}
-外锉
${project.build.finalName}.jar
默认cli
执行官
${java.home}/bin/java
${runfx.args}
org.apache.maven.plugins
maven编译器插件
3.1
1.7
1.7
${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar
org.apache.maven.plugins
maven surefire插件
2.16
${java.home}/lib/jfxrt.jar
nz.ac.waikato.cms.weka
韦卡马厩
3.8.0
谁能告诉我我做错了什么?我在另一个maven项目中使用了weka,效果非常好。为什么它不能与JavaFX一起使用?如果没有特别的理由使用依赖插件的2.6版,那么您可以使用最新的版本再次尝试。似乎您使用了一些较旧的教程,用于JavaFX,使用较旧的JDK7,您不需要
additionalClasspathElement
或bootclasspath
,并从1.7
切换到1.8
。也许你想改用javafxmaven插件()免责声明:我是那个项目的维护者@ReneKnop将其更改为3.1.1,但仍然没有任何更改。FibreFoX-将JDK更改为1.8并删除了这两个配置元素,但仍然没有得到相同的错误。我会尽快尝试你的插件,如果有帮助,我会发布。