Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven:如何在Maven中使用JMetro样式?_Java_Maven_Javafx - Fatal编程技术网

Java Maven:如何在Maven中使用JMetro样式?

Java Maven:如何在Maven中使用JMetro样式?,java,maven,javafx,Java,Maven,Javafx,我想在Maven项目中使用JMetro样式,但无论我做什么,Maven都会给我同样的错误。我正在使用org.openjfx中的javafx原型simple,我尝试使用JMetro,将它作为依赖项添加到我的pom.xml中,并通过将.settings.xml添加到~/.m2/中,从JCenter下载它。每当我在mvn clean之后尝试执行mvn javafx:run时,总是会出现以下错误: [INFO] Scanning for projects... [INFO] [INFO] -------

我想在Maven项目中使用JMetro样式,但无论我做什么,Maven都会给我同样的错误。我正在使用
org.openjfx
中的
javafx原型simple
,我尝试使用JMetro,将它作为依赖项添加到我的
pom.xml
中,并通过将
.settings.xml
添加到
~/.m2/
中,从JCenter下载它。每当我在
mvn clean
之后尝试执行
mvn javafx:run
时,总是会出现以下错误:

[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< io.colocasian.calc:ore-no-calculator >----------------
[INFO] Building ore-no-calculator 1.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> javafx-maven-plugin:0.0.4:run (default-cli) > process-classes @ ore-no-calculator >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ore-no-calculator ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/rishvic/Documents/Java/ore-no-calculator/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ ore-no-calculator ---
[WARNING] Can't extract module name from jmetro-11.6.5.pom: zip END header not found
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /home/rishvic/Documents/Java/ore-no-calculator/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[17,22] package jfxtras.styles does not exist
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[35,26] cannot find symbol
  symbol:   class Style
  location: class io.colocasian.calc.App
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[35,40] cannot find symbol
  symbol:   variable Style
  location: class io.colocasian.calc.App
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[377,13] cannot find symbol
  symbol:   class JMetro
  location: class io.colocasian.calc.App
[INFO] 4 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.443 s
[INFO] Finished at: 2020-01-31T21:46:28+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ore-no-calculator: Compilation failure: Compilation failure:
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[17,22] package jfxtras.styles does not exist
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[35,26] cannot find symbol
[ERROR]   symbol:   class Style
[ERROR]   location: class io.colocasian.calc.App
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[35,40] cannot find symbol
[ERROR]   symbol:   variable Style
[ERROR]   location: class io.colocasian.calc.App
[ERROR] /home/rishvic/Documents/Java/ore-no-calculator/src/main/java/io/colocasian/calc/App.java:[377,13] cannot find symbol
[ERROR]   symbol:   class JMetro
[ERROR]   location: class io.colocasian.calc.App
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
mvn的输出——版本

openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10)
OpenJDK 64-Bit Server VM (build 11.0.6+10, mixed mode)
Apache Maven 3.6.3 (NON-CANONICAL_2019-11-27T20:26:29Z_root)
Maven home: /opt/maven
Java version: 11.0.6, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.15-2-manjaro", arch: "amd64", family: "unix"
PS:我对使用Maven真的很陌生,我真的很感激一些关于使用Maven的建议,一般来说,还有在上面使用JavaFX。最初,在Git回购协议上发布了这个问题,但这与JMetro本身并不是一个问题,所以在这里发布了这个问题

额外信息:我不知道这是否与此有关,但我仍在添加它作为参考。当我添加JMetro 11.6.7作为依赖项并重新运行
mvn clean javafx:run
,下载时,它给了我这些警告

...
[WARNING] Can't extract module name from jmetro-11.6.7.pom: zip END header not found
...
[WARNING] Can't extract module name from jmetro-11.6.7.pom: Only outputDirectories and jars are accepted on the path
[WARNING] Some dependencies encountered issues while attempting to be resolved as modules and will not be included in the classpath; you can change this behavior via the  'includePathExceptionsInClasspath' configuration parameter.

我认为你的观点是错误的。也许您可以使用
import jfxtras.styles.jmetro.*尝试星型导入。我试过了。不起作用。我不太确定是否需要额外的存储库,JMetro似乎在Maven central。在任何情况下,您都不需要或应该编辑settings.xml,您可以直接在pom中声明项目所需的任何额外存储库。我尝试在没有将
settings.xml
添加到
~/.m2/
文件夹的情况下运行,但它找不到对Maven Central的依赖关系。似乎创建者忘记将其添加到Maven Central repo(此处链接:)。我不认为这对这个具体问题有任何影响。@A-Warm-Jicama如果回购协议不能正常运行,并给你一个不起作用的pom,那会发生。我认为你的输入是错误的。也许您可以使用
import jfxtras.styles.jmetro.*尝试星型导入。我试过了。不起作用。我不太确定是否需要额外的存储库,JMetro似乎在Maven central。在任何情况下,您都不需要或应该编辑settings.xml,您可以直接在pom中声明项目所需的任何额外存储库。我尝试在没有将
settings.xml
添加到
~/.m2/
文件夹的情况下运行,但它找不到对Maven Central的依赖关系。似乎创建者忘记将其添加到Maven Central repo(此处链接:)。我认为这不应该对这个具体问题有任何影响。@A-Warm-Jicama如果回购协议不能正常运行,并给你一个不起作用的pom,那会发生什么。