• Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Critical Critical
    • None
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      * *Why we missed the bug?*
       ** Pick to proper answer from drop-down field upper.
       +_Additional comments:_+


       * *What is required:*
       ** Pick to proper answer from drop-down field upper.
       +_Additional comments:_+
      Show
      * *Why we missed the bug?*  ** Pick to proper answer from drop-down field upper.  +_Additional comments:_+  * *What is required:*  ** Pick to proper answer from drop-down field upper.  +_Additional comments:_+
    • ---
    • ---
    • Critical
    • No

      check java version for azure by KaiqianYang · Pull Request #957 · windup/windup-rulesets (github.com) 

      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!

              Unassigned Unassigned
              kaiqianyang Kaiqian Yang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: