【发布时间】:2017-06-02 12:15:52
【问题描述】:
我正在尝试在 Eclipse Maven 项目中为我的 JavaFX 应用程序创建一个可执行 jar。
我正在关注这个话题: JavaFx Application with Maven in Eclipse
还有这个教程: https://www.youtube.com/watch?v=wbjW8rYlook
我在尝试运行目标时遇到No plugin found for prefix 'jfx' in the current project and in the plugin groups
错误:jfx:jar
完全构建错误:
[INFO] Scanning for projects...
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/zenjava/javafx-maven-plugin/8.1.2/javafx-maven-plugin-8.1.2.pom
[WARNING] Failed to retrieve plugin descriptor for com.zenjava:javafx-maven-plugin:8.1.2: Plugin com.zenjava:javafx-maven-plugin:8.1.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.zenjava:javafx-maven-plugin:jar:8.1.2
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.3.2/maven-release-plugin-2.3.2.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.3.2: Plugin org.apache.maven.plugins:maven-release-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.3.2
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/zenjava/maven-metadata.xml
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[WARNING] Could not transfer metadata com.zenjava/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[WARNING] Failure to transfer com.zenjava/maven-metadata.xml from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata com.zenjava/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.831 s
[INFO] Finished at: 2017-01-18T15:36:52+08:00
[INFO] Final Memory: 9M/22M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'jfx' in the current project and in the plugin groups [com.zenjava, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\alexismatunog\Documents\My Docs\03_OE\Java\workspace\Maven\m2\repository), central (https://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException
我已经尝试了以下方法来解决这个问题:
1.输入mvn clean install(构建成功)
2. 在settings.xml中添加<pluginGroup>com.zenjava</pluginGroup>
另外,我已经在 pom.xml 中添加了 <plugin> 节点
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.1.2</version>
<configuration>
<mainClass>com.sample.MainApp</mainClass>
</configuration>
</plugin>
我该如何解决这个问题?
================================================ ============
更新 1:
按照 Jaydeep 的回答后,我在尝试打开 cacerts 文件后收到密码提示,无法继续进行。
================================================ ============
更新 2:
cacerts 的默认密码是“changeit”。
导入根证书后构建成功。
此外,我已按照 FibreFoX 的建议使用 jfx 插件版本 8.7.0 更新了我的 pom 文件。
【问题讨论】:
-
看来您只使用 apache-repositories,而不是 maven-central。您也应该升级到插件版本 8.7.0,因为它包含最新的错误修复和解决方法。免责声明:我是项目的维护者。
-
@FibreFoX 谢谢,实际上我期待您的回复,因为我在 jfx maven 插件线程上的网络上看到了您的名字。你能解释一下
only using apache-repositories, not maven-central是什么意思吗?我对 Maven 设置比较陌生。我知道我的项目已经转换为 maven 项目(Eclipse 转换为 maven)。我需要做进一步的步骤来使用 maven-central 吗? -
如果您还有其他问题,请随时通过电子邮件向我提问 :) 随时乐意为您提供帮助。并且要说清楚:这里的 KUDOS 需要去 jaydeep,我错了,他是对的 :)(我认为这对我来说睡眠太少了 xD)
标签: java eclipse maven javafx-8