Skip to content

Commit 9ac7363

Browse files
author
yuzelin
committed
[ci] Add java module license check
1 parent 42efa85 commit 9ac7363

File tree

19 files changed

+2212
-16
lines changed

19 files changed

+2212
-16
lines changed

.github/workflows/check-licensing.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Check licensing
17+
18+
on: [push, pull_request]
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
env:
28+
MVN_COMMON_OPTIONS: -U -B --no-transfer-progress
29+
MVN_BUILD_OUTPUT_FILE: "/tmp/mvn_build_output.out"
30+
MVN_VALIDATION_DIR: "/tmp/paimon-validation-deployment"
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
35+
- name: Set JDK
36+
uses: actions/setup-java@v2
37+
with:
38+
java-version: 8
39+
distribution: 'adopt'
40+
- name: Build
41+
run: |
42+
set -o pipefail
43+
cd paimon_python_java/paimon-python-java-bridge
44+
mvn clean deploy ${{ env.MVN_COMMON_OPTIONS }} -DskipTests \
45+
-DaltDeploymentRepository=validation_repository::default::file:${{ env.MVN_VALIDATION_DIR }} \
46+
| tee ${{ env.MVN_BUILD_OUTPUT_FILE }}
47+
cd tools/ci/paimon-ci-tools
48+
mvn clean install -DskipTests
49+
50+
- name: Check licensing
51+
run: |
52+
cd paimon_python_java/paimon-python-java-bridge
53+
mvn ${{ env.MVN_COMMON_OPTIONS }} exec:java@check-licensing -N \
54+
-Dexec.args="${{ env.MVN_BUILD_OUTPUT_FILE }} $(pwd) ${{ env.MVN_VALIDATION_DIR }}" \
55+
-Dlog4j.configurationFile=file://$(pwd)/tools/ci/log4j.properties
56+
env:
57+
MAVEN_OPTS: -Xmx4096m

paimon_python_java/paimon-python-java-bridge/pom.xml

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<name>Paimon : Python-Java Bridge</name>
2828

2929
<packaging>jar</packaging>
30+
<inceptionYear>2024</inceptionYear>
3031

3132
<properties>
3233
<paimon.version>0.9.0</paimon.version>
@@ -132,21 +133,21 @@
132133
</plugin>
133134

134135
<plugin>
135-
<groupId>org.apache.maven.plugins</groupId>
136-
<artifactId>maven-compiler-plugin</artifactId>
137-
<version>3.8.0</version>
138-
<configuration>
139-
<source>${target.java.version}</source>
140-
<target>${target.java.version}</target>
141-
<!-- The semantics of this option are reversed, see MCOMPILER-209. -->
142-
<useIncrementalCompilation>false</useIncrementalCompilation>
143-
<compilerArgs>
144-
<!-- Prevents recompilation due to missing package-info.class, see MCOMPILER-205 -->
145-
<arg>-Xpkginfo:always</arg>
146-
<arg>-Xlint:deprecation</arg>
147-
</compilerArgs>
148-
</configuration>
149-
</plugin>
136+
<groupId>org.apache.maven.plugins</groupId>
137+
<artifactId>maven-compiler-plugin</artifactId>
138+
<version>3.8.0</version>
139+
<configuration>
140+
<source>${target.java.version}</source>
141+
<target>${target.java.version}</target>
142+
<!-- The semantics of this option are reversed, see MCOMPILER-209. -->
143+
<useIncrementalCompilation>false</useIncrementalCompilation>
144+
<compilerArgs>
145+
<!-- Prevents recompilation due to missing package-info.class, see MCOMPILER-205 -->
146+
<arg>-Xpkginfo:always</arg>
147+
<arg>-Xlint:deprecation</arg>
148+
</compilerArgs>
149+
</configuration>
150+
</plugin>
150151

151152
<plugin>
152153
<groupId>org.apache.maven.plugins</groupId>
@@ -159,6 +160,9 @@
159160
<goal>shade</goal>
160161
</goals>
161162
<configuration>
163+
<shadeTestJar>false</shadeTestJar>
164+
<shadedArtifactAttached>false</shadedArtifactAttached>
165+
<createDependencyReducedPom>true</createDependencyReducedPom>
162166
<artifactSet>
163167
<includes combine.children="append">
164168
<include>org.apache.paimon:paimon-bundle</include>
@@ -184,7 +188,54 @@
184188
</execution>
185189
</executions>
186190
</plugin>
191+
192+
<plugin>
193+
<groupId>org.apache.maven.plugins</groupId>
194+
<artifactId>maven-clean-plugin</artifactId>
195+
<configuration>
196+
<filesets>
197+
<fileset>
198+
<directory>${project.basedir}</directory>
199+
<includes>
200+
<include>dependency-reduced-pom.xml</include>
201+
</includes>
202+
</fileset>
203+
</filesets>
204+
</configuration>
205+
</plugin>
187206
</plugins>
188-
</build>
189207

208+
<pluginManagement>
209+
<plugins>
210+
<plugin>
211+
<groupId>org.codehaus.mojo</groupId>
212+
<artifactId>exec-maven-plugin</artifactId>
213+
<version>3.1.0</version>
214+
<inherited>false</inherited>
215+
<executions>
216+
<execution>
217+
<id>check-license</id>
218+
<!-- manually called -->
219+
<phase>none</phase>
220+
<goals>
221+
<goal>java</goal>
222+
</goals>
223+
</execution>
224+
</executions>
225+
<configuration>
226+
<mainClass>org.apache.paimon.tools.ci.licensecheck.LicenseChecker</mainClass>
227+
<includePluginDependencies>true</includePluginDependencies>
228+
<includeProjectDependencies>false</includeProjectDependencies>
229+
</configuration>
230+
<dependencies>
231+
<dependency>
232+
<groupId>org.apache.paimon</groupId>
233+
<artifactId>paimon-ci-tools</artifactId>
234+
<version>${project.version}</version>
235+
</dependency>
236+
</dependencies>
237+
</plugin>
238+
</plugins>
239+
</pluginManagement>
240+
</build>
190241
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
paimon-python-java-bridge
2+
Copyright 2024 The Apache Software Foundation
3+
4+
This product includes software developed at
5+
The Apache Software Foundation (http://www.apache.org/).
6+
7+
This project bundles the following dependencies under the under the MIT license
8+
- org.slf4j:slf4j-api:1.7.32
9+
10+
This project bundles the following dependencies under the Apache Software License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt)
11+
- org.apache.logging.log4j:log4j-1.2-api:2.17.1
12+
- org.apache.arrow:arrow-vector:14.0.0
13+
- org.apache.arrow:arrow-format:14.0.0
14+
- org.apache.arrow:arrow-memory-core:14.0.0
15+
- org.apache.arrow:arrow-memory-unsafe:14.0.0
16+
- org.apache.arrow:arrow-c-data:14.0.0
17+
- com.google.flatbuffers:flatbuffers-java:1.12.0
18+
19+
This project bundles the following dependencies under the 2-Clause BSD License
20+
- net.sf.py4j:py4j:0.10.9.7
21+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
################################################################################
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
################################################################################
18+
19+
rootLogger.level = INFO
20+
rootLogger.appenderRef.out.ref = ConsoleAppender
21+
22+
# -----------------------------------------------------------------------------
23+
# Console (use 'console')
24+
# -----------------------------------------------------------------------------
25+
26+
appender.console.name = ConsoleAppender
27+
appender.console.type = CONSOLE
28+
appender.console.layout.type = PatternLayout
29+
appender.console.layout.pattern = %d{HH:mm:ss,SSS} [%20t] %-5p %-60c %x - %m%n
30+
31+
# -----------------------------------------------------------------------------
32+
# File (use 'file')
33+
# -----------------------------------------------------------------------------
34+
appender.file.name = FileAppender
35+
appender.file.type = FILE
36+
appender.file.fileName = ${sys:log.dir}/mvn-${sys:mvn.forkNumber:-output}.log
37+
appender.file.layout.type = PatternLayout
38+
appender.file.layout.pattern = %d{HH:mm:ss,SSS} [%20t] %-5p %-60c %x - %m%n
39+
appender.file.createOnDemand = true
40+
41+
# suppress the irrelevant (wrong) warnings from the netty channel handler
42+
logger.netty.name = org.jboss.netty.channel.DefaultChannelPipeline
43+
logger.netty.level = ERROR
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22+
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<groupId>org.apache.paimon</groupId>
26+
<artifactId>paimon-ci-tools</artifactId>
27+
<version>0.1-SNAPSHOT</version>
28+
<name>Paimon : Tools : CI : Java</name>
29+
30+
<packaging>jar</packaging>
31+
32+
<properties>
33+
<japicmp.skip>true</japicmp.skip>
34+
<paimon.shade.guava.version>30.1.1-jre</paimon.shade.guava.version>
35+
<paimon.shade.version>0.6.0-incubating</paimon.shade.version>
36+
<log4j.version>2.17.1</log4j.version>
37+
</properties>
38+
39+
<dependencies>
40+
<dependency>
41+
<groupId>org.apache.paimon</groupId>
42+
<artifactId>paimon-shade-guava-30</artifactId>
43+
<version>${paimon.shade.guava.version}-${paimon.shade.version}</version>
44+
</dependency>
45+
46+
<dependency>
47+
<groupId>org.apache.logging.log4j</groupId>
48+
<artifactId>log4j-slf4j-impl</artifactId>
49+
<version>${log4j.version}</version>
50+
<scope>compile</scope>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.apache.logging.log4j</groupId>
54+
<artifactId>log4j-api</artifactId>
55+
<version>${log4j.version}</version>
56+
<scope>compile</scope>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.apache.logging.log4j</groupId>
60+
<artifactId>log4j-core</artifactId>
61+
<version>${log4j.version}</version>
62+
<scope>compile</scope>
63+
</dependency>
64+
</dependencies>
65+
66+
<build>
67+
<plugins>
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-compiler-plugin</artifactId>
71+
<configuration>
72+
<source>8</source>
73+
<target>8</target>
74+
</configuration>
75+
</plugin>
76+
</plugins>
77+
</build>
78+
</project>

0 commit comments

Comments
 (0)