Skip to content

Commit

Permalink
[ci] Add java module license check
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzelin committed Nov 20, 2024
1 parent 42efa85 commit 9ac7363
Show file tree
Hide file tree
Showing 19 changed files with 2,212 additions and 16 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/check-licensing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF 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.

name: Check licensing

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
env:
MVN_COMMON_OPTIONS: -U -B --no-transfer-progress
MVN_BUILD_OUTPUT_FILE: "/tmp/mvn_build_output.out"
MVN_VALIDATION_DIR: "/tmp/paimon-validation-deployment"

steps:
- uses: actions/checkout@v2

- name: Set JDK
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'adopt'
- name: Build
run: |
set -o pipefail
cd paimon_python_java/paimon-python-java-bridge
mvn clean deploy ${{ env.MVN_COMMON_OPTIONS }} -DskipTests \
-DaltDeploymentRepository=validation_repository::default::file:${{ env.MVN_VALIDATION_DIR }} \
| tee ${{ env.MVN_BUILD_OUTPUT_FILE }}
cd tools/ci/paimon-ci-tools
mvn clean install -DskipTests
- name: Check licensing
run: |
cd paimon_python_java/paimon-python-java-bridge
mvn ${{ env.MVN_COMMON_OPTIONS }} exec:java@check-licensing -N \
-Dexec.args="${{ env.MVN_BUILD_OUTPUT_FILE }} $(pwd) ${{ env.MVN_VALIDATION_DIR }}" \
-Dlog4j.configurationFile=file://$(pwd)/tools/ci/log4j.properties
env:
MAVEN_OPTS: -Xmx4096m
83 changes: 67 additions & 16 deletions paimon_python_java/paimon-python-java-bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<name>Paimon : Python-Java Bridge</name>

<packaging>jar</packaging>
<inceptionYear>2024</inceptionYear>

<properties>
<paimon.version>0.9.0</paimon.version>
Expand Down Expand Up @@ -132,21 +133,21 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${target.java.version}</source>
<target>${target.java.version}</target>
<!-- The semantics of this option are reversed, see MCOMPILER-209. -->
<useIncrementalCompilation>false</useIncrementalCompilation>
<compilerArgs>
<!-- Prevents recompilation due to missing package-info.class, see MCOMPILER-205 -->
<arg>-Xpkginfo:always</arg>
<arg>-Xlint:deprecation</arg>
</compilerArgs>
</configuration>
</plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${target.java.version}</source>
<target>${target.java.version}</target>
<!-- The semantics of this option are reversed, see MCOMPILER-209. -->
<useIncrementalCompilation>false</useIncrementalCompilation>
<compilerArgs>
<!-- Prevents recompilation due to missing package-info.class, see MCOMPILER-205 -->
<arg>-Xpkginfo:always</arg>
<arg>-Xlint:deprecation</arg>
</compilerArgs>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -159,6 +160,9 @@
<goal>shade</goal>
</goals>
<configuration>
<shadeTestJar>false</shadeTestJar>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<artifactSet>
<includes combine.children="append">
<include>org.apache.paimon:paimon-bundle</include>
Expand All @@ -184,7 +188,54 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}</directory>
<includes>
<include>dependency-reduced-pom.xml</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<inherited>false</inherited>
<executions>
<execution>
<id>check-license</id>
<!-- manually called -->
<phase>none</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.apache.paimon.tools.ci.licensecheck.LicenseChecker</mainClass>
<includePluginDependencies>true</includePluginDependencies>
<includeProjectDependencies>false</includeProjectDependencies>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.paimon</groupId>
<artifactId>paimon-ci-tools</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
paimon-python-java-bridge
Copyright 2024 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

This project bundles the following dependencies under the under the MIT license
- org.slf4j:slf4j-api:1.7.32

This project bundles the following dependencies under the Apache Software License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt)
- org.apache.logging.log4j:log4j-1.2-api:2.17.1
- org.apache.arrow:arrow-vector:14.0.0
- org.apache.arrow:arrow-format:14.0.0
- org.apache.arrow:arrow-memory-core:14.0.0
- org.apache.arrow:arrow-memory-unsafe:14.0.0
- org.apache.arrow:arrow-c-data:14.0.0
- com.google.flatbuffers:flatbuffers-java:1.12.0

This project bundles the following dependencies under the 2-Clause BSD License
- net.sf.py4j:py4j:0.10.9.7

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF 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.
################################################################################

rootLogger.level = INFO
rootLogger.appenderRef.out.ref = ConsoleAppender

# -----------------------------------------------------------------------------
# Console (use 'console')
# -----------------------------------------------------------------------------

appender.console.name = ConsoleAppender
appender.console.type = CONSOLE
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{HH:mm:ss,SSS} [%20t] %-5p %-60c %x - %m%n

# -----------------------------------------------------------------------------
# File (use 'file')
# -----------------------------------------------------------------------------
appender.file.name = FileAppender
appender.file.type = FILE
appender.file.fileName = ${sys:log.dir}/mvn-${sys:mvn.forkNumber:-output}.log
appender.file.layout.type = PatternLayout
appender.file.layout.pattern = %d{HH:mm:ss,SSS} [%20t] %-5p %-60c %x - %m%n
appender.file.createOnDemand = true

# suppress the irrelevant (wrong) warnings from the netty channel handler
logger.netty.name = org.jboss.netty.channel.DefaultChannelPipeline
logger.netty.level = ERROR
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.paimon</groupId>
<artifactId>paimon-ci-tools</artifactId>
<version>0.1-SNAPSHOT</version>
<name>Paimon : Tools : CI : Java</name>

<packaging>jar</packaging>

<properties>
<japicmp.skip>true</japicmp.skip>
<paimon.shade.guava.version>30.1.1-jre</paimon.shade.guava.version>
<paimon.shade.version>0.6.0-incubating</paimon.shade.version>
<log4j.version>2.17.1</log4j.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.paimon</groupId>
<artifactId>paimon-shade-guava-30</artifactId>
<version>${paimon.shade.guava.version}-${paimon.shade.version}</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 9ac7363

Please sign in to comment.