【问题标题】:how to copy jar and zip files from target to other folder in same project using maven如何使用maven将jar和zip文件从目标复制到同一项目中的其他文件夹
【发布时间】:2019-04-05 13:53:18
【问题描述】:

在我将项目构建为目标中的 jar 和 zip 文件后,我想将它们复制到其他文件夹,比如说分发。 我在我的 pom 中使用以下插件配置:

<plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
                <execution>
                    <id>copy-resources</id>
                    <!-- here the phase you need -->
                    <phase>package</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>/distribution</outputDirectory>
                        <resources>
                            <resource>
                                <directory>${project.build.directory}</directory>
                                <filtering>true</filtering>
                                <include>*.jar</include>
                                <include>*.zip</include>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>

构建项目后,没有文件移动到分发文件夹。知道为什么吗?

【问题讨论】:

    标签: maven-3 maven-resources-plugin


    【解决方案1】:

    这解决了问题:

    <outputDirectory>${project.basedir}/distribution</outputDirectory>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-30
      • 1970-01-01
      • 2021-12-09
      相关资源
      最近更新 更多