Design Partners
Add ASLv2 license header
** org.openrewrite.java.AddApache2LicenseHeader** Adds the Apache Software License Version 2.0 to Java source files which are missing a license header.

Tags

  • oss

Source

  • groupId: org.openrewrite
  • artifactId: rewrite-java
  • version: 7.22.0

Usage

This recipe has no required configuration parameters and comes from a rewrite core library. It can be activated directly without adding any dependencies.
Gradle
Maven
build.gradle
1
plugins {
2
id("org.openrewrite.rewrite") version("5.20.0")
3
}
4
5
rewrite {
6
activeRecipe("org.openrewrite.java.AddApache2LicenseHeader")
7
}
8
9
repositories {
10
mavenCentral()
11
}
Copied!
pom.xml
1
<project>
2
<build>
3
<plugins>
4
<plugin>
5
<groupId>org.openrewrite.maven</groupId>
6
<artifactId>rewrite-maven-plugin</artifactId>
7
<version>4.23.0</version>
8
<configuration>
9
<activeRecipes>
10
<recipe>org.openrewrite.java.AddApache2LicenseHeader</recipe>
11
</activeRecipes>
12
</configuration>
13
</plugin>
14
</plugins>
15
</build>
16
</project>
Copied!
Recipes can also be activated directly from the command line by adding the argument -Drewrite.activeRecipes=org.openrewrite.java.AddApache2LicenseHeader

Definition

Recipe List
Yaml Recipe List
Licensed 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
https://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.`
1
---
2
type: specs.openrewrite.org/v1beta/recipe
3
name: org.openrewrite.java.AddApache2LicenseHeader
4
displayName: Add ASLv2 license header
5
description: Adds the Apache Software License Version 2.0 to Java source files which are missing a license header.
6
tags:
7
- oss
8
recipeList:
9
- org.openrewrite.java.AddLicenseHeader:
10
licenseText: Copyright 2021 the original author or authors.
11
<p>
12
Licensed under the Apache License, Version 2.0 (the "License");
13
you may not use this file except in compliance with the License.
14
You may obtain a copy of the License at
15
<p>
16
https://www.apache.org/licenses/LICENSE-2.0
17
<p>
18
Unless required by applicable law or agreed to in writing, software
19
distributed under the License is distributed on an "AS IS" BASIS,
20
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
See the License for the specific language governing permissions and
22
limitations under the License.
Copied!
Export as PDF
Copy link