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

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

问题描述

我试图构建一个Gradle JAR项目,它是另一个子项目,并希望输出JAR文件位于父目录(特定于父级或同级的lib目录中)。 在 build.gradle

,添加:

  libsDirName ='../../lib'

配置设置显示在 java plugin



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

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?

解决方案

In build.gradle, add:

libsDirName = '../../lib'

The config settings are shown in the official Gradle docs for the java plugin.

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天全站免登陆