diff --git a/buildSrc/src/main/groovy/org/opensearch/gradle/precommit/LicenseHeadersTask.groovy b/buildSrc/src/main/groovy/org/opensearch/gradle/precommit/LicenseHeadersTask.groovy index 30bd6010950..965adc00803 100644 --- a/buildSrc/src/main/groovy/org/opensearch/gradle/precommit/LicenseHeadersTask.groovy +++ b/buildSrc/src/main/groovy/org/opensearch/gradle/precommit/LicenseHeadersTask.groovy @@ -42,7 +42,7 @@ class LicenseHeadersTask extends AntTask { /** Allowed license families for this project. */ @Input - List approvedLicenses = ['Apache', 'Generated', 'Vendored'] + List approvedLicenses = ['Apache', 'Generated', 'SPDX', 'Vendored'] /** * Files that should be excluded from the license header check. Use with extreme care, only in situations where the license on the @@ -121,6 +121,13 @@ class LicenseHeadersTask extends AntTask { pattern(substring: "Licensed to Elasticsearch under one or more contributor") } + // SPDX + substringMatcher(licenseFamilyCategory: "SPDX ", + licenseFamilyName: "SPDX") { + // Apache license (OpenSearch) + pattern(substring: "Copyright OpenSearch Contributors.") + } + // Generated resources substringMatcher(licenseFamilyCategory: "GEN ", licenseFamilyName: "Generated") { diff --git a/buildSrc/src/main/resources/license-headers/oss-license-header.txt b/buildSrc/src/main/resources/license-headers/oss-license-header.txt index d85645a12ef..344a8ff7d97 100644 --- a/buildSrc/src/main/resources/license-headers/oss-license-header.txt +++ b/buildSrc/src/main/resources/license-headers/oss-license-header.txt @@ -1,18 +1,2 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch 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. - */ \ No newline at end of file +// Copyright OpenSearch Contributors. +// SPDX-License-Identifier: Apache-2.0 diff --git a/gradle/ide.gradle b/gradle/ide.gradle index ee88a9926ba..1455725c2ed 100644 --- a/gradle/ide.gradle +++ b/gradle/ide.gradle @@ -75,27 +75,12 @@ if (System.getProperty('idea.active') == 'true') { } copyright { useDefault = 'Apache' - scopes = ['x-pack': 'Elastic'] profiles { Apache { - keyword = 'Licensed to OpenSearch under one or more contributor' + keyword = 'Copyright OpenSearch Contributors.' notice = '''\ - Licensed to OpenSearch under one or more contributor - license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright - ownership. OpenSearch 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.'''.stripIndent() + Copyright OpenSearch Contributors. + SPDX-License-Identifier: Apache-2.0'''.stripIndent() } } }