最近在spark streaming本地调试的时候,引入了一些资源文件,打包的时候需要给排除掉。所以就考虑使用maven的方式

详细参考官方文档:https://maven.apache.org/plugins/maven-jar-plugin/examples/include-exclude.html

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <excludes>
                        <exclude>core-site.xml</exclude>
                        <exclude>hdfs-site.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>

排除某个目录

<project>
  ...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <includes>
            <include>**/service/*</include>
          </includes>
        </configuration>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

我的博客即将搬运同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-07-06
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-30
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
相关资源
相似解决方案