简体   繁体   English

无法在项目 fhirql 上执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile):致命错误编译

[英]Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project fhirql: Fatal error compiling

I run the command mvn clean package I got above error my pom is:我运行命令 mvn clean package 我得到了上面的错误,我的 pom 是:

在此处输入图像描述

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">4.0.0

<parent>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>hapi-fhir</artifactId>
    <version>3.2.0</version>
</parent>

<groupId>com.canehealth</groupId>
<artifactId>fhirql</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<properties>
    <maven.compiler.target>1.11</maven.compiler.target>
    <maven.compiler.source>1.11</maven.compiler.source>
    <maven.build.timestamp.format>EEE, MMM dd yyyy, HH:mm Z</maven.build.timestamp.format>
</properties>

<dependencies>
    <!-- Compile -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jersey</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-spring-boot-starter</artifactId>
        <version>${project.parent.version}</version>
    </dependency>
    <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-jpaserver-base</artifactId>
        <version>${project.parent.version}</version>
    </dependency>
    <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-jaxrsserver-base</artifactId>
        <version>${project.parent.version}</version>
    </dependency>

    <!--<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>-->

    <dependency>
        <groupId>io.jsonwebtoken</groupId>
        <artifactId>jjwt</artifactId>
        <version>0.9.1</version>
    </dependency>

    <!-- Added -->
    <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-client</artifactId>
        <version>${project.parent.version}</version>
    </dependency>
    <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-structures-dstu3</artifactId>
        <version>${project.parent.version}</version>
    </dependency>
    <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-testpage-overlay</artifactId>
        <version>${project.parent.version}</version>
        <type>war</type>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-testpage-overlay</artifactId>
        <version>${project.parent.version}</version>
        <classifier>classes</classifier>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
    </dependency>
    <!-- Optional -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <optional>true</optional>
    </dependency>
    <!-- Test -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-spring-boot-autoconfigure</artifactId>
        <version>${project.parent.version}</version>
    </dependency>
    <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-base</artifactId>
        <version>${project.parent.version}</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>2.2.6.RELEASE</version>
            <executions>
                <execution>
                    <goals>
                        <goal>repackage</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <overlays>
                    <overlay>
                        <groupId>ca.uhn.hapi.fhir</groupId>
                        <artifactId>hapi-fhir-testpage-overlay</artifactId>
                    </overlay>
                </overlays>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.11</source>
                <target>1.11</target>
            </configuration>
        </plugin>
    </plugins>
</build>

I was facing the same issue, it works for me after changing version 11 to 1.8,我遇到了同样的问题,在将版本 11 更改为 1.8 后它对我有用,

replace代替

<properties>
   <java.version>11</java.version>
  </properties>

with

<properties>
   <java.version>1.8</java.version>
  </properties>

Since you have not pasted the complete error i believe you might have got below error由于您没有粘贴完整的错误,我相信您可能遇到了以下错误

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project demo: Fatal error compiling: error: invalid target release: 1.11 -

For maven compiler the correct JDK version is 1.8 , 1.9 , 1.10 , 11 , 12 ..对于 maven 编译器,正确的 JDK 版本是1.8 , 1.9 , 1.10 , 11 , 12 ..

You could also simply replace the above <properties> tag with below您也可以简单地将上面的<properties>标签替换为下面

    <properties>
    <java.version>11</java.version>
   </properties>

I have taken the above one from a sample project from Spring Initializr.我从 Spring Initializr 的示例项目中获取了上述一个。 You can remove the configuration from the maven compiler plugin too.您也可以从 maven 编译器插件中删除配置。

You can change maven.compiler.target version from 1.11 to 11您可以将maven.compiler.target版本从1.11更改为11

<properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.release>11</maven.compiler.release>
</properties>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile)” - "Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile)" 未能执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) 无法在项目上执行目标 org.apache.maven.plugins:maven-compiler-plugin (default-compile): Fatal error compiling: tools.jar not found - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin (default-compile) on project: Fatal error compiling: tools.jar not found 无法执行目标org.apache.maven.plugins:maven-compiler-plugin:3.5.1:在项目上编译(default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project 无法在项目上执行目标org.apache.maven.plugins:maven-compiler-plugin:3.3:compile(default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project 无法在项目 dbproxy 上执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile): - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project dbproxy: 无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:2。 3.2:在项目aopencommon上编译(默认编译) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2. 3.2:compile (default-compile) on project aopencommon 无法在项目上执行目标org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile(default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project Maven 构建编译错误:无法在项目 Maven 上执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) - Maven build Compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven 无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM