Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
943 views
in Technique[技术] by (71.8m points)

java - JavaFX Maven Plug-in: No plugin found for prefix 'jfx' in the current project and in the plugin groups

I'm trying to create an executable jar for my JavaFX application within an Eclipse Maven Project.

I'm following this thread: JavaFx Application with Maven in Eclipse

And this turotial: https://www.youtube.com/watch?v=wbjW8rYlook

I'm getting a
No plugin found for prefix 'jfx' in the current project and in the plugin groups
error when trying to run the goal: jfx:jar

Full build error:

[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:UsersalexismatunogDocumentsMy Docs3_OEJavaworkspaceMavenm2
epository), 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

I've already tried the following in attempt to solve this problem:
1. Enter mvn clean install (BUILD SUCCESS)
2. Added <pluginGroup>com.zenjava</pluginGroup> on settings.xml

Also, I've already added the <plugin> node in my pom.xml

    <plugin>
        <groupId>com.zenjava</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>8.1.2</version>
        <configuration>
            <mainClass>com.sample.MainApp</mainClass>
        </configuration>
    </plugin>

How can I solve this problem?

===========================================================
UPDATE 1:
After following Jaydeep's answer, I'm getting a password prompt after trying to open the cacerts file and unable to proceed further.
IMG1

===========================================================
UPDATE 2:
Default password for cacerts is "changeit". Build is successful after importing the root cert. Also, I've updated my pom file with jfx plugin version 8.7.0 as advised by FibreFoX.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to install your network ssl certificate to your jre cacerts.

Step 1 : Get certificate.

  1. Open https://repo.maven.apache.org URL using chrome browser.
  2. Click on view certificate
  3. select Top most certificate on chain and drag and drop to desktop. enter image description here

Step 2 : install certificate to cacerts

  1. open command prompt or terminal and type command

mvn -version

  1. Grab path to jre which would be shown to your after typing above command.
  2. Download this tool.
  3. select open option in that tool and navigate to that path which you grabbed at point 2. Now you are at jre folder. Open lib folder. Open security folder.(YOURMAVENJDKPATH/jre/lib/security/cacerts)
  4. Select cacerts file located in that security folder.Now you can see all the certificates in that tool. Tool would ask for password enter "changeit"(without double quote string changeit is the password)
  5. find out import certificate icon and click on it.
  6. Select the certificate which you downloaded in step 1.
  7. Save your changes and close the tool.

Now your problem is resolved.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...