gpt4 book ai didi

gradle - mavenLocal()功能的替代品

转载 作者:行者123 更新时间:2023-12-03 05:10:03 27 4
gpt4 key购买 nike

mavenLocal()目前可以通过在本地m2中搜索我的开发版本来满足我的需求。

还有其他方法可以告诉gradle在不更改build.gradle或其他源代码文件的情况下搜索本地m2吗?

最佳答案

您可以使用初始化脚本。

There are several ways to use an init script:

Specify a file on the command line. The command line option is -I or --init-script followed by the path to the script. The command line option can appear more than once, each time adding another init script.

Put a file called init.gradle in the USER_HOME/.gradle/ directory.

Put a file that ends with .gradle in the USER_HOME/.gradle/init.d/ directory.

Put a file that ends with .gradle in the GRADLE_HOME/init.d/ directory, in the Gradle distribution. This allows you to package up a custom Gradle distribution containing some custom build logic and plugins. You can combine this with the Gradle wrapper as a way to make custom logic available to all builds in your enterprise.



初始化脚本示例
initscript {
repositories {
mavenLocal()
}
}

有关详细信息,请查看 docs

关于gradle - mavenLocal()功能的替代品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49311885/

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