This is an automated email from the ASF dual-hosted git repository. huweihua pushed a commit to branch release-1.18 in repository https://gitbox.apache.org/repos/asf/flink.git
commit e21e3629bccaf90081af17ff6a7ccc9b8557a8d6 Author: Zhanghao Chen <[email protected]> AuthorDate: Mon Aug 14 19:36:31 2023 +0800 [FLINK-32821][examples] Include flink-connector-datagen for streaming examples (cherry picked from commit 79f7bdbe6be973623e418a771588533bdef321b6) --- .../flink-examples-streaming-state-machine/pom.xml | 3 +- flink-examples/flink-examples-streaming/pom.xml | 176 ++++++++++++--------- 2 files changed, 99 insertions(+), 80 deletions(-) diff --git a/flink-examples/flink-examples-build-helper/flink-examples-streaming-state-machine/pom.xml b/flink-examples/flink-examples-build-helper/flink-examples-streaming-state-machine/pom.xml index e6012682f02..1de78638c7f 100644 --- a/flink-examples/flink-examples-build-helper/flink-examples-streaming-state-machine/pom.xml +++ b/flink-examples/flink-examples-build-helper/flink-examples-streaming-state-machine/pom.xml @@ -71,7 +71,8 @@ under the License. </transformers> <artifactSet> <includes> - <include>org.apache.flink:flink-connector-kafka</include> + <include>org.apache.flink:flink-connector-datagen</include> + <include>org.apache.flink:flink-connector-kafka</include> <include>org.apache.flink:flink-examples-streaming</include> <include>org.apache.kafka:*</include> </includes> diff --git a/flink-examples/flink-examples-streaming/pom.xml b/flink-examples/flink-examples-streaming/pom.xml index e225742ae62..5d1df3de279 100644 --- a/flink-examples/flink-examples-streaming/pom.xml +++ b/flink-examples/flink-examples-streaming/pom.xml @@ -70,8 +70,6 @@ under the License. <groupId>org.apache.flink</groupId> <artifactId>flink-connector-datagen</artifactId> <version>${project.version}</version> - <!-- required by the shade plugin --> - <optional>${flink.markBundledAsOptional}</optional> </dependency> <dependency> @@ -158,30 +156,6 @@ under the License. <goal>test-jar</goal> </goals> </execution> - - <!-- Iteration --> - <execution> - <id>Iteration</id> - <phase>package</phase> - <goals> - <goal>jar</goal> - </goals> - <configuration> - <classifier>Iteration</classifier> - - <archive> - <manifestEntries> - <program-class>org.apache.flink.streaming.examples.iteration.IterateExample</program-class> - </manifestEntries> - </archive> - - <includes> - <include>org/apache/flink/streaming/examples/iteration/*.class</include> - <include>META-INF/LICENSE</include> - <include>META-INF/NOTICE</include> - </includes> - </configuration> - </execution> <!-- WindowJoin --> <execution> @@ -284,109 +258,156 @@ under the License. </configuration> </execution> - <!-- TopSpeedWindowing --> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <configuration> + <createDependencyReducedPom>false</createDependencyReducedPom> + </configuration> + <executions> + <!-- MatrixVectorMul --> <execution> - <id>TopSpeedWindowing</id> + <id>MatrixVectorMul</id> <phase>package</phase> <goals> - <goal>jar</goal> + <goal>shade</goal> </goals> <configuration> - <classifier>TopSpeedWindowing</classifier> - - <archive> - <manifestEntries> - <program-class>org.apache.flink.streaming.examples.windowing.TopSpeedWindowing</program-class> - </manifestEntries> - </archive> - - <includes> - <include>org/apache/flink/streaming/examples/windowing/TopSpeedWindowing.class</include> - <include>org/apache/flink/streaming/examples/windowing/TopSpeedWindowing$*.class</include> - <include>org/apache/flink/streaming/examples/windowing/util/CarSource.class</include> - <include>org/apache/flink/streaming/examples/wordcount/util/CLI.class</include> - <include>META-INF/LICENSE</include> - <include>META-INF/NOTICE</include> - </includes> + <shadeTestJar>false</shadeTestJar> + <finalName>MatrixVectorMul</finalName> + <artifactSet> + <includes> + <include>org.apache.flink:flink-connector-datagen</include> + <include>org.jcuda:*</include> + </includes> + </artifactSet> + <filters> + <filter> + <artifact>org.apache.flink:*</artifact> + <includes> + <include>org/apache/flink/connector/datagen/**</include> + <include>org/apache/flink/streaming/examples/gpu/MatrixVectorMul.class</include> + <include>org/apache/flink/streaming/examples/gpu/MatrixVectorMul$*.class</include> + </includes> + </filter> + </filters> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <mainClass>org.apache.flink.streaming.examples.gpu.MatrixVectorMul</mainClass> + </transformer> + </transformers> </configuration> </execution> - <!-- SessionWindowing --> + <!-- Iteration --> <execution> - <id>SessionWindowing</id> + <id>Iteration</id> <phase>package</phase> <goals> - <goal>jar</goal> + <goal>shade</goal> </goals> <configuration> - <classifier>SessionWindowing</classifier> - - <archive> - <manifestEntries> - <program-class>org.apache.flink.streaming.examples.windowing.SessionWindowing</program-class> - </manifestEntries> - </archive> - - <includes> - <include>org/apache/flink/streaming/examples/windowing/SessionWindowing.class</include> - <include>org/apache/flink/streaming/examples/windowing/SessionWindowing$*.class</include> - <include>META-INF/LICENSE</include> - <include>META-INF/NOTICE</include> - </includes> + <shadeTestJar>false</shadeTestJar> + <finalName>Iteration</finalName> + <artifactSet> + <includes> + <include>org.apache.flink:flink-connector-datagen</include> + </includes> + </artifactSet> + <filters> + <filter> + <artifact>org.apache.flink:*</artifact> + <includes> + <include>org/apache/flink/connector/datagen/**</include> + <include>org/apache/flink/streaming/examples/iteration/*.class</include> + <include>META-INF/LICENSE</include> + <include>META-INF/NOTICE</include> + </includes> + </filter> + </filters> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <mainClass>org.apache.flink.streaming.examples.iteration.IterateExample</mainClass> + </transformer> + </transformers> </configuration> </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - <!-- DataGeneratorSource is used across the streaming examples and is bundled to make examples self-contained --> + <!-- TopSpeedWindowing --> <execution> + <id>TopSpeedWindowing</id> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> + <shadeTestJar>false</shadeTestJar> + <finalName>TopSpeedWindowing</finalName> <artifactSet> <includes> <include>org.apache.flink:flink-connector-datagen</include> </includes> </artifactSet> + <filters> + <filter> + <artifact>org.apache.flink:*</artifact> + <includes> + <include>org/apache/flink/connector/datagen/**</include> + <include>org/apache/flink/streaming/examples/windowing/TopSpeedWindowing.class</include> + <include>org/apache/flink/streaming/examples/windowing/TopSpeedWindowing$*.class</include> + <include>org/apache/flink/streaming/examples/windowing/util/CarGeneratorFunction.class</include> + <include>org/apache/flink/streaming/examples/wordcount/util/CLI.class</include> + <include>META-INF/LICENSE</include> + <include>META-INF/NOTICE</include> + </includes> + </filter> + </filters> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <mainClass>org.apache.flink.streaming.examples.windowing.TopSpeedWindowing</mainClass> + </transformer> + </transformers> </configuration> </execution> + + <!-- SessionWindowing --> <execution> - <id>MatrixVectorMul</id> + <id>SessionWindowing</id> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <shadeTestJar>false</shadeTestJar> - <finalName>MatrixVectorMul</finalName> + <finalName>SessionWindowing</finalName> <artifactSet> <includes> - <include>org.jcuda:*</include> + <include>org.apache.flink:flink-connector-datagen</include> </includes> </artifactSet> <filters> <filter> <artifact>org.apache.flink:*</artifact> <includes> - <include>org/apache/flink/streaming/examples/gpu/MatrixVectorMul.class</include> - <include>org/apache/flink/streaming/examples/gpu/MatrixVectorMul$*.class</include> + <include>org/apache/flink/connector/datagen/**</include> + <include>org/apache/flink/streaming/examples/windowing/SessionWindowing.class</include> + <include>org/apache/flink/streaming/examples/windowing/SessionWindowing$*.class</include> + <include>META-INF/LICENSE</include> + <include>META-INF/NOTICE</include> </includes> </filter> </filters> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> - <mainClass>org.apache.flink.streaming.examples.gpu.MatrixVectorMul</mainClass> + <mainClass>org.apache.flink.streaming.examples.windowing.SessionWindowing</mainClass> </transformer> </transformers> </configuration> </execution> + </executions> </plugin> @@ -399,9 +420,6 @@ under the License. <id>rename</id> <configuration> <target> - <copy file="${project.basedir}/target/flink-examples-streaming-${project.version}-Iteration.jar" tofile="${project.basedir}/target/Iteration.jar" /> - <copy file="${project.basedir}/target/flink-examples-streaming-${project.version}-SessionWindowing.jar" tofile="${project.basedir}/target/SessionWindowing.jar" /> - <copy file="${project.basedir}/target/flink-examples-streaming-${project.version}-TopSpeedWindowing.jar" tofile="${project.basedir}/target/TopSpeedWindowing.jar" /> <copy file="${project.basedir}/target/flink-examples-streaming-${project.version}-WindowJoin.jar" tofile="${project.basedir}/target/WindowJoin.jar" /> <copy file="${project.basedir}/target/flink-examples-streaming-${project.version}-WordCount.jar" tofile="${project.basedir}/target/WordCount.jar" /> <copy file="${project.basedir}/target/flink-examples-streaming-${project.version}-SocketWindowWordCount.jar" tofile="${project.basedir}/target/SocketWindowWordCount.jar" />
