4
<bean id="fileDiffTaskelt" class="org.springframework.batch.core.step.tasklet.SystemCommandTasklet" scope="step">
<property name="command" value="diff #{jobParameters['INPUT_FILE']} #{jobParameters['PREVIOUS_FILE']} |  grep -e '<' -e '>' | grep -x '.\{20\}' > #{jobParameters['FILTERED_FILE']}"/>
<property name="timeout" value="60000"/>
<property name="workingDirectory" value="/tmp/hub"/>
</bean>

I'm getting this error in my IDE : The value of attribute "value" associated with an element type "property" must not contain the '<' character. Im using this character in my grep command and is very essential, stuck here.

normalindon1
  • 55
  • 1
  • 5
  • Possible duplicate of [How to inject string properties containing < character into Spring beans?](http://stackoverflow.com/questions/10171183/how-to-inject-string-properties-containing-character-into-spring-beans) – Alex Ciocan Dec 11 '16 at 21:01

2 Answers2

8

You can use Escape Strings for the same.

Replace '<' in value attribute as &apos;&lt;&apos; .

    <property name="command" value="diff #{jobParameters['INPUT_FILE']}
      #{jobParameters['PREVIOUS_FILE']} |  grep -e &apos;&lt;&apos; -e &apos;&gt;&apos; 
      | grep -x '.\{20\}' > #{jobParameters['FILTERED_FILE']}"/>

Similarly use for appropriate escape strings for '>'

XML Escape Strings

Community
  • 1
  • 1
Rohan
  • 3,068
  • 1
  • 20
  • 26
1

You can use special characters.

< &lt;
> &gt;

https://docs.oracle.com/cd/A97335_02/apps.102/bc4j/developing_bc_projects/obcCustomXml.htm