【问题标题】:How to copy provided Maven dependencies into a chosen directory?如何将提供的 Maven 依赖项复制到选定的目录中?
【发布时间】:2014-08-10 01:30:24
【问题描述】:

如何将所有提供的 Maven 依赖项复制到“provided-libs”目录中?

我正在研究this link,我发现有一种方法可以复制依赖项。但我只想将范围为“提供”的依赖项复制到“提供的库”中。

非常感谢!

【问题讨论】:

    标签: maven plugins scope dependencies


    【解决方案1】:

    尝试在plugin的配置中使用includeScope参数:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <executions>
            <execution>
                <id>copy-dependencies</id>
                <phase>package</phase>
                <goals>
                    <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                    <includeScope>provided</includeScope>
                    <outputDirectory>provided-libs</outputDirectory>                        
                </configuration>
            </execution>
        </executions>
    </plugin>
    

    【讨论】:

    • 好的,谢谢。我刚刚找到了这个解决方案。我正要避免这种解决方案,因为 m2e 不支持目标 copy-dependencies 的错误标记。但在这里我有我的解决方案:stackoverflow.com/questions/8706017/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-30
    • 1970-01-01
    • 1970-01-01
    • 2014-11-06
    相关资源
    最近更新 更多