5.1.3. License checks
Up: 5.1. Compose phase
Prev: 5.1.2. Checks
Next: 5.1.4. SBOM workflows
Sections:
- Check selection
- Automatically excluded patterns
- Apache RAT check
- Lightweight license check
- Project policy exclusions
Check selection
When you configure a release, you can choose which checks run on source artifacts:
- Lightweight only: Run just the lightweight check.
- RAT only: Run just the Apache RAT check.
- Both: Run both (the default).
Binary artifacts are always checked with the lightweight check. You can't turn this off.
Automatically excluded patterns
These file patterns are automatically treated as "generated" and are ignored by both the RAT check and the lightweight check:
**/*.bundle.js**/*.chunk.js**/*.css.map**/*.js.map**/*.min.css**/*.min.js**/*.min.map
Apache RAT check
The Apache RAT (Release Audit Tool) scans every file in the archive.
Standard exclusions
Every RAT run excludes editor and operating system leftovers and hidden directories (RAT's MISC, MAC and HIDDEN_DIR collections):
**/*~,**/#*#,**/.#*,**/%*%and**/._***/.DS_Store- any directory whose name starts with
., such as.git,.githubor.idea
If the archive does not contain a .rat-excludes file, RAT also excludes Maven, IntelliJ IDEA and Git files (RAT's MAVEN, IDEA and GIT collections), even when your exclusions come from the RAT excludes URL or the RAT source excludes in your project policy:
**/target/**,**/.mvn/**,**/MANIFEST.MF,**/release.properties,**/pom.xml.releaseBackup,**/build.log,**/cobertura.serand**/.repository**/*.iml,**/*.ipr,**/*.iwsand**/.idea/****/.git/**and**/.gitignore
Custom exclusions
You can define your own exclusions by adding a .rat-excludes file to the archive.
ATR reads your RAT exclusions only from a .rat-excludes file in the archive, the RAT excludes URL, or the RAT source excludes in your project policy. It does not read RAT configuration from your build, such as apache-rat-plugin settings in a Maven POM or a RAT task in a Gradle or Ant build, nor from a .ratignore file, so exclusions that you configure there do not apply in ATR.
The details of a RAT check result on the report page link to the exclusions that RAT was given. An archive's own .rat-excludes can only be shown until the release is finalised.
[!IMPORTANT] If a
.rat-excludesfile exists, the Maven, IntelliJ IDEA and Git exclusions are not applied, but the other standard exclusions and the generated file patterns still are.
Scan root behavior: You can only have one .rat-excludes file. The folder it's in becomes the
scan root.
- Everything you want checked must be inside this scan root (or subfolders).
- Files outside this root might cause errors or get ignored in weird ways. It's best to just put
.rat-excludesat the very top of your archive.
Lightweight license check
This check looks at source files to see if they have valid license headers.
Accepted headers
ATR accepts the standard ASF source header or the SPDX form permitted by ASF policy:
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: See the NOTICE file distributed with this work for additional information regarding copyright ownership
SPDX-FileContributor: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements
All three fields must appear within the first 4KB, each on one line, in any order. Common comment
prefixes, differences in case, and extra spaces or tabs are accepted. The identifier line may end
with an inline block closer (*/, -->, or #>). A bare identifier, other license identifiers,
compound license expressions, and wrapped field values are not recognized by this check.
Content-based exclusions
Files are skipped (considered generated) if the first 4KB of the file contains one of these markers:
Generated By:JJTreeGenerated By:JavaCC
Included file types
Unlike RAT, the lightweight check uses an allowlist of file extensions (e.g., .js, .py, .java,
etc.). If a file extension isn't in the list, it gets ignored by default. Files that start with #! are also checked, whatever their extension.
Project policy exclusions
On top of file-based exclusions, you can configure exclusions right in the ATR web interface. When editing a project, look for the License Check Exclusions fields:
- RAT Exclusions: newline-separated patterns to exclude from RAT checks.
- Lightweight Exclusions: newline-separated patterns to exclude from lightweight checks.
These settings are stored on the project, but individual patterns may be scoped to one archive.
Scoping lightweight excludes to one archive
Lightweight source excludes use .gitignore syntax and match
/<archive-filename>/<path inside the archive>. Use an unrooted pattern (no leading /) to apply
to all source archives, or prefix with / and an archive filename glob to target one archive:
**/vendor/**
/maven-mvnd-*-src*/**/build/publish-on-homebrew.sh
RAT excludes and check-result ignores are configured separately.