首页 文章

spring boot编译失败

提问于
浏览
0

在“maven clean”之后,我的spring boot项目不再编译了

RunAs --> Spring Boot App

Impossible to find or load the main class com.in28minutes.springboot.rest.example.springboot2restservicebasic.SpringBoot2RestServiceBasicApplication

所以从终端: mvn spring-boot:run (或 spring-boot:repackage

Compilation failure
[ERROR] /D:/eclipse-workspace/spring-boot-2-rest-service-basic/spring-boot-2-rest-service-basic/src/main/java/com/in28minutes/springboot/rest/example/springboot2restservicebasic
/api/StudentResource.java:[18,45] package net.bytebuddy.implementation.bytecode does not exist

pom.xml

...
<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>
..

1 回答

  • 1

    您是否已将依赖项置于项目的 pom.xml 中?

    ```xml
        <dependency>
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy</artifactId>
            <version>1.7.11</version>
        </dependency>
    
    
     `version` 可以是你想要的另一个 .

相关问题