当前位置: 首页 > news >正文

【alluxio编译报错】Some files do not have the expected license header

Some files do not have the expected license header

快捷导航

在开始解决问题之前,大家可以通过下面的导航快速找到相关资源啦!💡👇

快捷导航链接地址备注
相关文档-
ambari+bigtop自定义组件集成https://blog.csdn.net/TTBIGDATA/article/details/142150086CSDN地址
编译、开发、部署、集成解决方案https://t.zsxq.com/0PVcI知识星球
源代码-
Ambari-envhttps://github.com/TtBigdata/ambari-envGitHub
Ambari-envhttps://gitee.com/tt-bigdata/ambari-envGitee
Ambari-2.8.0魔改版https://gitee.com/tt-bigdata/ambari-2.8.0Gitee
编译包-
蓝奏云-1.0.2https://www.ilanzou.com/s/4mfyXMq9?code=6655
阿里云盘-1.0.2https://www.alipan.com/s/q3TqL1mdPBp提取码:01no
联系方式-
QQ:1群https://qm.qq.com/q/3DrsCY5b7a

正题:如何解决 Some files do not have the expected license header 错误问题 🤔

1️⃣ 错误分析

下述完整报错日志:

[INFO] Reactor Summary:
[INFO]
[INFO] Alluxio Integration 2.9.3 .......................... FAILURE
[INFO] Alluxio Integration - JNIFUSE 2.9.3 ................ SKIPPED
[INFO] Alluxio Integration - JNIFUSE - Native 2.9.3 ....... SKIPPED
[INFO] Alluxio Integration - JNIFUSE - Filesystem 2.9.3 ... SKIPPED
[INFO] Alluxio Under File System - S3 2.9.3 ............... SKIPPED
[INFO] Alluxio Integration - FUSE 2.9.3 ................... SKIPPED
[INFO] Alluxio Shaded Libraries 2.9.3 ..................... SKIPPED
[INFO] Alluxio Shaded Libraries - Hadoop 3.3.1 ............ SKIPPED
[INFO] Alluxio Under File System - HDFS 2.9.3 ............. SKIPPED
[INFO] Alluxio Core - Server - Worker 2.9.3 ............... SKIPPED
[INFO] Alluxio Stress 2.9.3 ............................... SKIPPED
[INFO] Alluxio Stress - Common 2.9.3 ...................... SKIPPED
[INFO] Alluxio Stress - Shell 2.9.3 ....................... SKIPPED
[INFO] Alluxio Assembly 2.9.3 ............................. SKIPPED
[INFO] Alluxio Assembly - Client 2.9.3 .................... SKIPPED
[INFO] Alluxio Core - Server - Master 2.9.3 ............... SKIPPED
[INFO] Alluxio Core - Server - Proxy 2.9.3 ................ SKIPPED
[INFO] Alluxio Job Service - Server 2.9.3 ................. SKIPPED
[INFO] Alluxio Log Server 2.9.3 ........................... SKIPPED
[INFO] Alluxio Assembly - Server 2.9.3 .................... SKIPPED
[INFO] Alluxio Core - Client - HDFS3 2.9.3 ................ SKIPPED
[INFO] Alluxio Integration - Tools 2.9.3 .................. SKIPPED
[INFO] Alluxio Integration - Tools - HMS 2.9.3 ............ SKIPPED
[INFO] Alluxio Integration - Validation Tools 2.9.3 ....... SKIPPED
[INFO] Alluxio MiniCluster 2.9.3 .......................... SKIPPED
[INFO] Alluxio Tests 2.9.3 ................................ SKIPPED
[INFO] Alluxio Microbenchmarks 2.9.3 ...................... SKIPPED
[INFO] Alluxio Table 2.9.3 ................................ SKIPPED
[INFO] Alluxio Table - Base Module 2.9.3 .................. SKIPPED
[INFO] Alluxio Table - Client 2.9.3 ....................... SKIPPED
[INFO] Alluxio Shaded Libraries - Client 2.9.3 ............ SKIPPED
[INFO] Alluxio Shaded Libraries - Hadoop3 Client 2.9.3 .... SKIPPED
[INFO] Alluxio Table - Server 2.9.3 ....................... SKIPPED
[INFO] Alluxio Table - Server - Common 2.9.3 .............. SKIPPED
[INFO] Alluxio Table - Server - Master 2.9.3 .............. SKIPPED
[INFO] Alluxio Table - Server - UnderDB 2.9.3 ............. SKIPPED
[INFO] Alluxio Table - Server - UnderDB - Hive 2.9.3 ...... SKIPPED
[INFO] Alluxio Table - Server - UnderDB - Glue 2.9.3 ...... SKIPPED
[INFO] Alluxio Table - Shell 2.9.3 ........................ SKIPPED
[INFO] Alluxio Under File System - Microsoft Azure DataLake Gen 2 2.9.3 SKIPPED
[INFO] Alluxio Under File System - Microsoft Azure DataLake 2.9.3 SKIPPED
[INFO] Alluxio Under File System - CephFS 2.9.3 ........... SKIPPED
[INFO] Alluxio Under File System - Cephfs-hadoop 2.9.3 .... SKIPPED
[INFO] Alluxio Under File System - Tencent Cloud COS 2.9.3  SKIPPED
[INFO] Alluxio Under File System - Tencent Cloud COSN 2.9.3 SKIPPED
[INFO] Alluxio Under File System - GCS 2.9.3 .............. SKIPPED
[INFO] Alluxio Under File System - Qiniu Kodo 2.9.3 ....... SKIPPED
[INFO] Alluxio Under File System - Aliyun OSS 2.9.3 ....... SKIPPED
[INFO] Alluxio Under File System - Apache Ozone 2.9.3 ..... SKIPPED
[INFO] Alluxio Under File System - Swift 2.9.3 ............ SKIPPED
[INFO] Alluxio Under File System - Microsoft Azure Blob Storage 2.9.3 SKIPPED
[INFO] Alluxio Under File System - Web 2.9.3 .............. SKIPPED
[INFO] Alluxio Under File System - Huawei OBS 2.9.3 ....... SKIPPED
[INFO] Alluxio UI 2.9.3 ................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  15:11 min
[INFO] Finished at: 2024-09-19T09:12:31+08:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "yarn" could not be activated because it does not exist.
[ERROR] Failed to execute goal com.mycila:license-maven-plugin:4.0.rc1:check (default) on project alluxio-integration: Some files do not have the expected license header -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.mycila:license-maven-plugin:4.0.rc1:check (default) on project alluxio-integration: Some files do not have the expected license headerat org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke (Method.java:498)at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Some files do not have the expected license headerat com.mycila.maven.plugin.license.LicenseCheckMojo.execute (LicenseCheckMojo.java:74)at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke (Method.java:498)at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[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 :alluxio-integration

license-maven-plugin 是一个用来检查和管理项目中许可证头的插件。此错误表示在代码中的某些文件缺少预期的许可证声明头,导致 Maven 构建失败。

错误信息:

[ERROR] Failed to execute goal com.mycila:license-maven-plugin:4.0.rc1:check (default) on project alluxio-integration: Some files do not have the expected license header

错误原因:

  • 项目中的部分文件没有指定的许可证头,违反了构建规则。
  • 文件格式或文件路径被插件误认为需要许可证头,但实际不需要(如生成的代码或第三方依赖文件)。

2️⃣ 解决方案 💡
方案 1: 跳过许可证检查

通过配置 pom.xml 或在构建命令中跳过许可证检查,快速解决问题。

在这里插入图片描述

配置示例:

<!--The Alluxio Open Foundation licenses this work under the Apache License, version 2.0(the "License"). You may not use this work except in compliance with the License, which isavailable at www.apache.org/licenses/LICENSE-2.0This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied, as more fully set forth in the License.See the NOTICE file distributed with this work for information regarding copyright ownership.-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.alluxio</groupId><artifactId>alluxio-parent</artifactId><version>2.9.3</version></parent><artifactId>alluxio-integration</artifactId><packaging>pom</packaging><name>Alluxio Integration</name><description>Parent POM for different integrations with Alluxio</description><modules><!-- exclude checker from hadoop-1 profile as yarn is not available in Hadoop 1.x --><module>fuse</module><module>jnifuse</module><module>tools</module></modules><properties><!-- The following paths need to be defined here as well as in the parent pom so that mvn can --><!-- run properly from sub-project directories --><build.path>${project.parent.basedir}/build</build.path></properties><build><plugins><plugin><groupId>com.mycila</groupId><artifactId>license-maven-plugin</artifactId><configuration><skip>true</skip> <!-- 跳过检查 --><excludes><exclude>kubernetes/operator/alluxio/hack/boilerplate.go.txt</exclude></excludes><mapping><alluxio>SCRIPT_STYLE</alluxio><go>SLASHSTAR_STYLE</go><java>SLASHSTAR_STYLE</java><tsx>SLASHSTAR_STYLE</tsx><scss>SLASHSTAR_STYLE</scss><properties.template>SCRIPT_STYLE</properties.template><sh.template>SCRIPT_STYLE</sh.template><workers>SCRIPT_STYLE</workers><xml.template>XML_STYLE</xml.template></mapping><useDefaultMapping>true</useDefaultMapping><strictCheck>true</strictCheck></configuration></plugin></plugins></build>
</project>

命令行跳过:

mvn package -Dlicense.skip=true
方案 2: 自动添加许可证头

利用 mvn license:format 自动为项目中的所有文件添加正确的许可证头,保证项目合规。

命令:

mvn license:format
方案 3: 排除特定文件

配置 pom.xml,排除特定文件或文件夹,不对这些文件执行许可证检查。

配置示例:

<plugin><groupId>com.mycila</groupId><artifactId>license-maven-plugin</artifactId><configuration><excludes><exclude>**/*.txt</exclude> <!-- 排除指定文件 --><exclude>src/generated-sources/**</exclude> <!-- 排除生成的代码 --></excludes></configuration>
</plugin>
方案 4: 降低严格性

通过设置 strictCheckfalse,减少对许可证头的严格要求,允许部分文件没有许可证头。

配置示例:

<plugin><groupId>com.mycila</groupId><artifactId>license-maven-plugin</artifactId><configuration><strictCheck>false</strictCheck> <!-- 降低严格性 --></configuration>
</plugin>
http://www.lryc.cn/news/443419.html

相关文章:

  • 基于SpringBoot+Vue的商城积分系统
  • docker-compose up 报错:KeyError: ‘ContainerConfig‘
  • 股票行情接口,量化金融交易在未来会被广泛应用吗
  • [SDX35+WCN6856]SDX35 开启class/gpio子系统配置操作说明
  • react:React Hook函数
  • 算法学习2
  • vue循环渲染动态展示内容案例(“更多”按钮功能)
  • 好用的工具网址
  • 【Temporal】方法规范
  • Python实现图形学曲线和曲面的Bezier曲线算法
  • Unity数据持久化4——2进制
  • 经典sql题(八)SQL 查询详细指南总结一
  • 用Python实现时间序列模型实战——Day 30: 学习总结与未来规划
  • ChatGPT居然主动勾引用户,OpenAI又测试新功能? 一文教你学会订阅
  • 基于SpringBoot+Vue的考研百科网站系统
  • 深度之眼(三十)——pytorch(一)--深入浅出pytorch(附安装流程)
  • 麒麟银河桌面版,成功安装cuda12.6,mysql
  • CentOS 7 YUM源不可用
  • Java反序列化利用链篇 | URLDNS链
  • Android 短信验证码自动填充
  • 数据库 MySQL 是否需要容器化?
  • Kettle的安装及简单使用
  • Golang | Leetcode Golang题解之第420题强密码检验器
  • 面试金典题3
  • FFmpeg开发笔记(五十六)使用Media3的Exoplayer播放网络视频
  • Python使用总结之py-docx将word文件中的图片保存,并将内容返回
  • Radware 报告 Web DDoS 攻击活动
  • OpenCV运动分析和目标跟踪(2)累积操作函数accumulateSquare()的使用
  • PCIe进阶之TL:Common Packet Header Fields TLPs with Data Payloads Rules
  • Linux之实战命令01:xargs应用实例(三十五)