英文:
When running spring batch from maven, how do you set job parameters?
问题
如果我想发送作业参数,我该如何完成?
英文:
Lets say you run a spring batch program from maven:
mvn spring-boot:run -Dspring.batch.job.names=MyJobNameHere
What if I want to send job parameters? How would I accomplish that?
答案1
得分: 1
从这个答案中,我发现你可以使用以下方式将参数发送到Spring Boot应用程序中:
-Drun.arguments="param1=value1 param2=value2"
示例:
mvn spring-boot:run -Dspring.batch.job.names=jobNameHere -Drun.arguments="arg=val arg2=val2" -f pom.xml
在运行Spring Batch时,似乎同样的技巧有效。
英文:
From this answer, I found you can send parameters into a spring boot application using
-Drun.arguments="param1=value1 param2=value2"
Example:
mvn spring-boot:run -Dspring.batch.job.names=jobNameHere -Drun.arguments="arg=val arg2=val2" -f pom.xml
When running a Spring Batch, that same technique seems to work.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论