为什么我不能在Maven中构建罐子



我已经查看了所有关于类似问题的建议。没有什么工作。也许有人知道问题出在哪里?在pom文件和控制台下面出现错误。

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>pezal2</groupId>
  <artifactId>pezal2</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <properties>
 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>  
    <plugin>
        <groupId>com.zenjava</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>8.5.0</version> 
        <configuration>
        <mainClass>com.pezal.Main</mainClass>
        </configuration>
    </plugin>
    </plugins> 
  </build>
</project>
控制台

   [ERROR] Failed to execute goal com.zenjava:javafx-maven-plugin:8.5.0:jar (default-cli) on project pezal2: Execution default-cli of goal com.zenjava:javafx-maven-plugin:8.5.0:jar failed: Plugin com.zenjava:javafx-maven-plugin:8.5.0 or one of its dependencies could not be resolved: Could not find artifact javafx-packager:javafx-packager:jar:1.8.0_20 at specified path C:Program FilesJavajre1.8.0_101/../lib/ant-javafx.jar -> [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/PluginResolutionException

问题是您的JAVA_HOME链接到JRE,而不是JDK。试着

mvn package -Djava.home="C:Program FilesJavajdk1.8.0_101"

最新更新