等同于SBT的“提供” Gradle中fatjar的依赖关系? [英] Equivalent of SBT's "provided" dependency for fatjar in Gradle?

查看:138
本文介绍了等同于SBT的“提供” Gradle中fatjar的依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Scala的SBT,我可以指出编译所需的依赖项将在运行时环境中提供,如下所示:

  val catalina =org.apache.tomcat%tomcat-catalina%V.tomcat%provided

使用sbt-assembly构建fatjar时,会自动忽略以此方式标记的依赖项。



Gradle的等效功能是什么?

解决方案

目前,Gradle并未添加提供的配置-THE盒。然而,有几个插件增加了这​​个功能:





或者,您也可以自己为此配置建模。您可以在 Gradle论坛上找到许多相关示例。


Using Scala's SBT, I can indicate that a dependency required for compilation will be "provided" in the runtime environment like so:

val catalina = "org.apache.tomcat" % "tomcat-catalina" % V.tomcat % "provided"

A dependency marked as provided in this way will automatically be ignored when building a fatjar using sbt-assembly.

What is the equivalent functionality for Gradle?

解决方案

At the moment Gradle does not add a provided configuration out-of-the-box. However, there are a couple of plugins that add this functionality:

Alternatively, you can also model this configuration yourself. You will find many examples for this on the Gradle forum.

这篇关于等同于SBT的“提供” Gradle中fatjar的依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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