Ask Your Question
0

What is a pointer in C++?

asked 2022-06-13 11:00:00 +0000

qstack gravatar image

Can a transitive dependency in gradle be made exclusively for runtime purposes?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-19 19:00:00 +0000

qstack gravatar image

Yes, a transitive dependency in Gradle can be marked as "runtimeOnly" which means that the dependency will only be included at runtime and not during compile time. This allows you to reduce the size of your compiled JAR or WAR file according to your project's requirements.

For example, you can mark a dependency as runtimeOnly in your Gradle build script by adding the following code to the dependencies block:

dependencies {
   // compile time dependencies
   implementation 'com.sample:dependency1:1.0'

   // runtime dependencies
   runtimeOnly 'com.sample:dependency2:2.0'
}

In this example, "dependency1" will be included during both compile time and runtime, but "dependency2" will only be included at runtime.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-06-13 11:00:00 +0000

Seen: 16 times

Last updated: Jun 19 '22