美文网首页
maven 拷贝指定目录资源到指定位置

maven 拷贝指定目录资源到指定位置

作者: 赛亚人之神 | 来源:发表于2018-02-27 08:32 被阅读586次
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.3</version>
        <configuration>
            <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
        <executions>
            <execution>
                <id>copy-spring-boot-resources</id>
                <!-- here the phase you need -->
                <phase>validate</phase>
                <goals>
                    <goal>copy-resources</goal>
                </goals>
                <configuration>
                    <encoding>utf-8</encoding>
                    <outputDirectory>${basedir}/src/main/resources</outputDirectory>
                    <resources>
                        <resource>
                            <directory>${basedir}/src/main/resources/META-INF</directory>
                            <includes>
                                <include>hanlp.properties</include>
                            </includes>
                            <filtering>true</filtering>
                        </resource>
                    </resources>
                </configuration>
            </execution>
        </executions>
    </plugin>
    
    将 src/main/resources/META-INF 下的 hanlp.properties 文件拷贝到编译后的 classes 下

    相关文章

      网友评论

          本文标题:maven 拷贝指定目录资源到指定位置

          本文链接:https://www.haomeiwen.com/subject/svcpxftx.html