Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 什么';原因是什么;标头规范不是正则表达式:InvocationTargetException“;_Maven_Checkstyle - Fatal编程技术网

Maven 什么';原因是什么;标头规范不是正则表达式:InvocationTargetException“;

Maven 什么';原因是什么;标头规范不是正则表达式:InvocationTargetException“;,maven,checkstyle,Maven,Checkstyle,我正在运行maven checkstyle插件2.15,其标题检查规范如下 <module name="RegexpHeader"> <property name="header" value="^&lt;!--\n Licensed to the Apache Software Foundation (ASF) under one or more\n contributor license agreements. S

我正在运行
maven checkstyle插件
2.15,其标题检查规范如下

<module name="RegexpHeader">
    <property
        name="header"
        value="^&lt;!--\n    Licensed to the Apache Software Foundation (ASF) under one or more\n   contributor license agreements.  See the NOTICE file distributed with\n   this work for additional information regarding copyright ownership.\n   The ASF licenses this file to You under the Apache License, Version 2.0\n   (the &quot;License&quot;); you may not use this file except in compliance with\n   the License.  You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an &quot;AS IS&quot; BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.--&gt;.*"/>
    <property name="fileExtensions" value="xml"/>
</module>
<module name="RegexpHeader">
    <property
        name="header"
        value="^/**\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the &quot;License&quot;); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"/>
    <property name="fileExtensions" value="java"/>
</module>

正则表达式中某些未替换字符(如
*
)的实际原因


maven checkstyle插件调用的
checkstyle
的反馈并不太好。我对代码进行了改进,以显示模式编译的错误消息,并在处请求合并。

Maven插件只是checkstyle库的包装,所有错误都来自于库,请尝试通过直接运行checkstyle来重现问题,请参阅的“下载并运行”一章中的示例
Failed during checkstyle configuration: cannot initialize module RegexpHeader - Cannot set property 'header' in module RegexpHeader to '^/**\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the "License"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.*': line 1 in header specification is not a regular expression: InvocationTargetException -> [Help 1]