| name | license-compliance |
| description | Ensures all new files include proper Apache 2.0 license headers. Use when creating any new file in the Apache Beam repository. |
License Compliance in Apache Beam
Overview
Every source file in Apache Beam MUST include the Apache 2.0 license header. The RAT (Release Audit Tool) check will fail if any file is missing the required license.
License Headers by File Type
Java, Groovy, Kotlin, Scala
Python
Go
Markdown (.md)
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
YAML (.yml, .yaml) and YAML Frontmatter
Shell Scripts (.sh, .bash)
#!/bin/bash
XML, HTML
RAT Check
Running Locally
./gradlew rat
Checking Results
If the RAT check fails, view the report:
build/reports/rat/index.html
Key Rules
- Every new file needs a license header - No exceptions for source files
- Place header at the very top - Before any code, imports, or declarations
- Use correct comment style - Match the file type's comment syntax
- YAML frontmatter exception - For files with YAML frontmatter (like SKILL.md), place the license as YAML comments inside the frontmatter block, after the opening
---
- Dependencies must be Apache-compatible - New dependencies need licenses compatible with Apache 2.0
Common Mistakes
- Forgetting to add headers to new test files
- Missing headers on configuration files (.yaml, .json, .xml)
- Adding HTML comments before YAML frontmatter (breaks parsing)