Maven 什么';原因是什么;标头规范不是正则表达式:InvocationTargetException“;
我正在运行Maven 什么';原因是什么;标头规范不是正则表达式:InvocationTargetException“;,maven,checkstyle,Maven,Checkstyle,我正在运行maven checkstyle插件2.15,其标题检查规范如下 <module name="RegexpHeader"> <property name="header" value="^<!--\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="^<!--\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.-->.*"/>
<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 "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 */"/>
<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]