maven - 如何更改下载的 Maven 依赖项的位置?

标签 maven grails

运行时grails prod war target/my.war在 Grails 2.5.3 上,有没有办法将位置更改为下载 maven 依赖项的位置?

maven有一个可以在命令行设置的变量:-Dmaven.repo.local=/some/foo/bar/pathgrails prod war target/my.war 有类似的东西吗?命令?

我需要这个的原因是因为我在 Jenkins 上构建我的应用程序并且无权创建 /jslave/.m2/repository/org/grails文件夹。所以,我需要改变路径。

最佳答案

我相信您必须在 BuildConfig.groovy 中使用以下任一选项

grails.dependency.cache.dir = ".path/to/your/custom/repo"

或者你也可以使用
grails.project.dependency.resolution = {
    cacheDir "absolute/path/to/your/custom/repo"
}

引用 Where are the JARs? 有关上述和使用 Aether vs Ivy 的更多详细信息。

关于maven - 如何更改下载的 Maven 依赖项的位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43023007/

相关文章:

maven - 发生意外错误 : Micronaut Data method is missing compilation time query information

java - 父 pom.xml 的包装无效,必须为 "pom"但为 "ear"

java - IntelliJ - 将库的重构更改应用于消费者

java - Spring数据和Java泛型: How to combine multiple repository interfaces into one?

grails - GORM createCriteria 和 list 不返回相同的结果 : what can I do?

grails - Grails在运行时更新/渲染布局

java - Cobertura 仍然跟踪已删除的文件

grails - <g:select>中的Grails <g:if>

tomcat - 将应用程序升级到 Grails 2 后 JBoss 部署错误

grails - 如何在联接表包含标识类型的情况下表示多对多关系