I need to avoid process same file twice in Spring Batch project. Therefore I need to put file name as a Job Parameter. However, I know file name only in step1, not before the job execution. Therefore I can't pass file name as a job parameter while launching a job. My question is that, is there any other way to pass job parameter in step1 after get to know file name?
You don't need to add a parameter to Spring Batch, you need to pass data between steps. Here are some ways to do that => Storing in JobExecutionContext from tasklet and accessing in another tasklet
Hope it helps !