From 4e834100d721e92d02dfe2df115630d48f368d77 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Mon, 2 Sep 2024 12:23:51 +0800 Subject: [PATCH] Add LICENSE header detection --- .github/workflows/test.yml | 19 +++++++++++ .gitignore | 14 ++++++++ .licenserc.yaml | 32 +++++++++++++++++++ doc/CONTRIBUTING.md | 11 +++++++ hive-server2-jdbc-driver-thin/pom.xml | 16 ++++++++++ .../grpc-netty-shaded/native-image.properties | 14 ++++++++ .../jdbc/driver/thin/HiveServer2ThinTest.java | 16 ++++++++++ hive-server2-jdbc-driver-uber/pom.xml | 16 ++++++++++ .../grpc-netty-shaded/native-image.properties | 14 ++++++++ .../jdbc/driver/uber/HiveServer2UberTest.java | 16 ++++++++++ pom.xml | 16 ++++++++++ 11 files changed, 184 insertions(+) create mode 100644 .licenserc.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4172d8d..a2ce01b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,3 +1,17 @@ +# Copyright 2024 linghengqian@outlook.com +# +# 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 +# +# 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. + name: Test on: pull_request: @@ -7,6 +21,11 @@ on: branches: - master jobs: + license-check: + runs-on: 'ubuntu-latest' + steps: + - uses: actions/checkout@v4 + - uses: apache/skywalking-eyes/header@v0.6.0 test-ci: name: Test - JDK ${{ matrix.java }} on ${{ matrix.os }} if: github.repository == 'linghengqian/hive-server2-jdbc-driver' diff --git a/.gitignore b/.gitignore index f935613..21c1e2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,17 @@ +# Copyright 2024 linghengqian@outlook.com +# +# 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 +# +# 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. + target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/**/target/ diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 0000000..0d4e8a4 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,32 @@ +# Copyright 2024 linghengqian@outlook.com +# +# 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 +# +# 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. + +header: + license: + spdx-id: Apache-2.0 + copyright-owner: linghengqian@outlook.com + paths-ignore: + - 'dist' + - 'licenses' + - '**/*.md' + - 'LICENSE' + - 'NOTICE' + - '**/*.json' + - 'mvnw' + - 'mvnw.cmd' + - '.mvn/wrapper/maven-wrapper.properties' + comment: on-failure +dependency: + files: + - pom.xml diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index b340dab..98f45f0 100644 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -32,6 +32,17 @@ sdk use java 22.0.2-graalce ./mvnw -PnativeTestInCustom clean test ``` +### Fixes LICENSE issue + +- Execute the following command. + +```shell +git clone git@github.com:linghengqian/hive-server2-jdbc-driver.git +cd ./hive-server2-jdbc-driver/ +docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes:0.6.0 header fix +``` + + ### How to publish via the central portal First set up GPG. diff --git a/hive-server2-jdbc-driver-thin/pom.xml b/hive-server2-jdbc-driver-thin/pom.xml index 0aca05c..30036d7 100644 --- a/hive-server2-jdbc-driver-thin/pom.xml +++ b/hive-server2-jdbc-driver-thin/pom.xml @@ -1,4 +1,20 @@ + + diff --git a/hive-server2-jdbc-driver-thin/src/main/resources/META-INF/native-image/io.grpc/grpc-netty-shaded/native-image.properties b/hive-server2-jdbc-driver-thin/src/main/resources/META-INF/native-image/io.grpc/grpc-netty-shaded/native-image.properties index bbab8fa..4f8f4d8 100644 --- a/hive-server2-jdbc-driver-thin/src/main/resources/META-INF/native-image/io.grpc/grpc-netty-shaded/native-image.properties +++ b/hive-server2-jdbc-driver-thin/src/main/resources/META-INF/native-image/io.grpc/grpc-netty-shaded/native-image.properties @@ -1,3 +1,17 @@ +# Copyright 2024 linghengqian@outlook.com +# +# 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 +# +# 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. + # TODO This file exists to address https://github.com/grpc/grpc-java/issues/10601 . Args=--initialize-at-run-time=\ io.grpc.netty.shaded.io.netty.channel.ChannelHandlerMask,\ diff --git a/hive-server2-jdbc-driver-thin/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/thin/HiveServer2ThinTest.java b/hive-server2-jdbc-driver-thin/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/thin/HiveServer2ThinTest.java index 43a8a50..541d273 100644 --- a/hive-server2-jdbc-driver-thin/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/thin/HiveServer2ThinTest.java +++ b/hive-server2-jdbc-driver-thin/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/thin/HiveServer2ThinTest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2024 linghengqian@outlook.com + * + * 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 + * + * 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. + */ + package io.github.linghengqian.hive.server2.jdbc.driver.thin; import com.zaxxer.hikari.HikariConfig; diff --git a/hive-server2-jdbc-driver-uber/pom.xml b/hive-server2-jdbc-driver-uber/pom.xml index 26431b1..a6f7a27 100644 --- a/hive-server2-jdbc-driver-uber/pom.xml +++ b/hive-server2-jdbc-driver-uber/pom.xml @@ -1,4 +1,20 @@ + + diff --git a/hive-server2-jdbc-driver-uber/src/main/resources/META-INF/native-image/io.grpc/grpc-netty-shaded/native-image.properties b/hive-server2-jdbc-driver-uber/src/main/resources/META-INF/native-image/io.grpc/grpc-netty-shaded/native-image.properties index bbab8fa..4f8f4d8 100644 --- a/hive-server2-jdbc-driver-uber/src/main/resources/META-INF/native-image/io.grpc/grpc-netty-shaded/native-image.properties +++ b/hive-server2-jdbc-driver-uber/src/main/resources/META-INF/native-image/io.grpc/grpc-netty-shaded/native-image.properties @@ -1,3 +1,17 @@ +# Copyright 2024 linghengqian@outlook.com +# +# 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 +# +# 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. + # TODO This file exists to address https://github.com/grpc/grpc-java/issues/10601 . Args=--initialize-at-run-time=\ io.grpc.netty.shaded.io.netty.channel.ChannelHandlerMask,\ diff --git a/hive-server2-jdbc-driver-uber/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/uber/HiveServer2UberTest.java b/hive-server2-jdbc-driver-uber/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/uber/HiveServer2UberTest.java index 7c642ab..87cc131 100644 --- a/hive-server2-jdbc-driver-uber/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/uber/HiveServer2UberTest.java +++ b/hive-server2-jdbc-driver-uber/src/test/java/io/github/linghengqian/hive/server2/jdbc/driver/uber/HiveServer2UberTest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2024 linghengqian@outlook.com + * + * 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 + * + * 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. + */ + package io.github.linghengqian.hive.server2.jdbc.driver.uber; import com.zaxxer.hikari.HikariConfig; diff --git a/pom.xml b/pom.xml index 98dcb79..7942276 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,20 @@ + +