You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2022/09/15 14:53:20 UTC

[flink-connector-elasticsearch] 02/02: [FLINK-29310][ci] Check licensing

This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-connector-elasticsearch.git

commit 1fbdeacb1a31f33a6e532562339d3967e7d0cf4b
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Wed Sep 14 15:10:13 2022 +0200

    [FLINK-29310][ci] Check licensing
---
 .github/workflows/ci.yml | 16 +++++++++++++++-
 pom.xml                  | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0374c86..bfcfa3e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,8 +26,11 @@ jobs:
         jdk: [8, 11]
     timeout-minutes: 30
     env:
+      MVN_COMMON_OPTIONS: -U -B --no-transfer-progress
       MVN_CONNECTION_OPTIONS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
       FLINK_URL: https://s3.amazonaws.com/flink-nightly/flink-1.16-SNAPSHOT-bin-scala_2.12.tgz
+      MVN_BUILD_OUTPUT_FILE: "/tmp/mvn_build_output.out"
+      MVN_VALIDATION_DIR: "/tmp/flink-validation-deployment"
     steps:
       - run: echo "Running CI pipeline for JDK version ${{ matrix.jdk }}"
 
@@ -53,9 +56,20 @@ jobs:
       - name: Compile and test flink-connector-elasticsearch
         timeout-minutes: 20
         run: |          
-          mvn clean install -U -B --no-transfer-progress \
+          set -o pipefail
+
+          mvn clean deploy ${MVN_COMMON_OPTIONS} \
+            -DaltDeploymentRepository=validation_repository::default::file:${{ env.MVN_VALIDATION_DIR }} \
             -Dscala-2.12 \
             -Prun-end-to-end-tests -DdistDir=$(pwd)/../flink-1.16-SNAPSHOT \
             -Dflink.convergence.phase=install -Pcheck-convergence \
             ${{ env.MVN_CONNECTION_OPTIONS }} \
+            -Dlog4j.configurationFile=file://$(pwd)/tools/ci/log4j.properties \
+            | tee ${{ env.MVN_BUILD_OUTPUT_FILE }}
+
+      - name: Check licensing
+        run: |
+          mvn ${MVN_COMMON_OPTIONS} exec:java@check-licensing -N \
+            -Dexec.args="${{ env.MVN_BUILD_OUTPUT_FILE }} $(pwd) ${{ env.MVN_VALIDATION_DIR }}" \
+            ${{ env.MVN_CONNECTION_OPTIONS }} \
             -Dlog4j.configurationFile=file://$(pwd)/tools/ci/log4j.properties
diff --git a/pom.xml b/pom.xml
index 4e1feed..8ab5f87 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,6 +51,15 @@ under the License.
 		</developerConnection>
 	</scm>
 
+	<pluginRepositories>
+		<pluginRepository>
+			<!-- Allows exec-maven-plugin to resolve snapshot plugin dependencies -->
+			<id>apache.snapshots.https</id>
+			<name>${distMgmtSnapshotsName}</name>
+			<url>${distMgmtSnapshotsUrl}</url>
+		</pluginRepository>
+	</pluginRepositories>
+
 	<modules>
 		<module>flink-connector-elasticsearch-base</module>
 		<module>flink-connector-elasticsearch6</module>
@@ -753,6 +762,35 @@ under the License.
 				<extensions>true</extensions>
 			</plugin>
 
+			<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.flink.tools.ci.licensecheck.LicenseChecker</mainClass>
+					<includePluginDependencies>true</includePluginDependencies>
+					<includeProjectDependencies>false</includeProjectDependencies>
+				</configuration>
+				<dependencies>
+					<dependency>
+						<groupId>org.apache.flink</groupId>
+						<artifactId>flink-ci-tools</artifactId>
+						<version>1.16-SNAPSHOT</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-jar-plugin</artifactId>