FLink程序:打包

小白记录编写flink程序的maven工程打包过程
mvn clean compile
mvn clean package
mvn clean install

注意因为创建的工程中不止一个主方法,需要指定主方法,在pom.xml指定,在对应plugin配置加这一段话,在贴吧找的,具体哪一篇忘记了,额,应该不会被举发,具体意义,emmmmm,whatever

 

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>3.0.0</version>
    <executions>
     <!-- Run shade goal on package phase -->
     <execution>
      <phase>package</phase>
      <goals>
       <goal>shade</goal>
      </goals>
      <configuration>
       <artifactSet>
        <excludes>
         <exclude>org.apache.flink:force-shading</exclude>
         <exclude>com.google.code.findbugs:jsr305</exclude>
         <exclude>org.slf4j:*</exclude>
         <exclude>log4j:*</exclude>
        </excludes>
       </artifactSet>
       <filters>
        <filter>
         <!-- Do not copy the signatures in the META-INF folder.
         Otherwise, this might cause SecurityExceptions when using the JAR. -->
         <artifact>*:*</artifact>
         <excludes>
          <exclude>META-INF/*.SF</exclude>
          <exclude>META-INF/*.DSA</exclude>
          <exclude>META-INF/*.RSA</exclude>
         </excludes>
        </filter>
       </filters>
       <transformers>
        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
         <mainClass>org.lv.StreamingJob</mainClass>
        </transformer>
       </transformers>
      </configuration>
     </execution>
    </executions>
   </plugin>



版权声明:本文为i_monster原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。