Java Intellij-调试器在maven项目中不工作

Java Intellij-调试器在maven项目中不工作,java,maven,spring-boot,intellij-idea,Java,Maven,Spring Boot,Intellij Idea,我遇到了一个问题,无法在IntelliJ中调试maven sprint引导REST API应用程序。应用程序将启动,但不会在任何断点处停止 此外,当我停止调试器时,我会在日志的下面几行看到,但我可以看到java进程从未终止,当我第二次启动应用程序时,它失败了,因为服务器端口8080仍在使用中 Disconnected from the target VM, address: '127.0.0.1:53020', transport: 'socket' Process finished with

我遇到了一个问题,无法在IntelliJ中调试maven sprint引导REST API应用程序。应用程序将启动,但不会在任何断点处停止

此外,当我停止调试器时,我会在日志的下面几行看到,但我可以看到java进程从未终止,当我第二次启动应用程序时,它失败了,因为服务器端口8080仍在使用中

Disconnected from the target VM, address: '127.0.0.1:53020', transport: 'socket'
Process finished with exit code -1
在C:\Users\Bernhard.IdeaIC2017.3\system\log上的IntelliJ日志中,我看到以下错误

2017-12-15 07:22:30,761 [  11899]   INFO - .server.BuildMessageDispatcher - An existing connection was forcibly closed by the remote host 
java.io.IOException: An existing connection was forcibly closed by the remote host
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
    at sun.nio.ch.IOUtil.read(IOUtil.java:192)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
    at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100)
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:372)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    at java.lang.Thread.run(Thread.java:745)

经过一些搜索,我发现问题出在IntelliJ中的Maven运行/调试配置上。我用来启动SpringBootRESTAPI的命令行是

clean package -Drun.profiles=dev-us-east-1 -Drun.jvmArguments=-Denvironment=dev -DskipTests spring-boot:run

似乎java命令行属性是罪魁祸首。当我删除它的断点再次工作

经过一些搜索,我发现问题出在IntelliJ中的Maven运行/调试配置上。我用来启动SpringBootRESTAPI的命令行是

clean package -Drun.profiles=dev-us-east-1 -Drun.jvmArguments=-Denvironment=dev -DskipTests spring-boot:run

似乎java命令行属性是罪魁祸首。当我删除它的断点再次工作

您可能可以将该参数的值包装在引号中。读取整个命令行字符串的解析器可能由于-D arg中的-D arg而阻塞


clean package-Drun.profiles=dev-us-east-1-Drun.jvmArguments=“-Denvironment=dev”-DskipTests-spring-boot:run

您可能可以将该参数的值封装在引号中。读取整个命令行字符串的解析器可能由于-D arg中的-D arg而阻塞


clean package-Drun.profiles=dev-us-east-1-Drun.jvmArguments=“-Denvironment=dev”-DskipTests-spring-boot:run

你好,注意事项。我确实用双引号引用了“-Denvironment=dev”。我相信Stackoverflow似乎已经在我的复制粘贴中删除了它们…嗨,Jaraon,注意。我确实用双引号引用了“-Denvironment=dev”。我相信Stackoverflow似乎已经在我的复制粘贴中删除了它们。。。