-
Bug
-
Resolution: Not a Bug
-
Critical
-
None
-
None
-
None
-
None
-
False
-
-
False
-
-
---
-
---
-
Critical
-
No
I have created a new rule to check java versions using the <xmlfile> condition, but it doesn't work in my manual test. I'm unsure if this is due to a bug or incorrect syntax on my part. The rule I tried to implement is as follows:
<xmlfile matches="//java.version[windup:matches(text(), '{v}')]" in="pom.xml"/> ...... <where param="v"> <matches pattern="(9|10|12|13|14|15|16|19|20).*"/> </where>
I also tested multiple other patterns, all didn't work:
<xmlfile matches="//*[starts-with(java.version,'19')]" in="pom.xml"/>
<xmlfile matches="//java.version" in="pom.xml"/>
<xmlfile matches="//*windup:matches(text(), '{v}')"/> <where param="v"> <matches pattern="(9|10|12|13|14|15|16|19|20)"/> </where>
<xmlfile matches="//properties/java.version/text()" xpathResultMatch="19"/>
<xmlfile matches="//*/java.version[starts-with(text(), '19')]"/>
<xmlfile matches="//project"/>
The only pattern that worked in my tests is this one:
<xmlfile matches="//*[starts-with(text(), '19')]"/>
Could you help with this issue, thanks!