编译Maven给我多个错误

时间:2019-03-12 12:28:46

标签: java maven

我正在尝试在项目中使用Maven,但每次都会遇到此错误,并且不知道如何解决。

下面是我的所有设置:

Java Versoin:

C:\Users\TomBo\Downloads\AnimalShelterJavaGUI>java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Maven版本:

C:\Users\TomBo\Downloads\AnimalShelterJavaGUI>mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11- 
10T17:41:47+01:00)
Maven home: C:\Users\TomBo\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch- 
0\183.5429.30\plugins\maven\lib\maven3\bin\..
Java version: 1.8.0_181, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.8.0_181\jre
Default locale: nl_NL, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "x86", family: "dos"

Maven编译:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AnimalShelterJavaGUI 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
AnimalShelterJavaGUI ---
[INFO] Deleting C:\Users\TomBo\Downloads\AnimalShelterJavaGUI\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
AnimalShelterJavaGUI ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered 
resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ 
AnimalShelterJavaGUI ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, 
i.e. build is platform dependent!
[INFO] Compiling 14 source files to 
C:\Users\TomBo\Downloads\AnimalShelterJavaGUI\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.965 s
[INFO] Finished at: 2019-03-12T13:34:04+01:00
[INFO] Final Memory: 7M/20M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler- 
plugin:3.8.0:compile (default-compile) on project AnimalShelterJavaGUI: 
Fatal error compiling: invalid flag: --module-path -> [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/MojoExecutionException

这些是编译结果

我的JAVA_HOME目录:

enter image description here 我的POM.xml文件:

<groupId>groupId</groupId>
<artifactId>AnimalShelterJavaGUI</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
    <openfxVersion>11.0.2</openfxVersion>
    <codeVersion>11</codeVersion>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <release>${codeVersion}</release>
                <source>${codeVersion}</source>
                <target>${codeVersion}</target>
            </configuration>
        </plugin>
    </plugins>
</build>    

我想处理这个问题,因为即时消息将与詹金斯一起工作。 希望你们能帮助我。

0 个答案:

没有答案