Eclipse未在断点处停止

gj3fmq9x  于 5个月前  发布在  Eclipse
关注(0)|答案(1)|浏览(62)

我有一个简单的java,sprint Boot 项目,我想调试里面的代码,但是当我启动调试时,Eclipse不会在任何断点处停止。
我尝试清理工作区更新maven项目删除并重新导入项目。尝试调试另一个项目。我甚至更改了eclipse版本,但我在其他StackOverflow帖子中找到的这些解决方案都不起作用。
此外,“跳过所有断点”按钮未打开
我注意到调用堆栈是空的,我想知道问题是否来自它?
使用的版本:

  • JDK:17 Eclipse:
  • 2023-09(4.29.0)
  • Spring Boot :3.0.1

有什么想法吗?
下面是debug视图:
x1c 0d1x的数据
下面是我尝试调试的代码示例:



下面是我使用的maven pom.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.1</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>17</java.version>
    </properties>

    <dependencies>
        <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>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>2.2.0</version>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

字符串

qfe3c7zg

qfe3c7zg1#

您调试Maven构建脚本,该脚本反过来执行Sping Boot 应用程序。如果Sping Boot 应用程序在单独的(forked)JVM进程中执行(例如Maven-Surefire),则应用程序运行在与您调试的Java VM示例不同的Java VM示例中(我不知道这里是否实际如此)。
无论如何,最好直接将Sping Boot 启动类作为 *Java应用程序进行调试。

相关问题