我通过jenkins运行一个项目,但我得到了错误
/var/lib/jenkins/workspace/K2_Learning_Build/build.xml:130: The following error occurred while
executing this line:
/var/lib/jenkins/workspace/K2_Learning_Build/IgnitorACE/build.xml:251: Element type "if" must be
followed by either attribute specifications, ">" or "/>".
我在build.xml中使用了if条件,如第251行所示
<if ${INSTITUTE_NAME} == "K2_Learning">
<property name = "https.start" value='android:htps=\"' />
<replaceregexp file="../BuildConfig/src/com/edutor/build/${TYPE}.java" match="public static
final String NAVIGATION_MENU_ITEMS[] = (.*)" replace="public static final String
NAVIGATION_MENU_ITEMS[] = ${MENU_LIST_ITEMS};" />
</if>
<else>
<echo>INSTITUTE_Name: ${INSTITUTE_NAME}</echo>
</else>
请建议解决方案......
答案 0 :(得分:0)
据我所知,你不能像这样使用if
...尝试:
<if>
<contains string="${INSTITUTE_NAME}" substring="K2_Learning" />
<then>
...
</then>
</if>
另请参阅SF中的规范和示例:ant-contrib if spec