JavaFX Maven插件:没有找到前缀' jfx'的插件在当前项目和插件组中

时间:2017-01-18 07:56:50

标签: java eclipse maven javafx-8

我试图在Eclipse Maven项目中为我的JavaFX应用程序创建一个可执行jar。

我跟随这个帖子: JavaFx Application with Maven in Eclipse

这个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上添加了<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文件后无法继续进行密码提示。
IMG1

=============================================== ============
更新2:
cacerts的默认密码是&#34; changeit&#34;。 导入根证书后,构建成功。 此外,我已根据FibreFoX的建议,使用jfx插件版本8.7.0更新了我的pom文件。

1 个答案:

答案 0 :(得分:5)

您需要将网络ssl证书安装到jre cacerts。

第1步:获取证书。

  1. 使用Chrome浏览器打开https://repo.maven.apache.org网址。
  2. 点击查看证书
  3. 选择链上最顶级的证书并拖放到桌面。 enter image description here
  4. 第2步:将证书安装到cacerts

    1. 打开命令提示符或终端并键入命令
    2.   

      mvn -version

      1. 抓住jre的路径,在输入上面的命令后会显示给你。
      2. 下载this工具。
      3. 在该工具中选择打开选项,然后导航到您在第2点抓取的路径。现在您处于jre文件夹中。打开lib文件夹。打开安全文件夹。(YOURMAVENJDKPATH / jre / lib / security / cacerts)
      4. 选择位于该安全文件夹中的cacerts文件。现在您可以看到该工具中的所有证书。 工具会要求输入密码&#34; changeit&#34;(没有双引号字符串changeit是密码)
      5. 找到导入证书图标并单击它。
      6. 选择您在步骤1中下载的证书。
      7. 保存更改并关闭工具。
      8. 现在你的问题已经解决了。