Gradle:如何将 jar 位置配置为位于项目的父目录中? [英] Gradle: how do I configure the jar location to be in the parent directory of the project?

查看:26
本文介绍了Gradle:如何将 jar 位置配置为位于项目的父目录中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个 Gradle JAR 项目,该项目是另一个项目的子项目,并且希望输出 JAR 文件位于父目录中(具体位于父目录或兄弟目录的lib"目录中).我如何为此配置 Gradle 以及在哪里记录?

I'm trying to build a Gradle JAR project that is a subproject of another and would like the output JAR file to be in a parent directory (to be specific in the "lib" directory of the parent, or sibling). How do I configure Gradle for this and where is this documented?

推荐答案

build.gradle中,添加:

libsDirName = '../../lib'

配置设置显示在 java 插件的官方 Gradle 文档中.

顺便说一句,我完全同意 Peter 和 Hiery 给出的评论和答案背后的意图,但有时最简单的解决方案就是最好的解决方案.

BTW, I fully agree with the intent behind the comments and answers given by Peter and Hiery, but sometimes the simplest solution is the best one.

这篇关于Gradle:如何将 jar 位置配置为位于项目的父目录中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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