通常我用命令运行我的Spring Boot应用程序:
mvn spring-boot:run -Drun.arguments=--server.port=9090 \
-Dpath.to.config.dir=/var/data/my/config/dir
Run Code Online (Sandbox Code Playgroud)
我想设置自定义端口进行调试,所以我可以从eclipse连接.当我从示例http://docs.spring.io/spring-boot/docs/1.1.2.BUILD-SNAPSHOT/maven-plugin/examples/run-debug.html添加参数时
mvn spring-boot:run -Drun.arguments=--server.port=9090 \
-Dpath.to.config.dir=/var/data/my/config/dir \
-Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8787"
Run Code Online (Sandbox Code Playgroud)
它有效,但其他论点喜欢server.port或path.to.config.dir不再被认可,我得到例外:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed
to parse configuration class [com.my.app.Controller]; nested exception
is java.lang.IllegalArgumentException: Could not resolve placeholder
'path.to.config.dir' in string value
file:///${path.to.config.dir}/some.properties"
Run Code Online (Sandbox Code Playgroud)
问题:如何运行所有参数?
我能够调试一个简单的Java hello世界.第一步是"编译" javac -g.我查看了如何用maven完成同样的操作并找到http://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/run-debug.html,但这些说明用于运行应用程序并等待调试器连接.
我也试着使用target/classes了classpath在 launch.json.调试器抱怨它无法在根目录中找到文件/,但它会运行.虽然调试器正在运行,但应用程序没有响应HTTP请求.
是否有一个mvn命令来编译应用程序javac -g并生成一个.class调试器能够成功运行?