gpt4 book ai didi

maven - Mavens的Gradle等效项Maven依赖插件

转载 作者:行者123 更新时间:2023-12-03 03:30:46 25 4
gpt4 key购买 nike

我正在从Maven迁移到Gradle,
在我的Maven代码中,我使用了“maven-dependency-plugin”
我找不到以下内容的简单翻译:
所以我的问题是如何使我的依赖关系进入特定的结构?

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.group1</groupId>
<artifactId>artifact1</artifactId>
<version>1</version>
<type>swf</type>
<outputDirectory>/flex/output1</outputDirectory>
<destFileName>artifact1.swf</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.group2</groupId>
<artifactId>artifact2</artifactId>
<version>2</version>
<type>swf</type>
<outputDirectory>/flex/output2</outputDirectory>
<destFileName>artifact2.swf</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.group3</groupId>
<artifactId>artifact3</artifactId>
<version>3</version>
<type>swf</type>
<outputDirectory>/flex/output3</outputDirectory>
<destFileName>artifact3.swf</destFileName>
</artifactItem>
</artifactItems>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>

最佳答案

因此在Gradle中找不到等效项,我最终所做的是持有 Artifact ID到新名称的映射(outputDirectory + destFileName),并将依赖项解析为新的特殊配置后,我将其称为“Flex”,然后将所有依赖项从“flex”使用映射。

关于maven - Mavens的Gradle等效项Maven依赖插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37456871/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com