【问题标题】:Maven plugin maven-antrun-plugin copy option does not overwriteMaven 插件 maven-antrun-plugin 复制选项不会覆盖
【发布时间】:2020-11-24 13:58:30
【问题描述】:

我对这个 maven 插件有疑问,我真的不知道如何解决它。 我正在尝试将一些资源复制到“${basedir}/../server/a/base-store”到“${basedir}/../resources/store/base_certificate_store_prod/base-store”

但是我在副本上使用“覆盖”。但是在“${basedir}/../server/a/base-store”下的最后一个文件被添加,并且之前的其他文件仍然存在。 我想替换那个洞“base-store”目录。

<profile>
    <id>PROD</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-prod-base-store</id>
                        <phase>compile</phase>
                        <configuration>
                            <target>
                                <copy todir="${basedir}/../server/a" overwrite="true">
                                    <fileset dir="${basedir}/../resources/store/base_certificate_store_prod" includes="**/*"/>
                                </copy>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</profile>

【问题讨论】:

    标签: maven maven-plugin maven-antrun-plugin


    【解决方案1】:

    只需先删除目录,再复制即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-16
      • 1970-01-01
      • 2019-07-14
      • 1970-01-01
      • 2016-10-02
      • 1970-01-01
      • 2012-07-19
      相关资源
      最近更新 更多