Skip to content

Commit 9f451cb

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

File tree

17 files changed

+2164
-15
lines changed

17 files changed

+2164
-15
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
48+
- name: Check licensing
49+
run: |
50+
cd paimon_python_java/paimon-python-java-bridge
51+
mvn ${{ env.MVN_COMMON_OPTIONS }} exec:java@check-licensing -N \
52+
-Dexec.args="${{ env.MVN_BUILD_OUTPUT_FILE }} $(pwd) ${{ env.MVN_VALIDATION_DIR }}" \
53+
-Dlog4j.configurationFile=file://$(pwd)/tools/ci/log4j.properties
54+
env:
55+
MAVEN_OPTS: -Xmx4096m

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

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

2929
<packaging>jar</packaging>
30+
<inceptionYear>2024</inceptionYear>
31+
32+
<modules>
33+
<module>tools/ci/paimon-ci-tools</module>
34+
</modules>
3035

3136
<properties>
3237
<paimon.version>0.9.0</paimon.version>
@@ -37,6 +42,8 @@
3742
<spotless.delimiter>package</spotless.delimiter>
3843
<arrow.version>14.0.0</arrow.version>
3944
<target.java.version>1.8</target.java.version>
45+
<paimon.shade.guava.version>30.1.1-jre</paimon.shade.guava.version>
46+
<paimon.shade.version>0.6.0-incubating</paimon.shade.version>
4047
</properties>
4148

4249
<dependencies>
@@ -132,21 +139,21 @@
132139
</plugin>
133140

134141
<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>
142+
<groupId>org.apache.maven.plugins</groupId>
143+
<artifactId>maven-compiler-plugin</artifactId>
144+
<version>3.8.0</version>
145+
<configuration>
146+
<source>${target.java.version}</source>
147+
<target>${target.java.version}</target>
148+
<!-- The semantics of this option are reversed, see MCOMPILER-209. -->
149+
<useIncrementalCompilation>false</useIncrementalCompilation>
150+
<compilerArgs>
151+
<!-- Prevents recompilation due to missing package-info.class, see MCOMPILER-205 -->
152+
<arg>-Xpkginfo:always</arg>
153+
<arg>-Xlint:deprecation</arg>
154+
</compilerArgs>
155+
</configuration>
156+
</plugin>
150157

151158
<plugin>
152159
<groupId>org.apache.maven.plugins</groupId>
@@ -159,6 +166,9 @@
159166
<goal>shade</goal>
160167
</goals>
161168
<configuration>
169+
<shadeTestJar>false</shadeTestJar>
170+
<shadedArtifactAttached>false</shadedArtifactAttached>
171+
<createDependencyReducedPom>true</createDependencyReducedPom>
162172
<artifactSet>
163173
<includes combine.children="append">
164174
<include>org.apache.paimon:paimon-bundle</include>
@@ -180,11 +190,71 @@
180190
<shadedPattern>org.apache.paimon.shade.jackson2.com.fasterxml.jackson</shadedPattern>
181191
</relocation>
182192
</relocations>
193+
<transformers combine.children="append">
194+
<!-- The service transformer is needed to merge META-INF/services files -->
195+
<transformer
196+
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
197+
<!-- The ApacheNoticeResourceTransformer collects and aggregates NOTICE files -->
198+
<transformer
199+
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
200+
<projectName>Apache Paimon Python-Java Bridge</projectName>
201+
<inceptionYear>${project.inceptionYear}</inceptionYear>
202+
<encoding>UTF-8</encoding>
203+
</transformer>
204+
</transformers>
183205
</configuration>
184206
</execution>
185207
</executions>
186208
</plugin>
209+
210+
<plugin>
211+
<groupId>org.apache.maven.plugins</groupId>
212+
<artifactId>maven-clean-plugin</artifactId>
213+
<configuration>
214+
<filesets>
215+
<fileset>
216+
<directory>${project.basedir}</directory>
217+
<includes>
218+
<include>dependency-reduced-pom.xml</include>
219+
</includes>
220+
</fileset>
221+
</filesets>
222+
</configuration>
223+
</plugin>
187224
</plugins>
188225
</build>
189226

227+
<pluginManagement>
228+
<plugins>
229+
<plugin>
230+
<groupId>org.codehaus.mojo</groupId>
231+
<artifactId>exec-maven-plugin</artifactId>
232+
<version>3.1.0</version>
233+
<inherited>false</inherited>
234+
<executions>
235+
<execution>
236+
<id>check-license</id>
237+
<!-- manually called -->
238+
<phase>none</phase>
239+
<goals>
240+
<goal>java</goal>
241+
</goals>
242+
</execution>
243+
</executions>
244+
<configuration>
245+
<mainClass>org.apache.paimon.tools.ci.licensecheck.LicenseChecker</mainClass>
246+
<includePluginDependencies>true</includePluginDependencies>
247+
<includeProjectDependencies>false</includeProjectDependencies>
248+
</configuration>
249+
<dependencies>
250+
<dependency>
251+
<groupId>org.apache.paimon</groupId>
252+
<artifactId>paimon-ci-tools</artifactId>
253+
<version>${project.version}</version>
254+
</dependency>
255+
</dependencies>
256+
</plugin>
257+
</plugins>
258+
</pluginManagement>
259+
190260
</project>
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+
<parent>
26+
<artifactId>paimon-parent</artifactId>
27+
<groupId>org.apache.paimon</groupId>
28+
<version>0.1-SNAPSHOT</version>
29+
<relativePath>../../..</relativePath>
30+
</parent>
31+
32+
<artifactId>paimon-ci-tools</artifactId>
33+
<name>Paimon : Tools : CI : Java</name>
34+
35+
<properties>
36+
<japicmp.skip>true</japicmp.skip>
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)