未封闭的角色类

时间:2014-10-16 12:43:26

标签: regex jenkins build.xml

我使用jenkins来构建我的项目。我在build.xml中写了以下几行

<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};" />  

在jave文件中,变量语法如下......

public static final String NAVIGATION_MENU_ITEMS[] =       
{"Messages","Tasks","Discussions","Stats","Notes","Apps","Profile","Settings"};

我想用我想要的stmt替换整个stmt,但是当iam运行时出现错误如下..

/var/lib/jenkins/workspace/K2_Learning_Build/IgnitorACE/build.xml:254: 
java.util.regex.PatternSyntaxException: Unclosed character class near index 56

public static final String NAVIGATION_MENU_ITEMS[] = (.*)

请提出任何建议

1 个答案:

答案 0 :(得分:0)

Alex说你需要摆脱括号:

  

逃离:NAVIGATION_MENU_ITEMS []