zoukankan      html  css  js  c++  java
  • maven 打包排除配置文件

    如果你想通过pom.xml文件的配置实现的话,你可以这样
    1、打jar包时过滤配置文件
    <build>
    <!-- 过滤配置文件 -->
    <resources>
    <resource>
    <directory>src/main/resources</directory>
    <excludes>
    <exclude>**/*</exclude>
    </excludes>
    <filtering>true</filtering>
    </resource>
    </resources>
                   <plugins>
                        ..............
                    </plugins>
    <build>

    2、在plugins中添加插件
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
            <execution>
                <id>copy-resources</id>
                <phase>package</phase>
                <goals>
                    <goal>copy-resources</goal>
                </goals>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <outputDirectory>
                                                    ${project.build.directory}
                                             </outputDirectory>   <!-- 表示把配置文件拷到和jar包同一个路径下 -->
                    <resources>
                        <resource>
                            <directory>src/main/resources/</directory>
                        </resource>
                    </resources>
                </configuration>
            </execution>
        </executions>
    </plugin>

  • 相关阅读:
    用__new__ 创建单例模式
    函数的列表作为默认参数
    循环闭包函数打印列表
    斐波那契函数和回调函数
    类的共享属性
    字典和format用法
    python 面试大全: 01_类变量在内部是作为字典处理的
    git 学习删除某次提交
    mysql调优
    re模块
  • 原文地址:https://www.cnblogs.com/developer-ios/p/10083183.html
Copyright © 2011-2022 走看看