通常我会使用以下命令来运行我的Spring Boot应用程序:
我想设置自定义端口进行调试,这样我就可以从eclipse连接。当我从示例中添加参数时Spring Boot Maven Plugin。
它能工作,但是其他参数,比如
问题:如何使用所有参数运行?
mvn spring-boot:run -Drun.arguments=--server.port=9090 \
-Dpath.to.config.dir=/var/data/my/config/dir
我想设置自定义端口进行调试,这样我就可以从eclipse连接。当我从示例中添加参数时Spring Boot Maven Plugin。
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"
它能工作,但是其他参数,比如
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"
问题:如何使用所有参数运行?
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8787 -Dserver.port=9090 -Dpath.to.config.dir=/var/data/my/config/dir"
。 - wbk