diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/CommandLineJobRunner.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/CommandLineJobRunner.java index 3d3dbba5d..e7b77844c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/CommandLineJobRunner.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/CommandLineJobRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2019 the original author or authors. + * Copyright 2006-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -142,6 +142,23 @@ import org.springframework.util.StringUtils; *

* *

+ * By default, the `CommandLineJobRunner` uses a {@link DefaultJobParametersConverter} + * which implicitly converts key/value pairs to identifying job parameters. + * However, it is possible to explicitly specify which job parameters are identifying + * and which are not by prefixing them with `+` or `-` respectively. In the following + * example, `schedule.date` is an identifying job parameter while `vendor.id` is not: + *

+ * + *

+ * + * java org.springframework.batch.core.launch.support.CommandLineJobRunner testJob.xml + * testJob +schedule.date=2008/01/24 -vendor.id=3902483920 + * + *

+ * + *

This behaviour can be overridden by using a custom `JobParametersConverter`.

+ * + *

* Once arguments have been successfully parsed, autowiring will be used to set * various dependencies. The {@link JobLauncher} for example, will be * loaded this way. If none is contained in the bean factory (it searches by diff --git a/spring-batch-docs/asciidoc/job.adoc b/spring-batch-docs/asciidoc/job.adoc index c3545eb7b..b4d2664ae 100644 --- a/spring-batch-docs/asciidoc/job.adoc +++ b/spring-batch-docs/asciidoc/job.adoc @@ -992,6 +992,29 @@ The following example shows a date passed as a job parameter to a job defined in