问题描述
使用Scala的SBT,我可以指出编译所需的依赖项将在运行时环境中提供,如下所示: val catalina =org.apache.tomcat%tomcat-catalina%V.tomcat%provided
使用sbt-assembly构建fatjar时,会自动忽略以此方式标记的依赖项。
Gradle的等效功能是什么?
目前,Gradle并未添加提供的
配置-THE盒。然而,有几个插件增加了这个功能:
或者,您也可以自己为此配置建模。您可以在上找到许多相关示例。
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的依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!