我正在尝试在Eclipse Maven项目中为我的JavaFX应用程序创建一个可执行jar.
我正在关注这个线程: Eclipse中的Maven的JavaFx应用程序
这个turotial: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
(BUILD SUCCESS)
2.
在settings.xml上添加
另外,我已经
在我的pom.xml中添加了节点
com.zenjava javafx-maven-plugin 8.1.2 com.sample.MainApp
我怎么解决这个问题?
================================================== =========
更新1:
在听完Jaydeep的回答之后,我在尝试打开cacerts文件后无法继续进行密码提示.
================================================== =========
更新2:
cacerts的默认密码是"changeit".
导入根证书后,构建成功.此外,我已根据FibreFoX的建议,使用jfx插件版本8.7.0更新了我的pom文件.
您需要将网络ssl证书安装到jre cacerts.
第1步:获取证书.
使用chrome浏览器打开https://repo.maven.apache.org网址.
单击查看证书
选择链上最顶层的证书并拖放到桌面.
第2步:将证书安装到cacerts
打开命令提示符或终端和类型命令
mvn -version
抓住jre的路径,在输入上面的命令后会显示给你.
下载此工具.
在该工具中选择打开选项并导航到您在第2点抓取的路径.现在您处于jre文件夹中.打开lib文件夹.打开安全文件夹.(YOURMAVENJDKPATH/jre/lib/security/cacerts)
选择位于该安全文件夹中的cacerts文件.现在您可以看到该工具中的所有证书.工具会要求输入密码"changeit"(没有双引号字符串changeit是密码)
找出导入证书图标并单击它.
选择您在步骤1中下载的证书.
保存更改并关闭该工具.
现在问题解决了.