You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by sj...@apache.org on 2021/11/16 21:40:22 UTC

[flink] 11/11: [FLINK-24833][examples] Prevent use of deprecated APIs in flink-examples

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

sjwiesman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit ef5fb7a15cb3964d0d59434798549bfa26adabe9
Author: sjwiesman <sj...@gmail.com>
AuthorDate: Mon Nov 15 15:20:15 2021 -0600

    [FLINK-24833][examples] Prevent use of deprecated APIs in flink-examples
    
    This closes #17802
---
 flink-examples/flink-examples-batch/pom.xml     | 23 +++++++++++++++++++++++
 flink-examples/flink-examples-streaming/pom.xml | 25 ++++++++++++++++++++++++-
 flink-examples/flink-examples-table/pom.xml     | 23 +++++++++++++++++++++++
 3 files changed, 70 insertions(+), 1 deletion(-)

diff --git a/flink-examples/flink-examples-batch/pom.xml b/flink-examples/flink-examples-batch/pom.xml
index 0786971..6ead88d 100644
--- a/flink-examples/flink-examples-batch/pom.xml
+++ b/flink-examples/flink-examples-batch/pom.xml
@@ -55,6 +55,24 @@ under the License.
 	
 	<build>
 		<plugins>
+			<!-- Fail compilation on deprecation warnings to prevent from showing users outdated examples. -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>compile</id>
+						<phase>process-sources</phase>
+						<goals>
+							<goal>compile</goal>
+						</goals>
+						<configuration>
+							<compilerArgument>-Xlint:deprecation</compilerArgument>
+							<failOnWarning>true</failOnWarning>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
 
 			<!-- Scala Compiler -->
 			<plugin>
@@ -69,6 +87,11 @@ under the License.
 						<goals>
 							<goal>compile</goal>
 						</goals>
+						<configuration>
+							<args>
+								<arg>-Xfatal-warnings</arg>
+							</args>
+						</configuration>
 					</execution>
 				</executions>
 				<configuration>
diff --git a/flink-examples/flink-examples-streaming/pom.xml b/flink-examples/flink-examples-streaming/pom.xml
index 705f063..0e5853e 100644
--- a/flink-examples/flink-examples-streaming/pom.xml
+++ b/flink-examples/flink-examples-streaming/pom.xml
@@ -130,6 +130,24 @@ under the License.
 
 	<build>
 		<plugins>
+			<!-- Fail compilation on deprecation warnings to prevent from showing users outdated examples. -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>compile</id>
+						<phase>process-sources</phase>
+						<goals>
+							<goal>compile</goal>
+						</goals>
+						<configuration>
+							<compilerArgument>-Xlint:deprecation</compilerArgument>
+							<failOnWarning>true</failOnWarning>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
 
 			<!-- Scala Code Style, most of the configuration done via plugin management -->
 			<plugin>
@@ -139,7 +157,7 @@ under the License.
 					<configLocation>${project.basedir}/../../tools/maven/scalastyle-config.xml</configLocation>
 				</configuration>
 			</plugin>
-			
+
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-dependency-plugin</artifactId>
@@ -413,6 +431,11 @@ under the License.
 						<goals>
 							<goal>compile</goal>
 						</goals>
+						<configuration>
+							<args>
+								<arg>-Xfatal-warnings</arg>
+							</args>
+						</configuration>
 					</execution>
  
 					<!-- Run scala compiler in the process-test-resources phase, so that dependencies on
diff --git a/flink-examples/flink-examples-table/pom.xml b/flink-examples/flink-examples-table/pom.xml
index 09efc3a..4427851 100644
--- a/flink-examples/flink-examples-table/pom.xml
+++ b/flink-examples/flink-examples-table/pom.xml
@@ -82,6 +82,24 @@ under the License.
 
 	<build>
 		<plugins>
+			<!-- Fail compilation on deprecation warnings to prevent from showing users outdated examples. -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>compile</id>
+						<phase>process-sources</phase>
+						<goals>
+							<goal>compile</goal>
+						</goals>
+						<configuration>
+							<compilerArgument>-Xlint:deprecation</compilerArgument>
+							<failOnWarning>true</failOnWarning>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
 			<plugin>
 				<groupId>net.alchim31.maven</groupId>
 				<artifactId>scala-maven-plugin</artifactId>
@@ -93,6 +111,11 @@ under the License.
 							<goal>add-source</goal>
 							<goal>compile</goal>
 						</goals>
+						<configuration>
+							<args>
+								<arg>-Xfatal-warnings</arg>
+							</args>
+						</configuration>
 					</execution>
 					<execution>
 						<id>scala-test-compile</id>