强制Maven2将依赖项复制到目标/ lib [英] force Maven2 to copy dependencies into target/lib

查看:159
本文介绍了强制Maven2将依赖项复制到目标/ lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将我的项目的运行时依赖项复制到 target / lib 文件夹中?

How do I get my project's runtime dependencies copied into the target/lib folder?

正如现在,在 mvn clean install 后,目标文件夹只包含我项目的jar,但没有运行时依赖。

As it is right now, after mvn clean install the target folder contains only my project's jar, but none of the runtime dependencies.

推荐答案

>

This works for me:

<project>
  ...
  <profiles>
    <profile>
      <id>qa</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <phase>install</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/lib</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

这篇关于强制Maven2将依赖项复制到目标/ lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆