首页 > 系统相关 >Windows上Spotless的回车换行符问题

Windows上Spotless的回车换行符问题

时间:2023-03-07 09:55:58浏览次数:46  
标签:License Windows ERROR Spotless file under apache org 换行符

在 Windows 上执行命令“mvn clean package -DskipTests”编译时报如下错误,原因是 Windows 默认为“\r\n”。解决办法是在仓库的根目录下创建名为“.gitattributes”的文件,添加一行内容:

* text eol=lf

也可只针对指定文件类型:

*.java text eol=lf

注意将“.gitattributes”放在和文件“.gitignore”同目录下,即仓库的根目录下。

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.4.2:check (spotless-check) on project flink-connector-debezium: The following files had format violations:
[ERROR]     src\main\java\com\ververica\cdc\debezium\DebeziumDeserializationSchema.java
[ERROR]         @@ -1,40 +1,40 @@
[ERROR]         -/*\n
[ERROR]         - * Licensed to the Apache Software Foundation (ASF) under one\n
[ERROR]         - * or more contributor license agreements.  See the NOTICE file\n
[ERROR]         - * distributed with this work for additional information\n
[ERROR]         - * regarding copyright ownership.  The ASF licenses this file\n
[ERROR]         - * to you under the Apache License, Version 2.0 (the\n
[ERROR]         - * "License"); you may not use this file except in compliance\n
[ERROR]         - * with the License.  You may obtain a copy of the License at\n
[ERROR]         - *\n
[ERROR]         - *     http://www.apache.org/licenses/LICENSE-2.0\n
[ERROR]         - *\n
[ERROR]         - * Unless required by applicable law or agreed to in writing, software\n
[ERROR]         - * distributed under the License is distributed on an "AS IS" BASIS,\n
[ERROR]         - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n
[ERROR]         - * See the License for the specific language governing permissions and\n
[ERROR]         - * limitations under the License.\n
[ERROR]         - */\n
[ERROR]         -\n
[ERROR]         -package com.ververica.cdc.debezium;\n
[ERROR]         -\n
[ERROR]         -import org.apache.flink.annotation.PublicEvolving;\n
[ERROR]         -import org.apache.flink.api.java.typeutils.ResultTypeQueryable;\n
[ERROR]         -import org.apache.flink.util.Collector;\n
[ERROR]         -\n
[ERROR]         -import org.apache.kafka.connect.source.SourceRecord;\n
[ERROR]         -\n
[ERROR]         -import java.io.Serializable;\n
[ERROR]         -\n
[ERROR]         -/**\n
[ERROR]         - * The deserialization schema describes how to turn the Debezium SourceRecord into data types\n
[ERROR]         - * (Java/Scala objects) that are processed by Flink.\n
[ERROR]         - *\n
[ERROR]         - * @param <T> The type created by the deserialization schema.\n
[ERROR]         - */\n
[ERROR]         -@PublicEvolving\n
[ERROR]         -public interface DebeziumDeserializationSchema<T> extends Serializable, ResultTypeQueryable<T> {\n
[ERROR]         -\n
[ERROR]         -    /** Deserialize the Debezium record, it is represented in Kafka {@link SourceRecord}. */\n
[ERROR]         -    void deserialize(SourceRecord record, Collector<T> out) throws Exception;\n
[ERROR]         -}\n
[ERROR]         +/*\r\n
[ERROR]         + * Licensed to the Apache Software Foundation (ASF) under one\r\n
[ERROR]         + * or more contributor license agreements.  See the NOTICE file\r\n
[ERROR]         + * distributed with this work for additional information\r\n
[ERROR]         + * regarding copyright ownership.  The ASF licenses this file\r\n
[ERROR]         + * to you under the Apache License, Version 2.0 (the\r\n
[ERROR]         + * "License"); you may not use this file except in compliance\r\n
[ERROR]         + * with the License.  You may obtain a copy of the License at\r\n
[ERROR]     ... (32 more lines that didn't fit)
[ERROR] Violations also present in 24 other files.
[ERROR] Run 'mvn spotless:apply' to fix these violations.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :flink-connector-debezium

标签:License,Windows,ERROR,Spotless,file,under,apache,org,换行符
From: https://www.cnblogs.com/aquester/p/17187018.html

相关文章

  • 更改windows桌面路径的教程
    第一步:键盘上按住"win+E"打开文件资源管理器,然后快速访问的桌面,点击“属性”。第二步:默认桌面在用户名下的Desktop文件夹,比如:C:\Users\ataola\Desktop,在注册表的路径为......
  • Windows系统中卸载文件系统
    1.查看挂载的盘符netuse 2.卸载X盘符挂载的文件系统netuseX:/delete 3.其它手动卸载Windows系统中所有已挂载的文件系统netuse*/delete自动卸载Wi......
  • tabby美观且实用的终端工具(windows/macos版 ,亲测有效!!!)
    Tabby简介Tabby(前身是Terminus)是一个可高度配置的终端模拟器和SSH或串口客户端,支持Windows,macOS和Linux功能强大到爆:集成SSH,Telnet客户端和连接管理器集成串......
  • Windows Server 2003 安装 python
    WindowsServer2003是32位的系统,最高支持的python版本是3.4下载python-3.4https://www.python.org/ftp/python/3.4.4/python-3.4.4.msi D:\Python34\Scripts>pip......
  • golang获取windows版本和详细信息
    场景:将木马丢到感染机运行后回连时希望返回感染机的操作系统信息.golang可以通过runtime.OS获取到操作系统类型,但是无法获取详细的版本信息,如win7win10等,解决方案;......
  • windows内核网络调试
    1windows网络调试2bcdedit/dbgsettingsnethostip:192.168.2.1port:500003Key=sfz54lfnnz7r.2qv9aiovadd5i.2gtkz3xamru32.cdwwl45caxfl456bcdedit/set{......
  • windows下载符号
    1"C:\ProgramFiles(x86)\WindowsKits\10\Debuggers\x86\symchk.exe""c:\windows\system32\calc.exe"/sSRV*c:\symbols\*http://msdl.microsoft.com/download/symbo......
  • 网络安全(中职组)-B模块:Windows操作系统渗透测试
    任务环境说明:服务器场景:teltest服务器场景操作系统:Windows7(封闭靶机)1.通过本地PC中渗透测试平台Kali对服务器场景Windows进行系统服务及版本扫描渗透测试,并将该作显示......
  • Windows Torch 安装
    首先,电脑要有显卡(没有显卡建议查cpu版本Torch安装和使用)一、基础装备(一)、Pycharm下载地址:DownloadPyCharm:PythonIDEforProfessionalDevelopersbyJetBrains......
  • Windows server 2008 R2 无法启用网络发现
    问题描述:就算在高级共享设置中启用网络发现并保存修改也会变回关闭网络发现解决方法:打开服务设置(win+R在运行栏里输入services.msc),开启以下三个服务FunctionDisco......