JavaFX Maven 插件:在当前项目和插件组中找不到前缀“jfx”的插件
Posted
技术标签:
【中文标题】JavaFX Maven 插件:在当前项目和插件组中找不到前缀“jfx”的插件【英文标题】:JavaFX Maven Plug-in: No plugin found for prefix 'jfx' in the current project and in the plugin groups 【发布时间】: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)
【参考方案1】:
您需要将您的网络 ssl 证书安装到您的 jre cacerts。
第 1 步:获取证书。
-
使用 chrome 浏览器打开https://repo.maven.apache.org URL。
点击查看证书
选择链上最顶部的证书并拖放到桌面。
第 2 步:将证书安装到 cacerts
-
打开命令提示符或终端并输入命令
mvn -版本
-
获取 jre 的路径,在输入上述命令后会显示给您。
下载this工具。
在该工具中选择打开选项并导航到您在第 2 点抓取的路径。现在您位于 jre 文件夹中。打开 lib 文件夹。打开安全文件夹。(YOURMAVENJDKPATH/jre/lib/security/cacerts)
选择位于该安全文件夹中的 cacerts 文件。现在您可以看到该工具中的所有证书。 工具会要求输入密码输入“changeit”(不带双引号字符串changeit是密码)
找到导入证书图标并点击。
选择您在步骤 1 中下载的证书。
保存更改并关闭工具。
现在你的问题已经解决了。
【讨论】:
@FibreFoX 只需复制粘贴在日志中下载单词后出现的每个链接。所有链接资源都可用,但由于 PKIX ssl 证书问题,下一行失败。当依赖项正在下载但未找到时,它会给出 404 错误,但当找到但存在 PKIX 路径构建错误时,它始终是证书问题。 @jaydeep 确实......也许你应该复制粘贴它们作为你的答案的一部分,因为这真的不那么清楚,甚至对其他人来说......想知道为什么会发生这种情况...... @jaydeep,感谢您提供详细信息。到目前为止,我关注了所有内容,但在选择 cacerts 后它要求输入密码。这是正常的吗?我已经用截图更新了问题。 @jaydeep 我不是那种无知的开发者;)你是对的! 我在我的 android Studio 上遇到了这个问题,这对我有用。我还必须确保 Android Studio 使用的是相同的 java。谢谢!!!!以上是关于JavaFX Maven 插件:在当前项目和插件组中找不到前缀“jfx”的插件的主要内容,如果未能解决你的问题,请参考以下文章
Maven-在当前项目和插件组中找不到前缀“spring-boot”的插件
在当前项目和插件组 [org.apache.maven.plugins, org.codehaus.mojo] 中找不到前缀“gcloud”的插件
如何修复“在当前项目和插件组中找不到前缀'liquibase'的插件”