I currently have an SBT subproject that needs a dependency only at compile-time, so I think it's a good place to use intransitive
so that projects that use it won't need to download that dependency.
However, according to the SBT reference manual:
In some instances, you may find that the dependencies listed for a project aren’t necessary for it to build. Projects using the Felix OSGI framework, for instance, only explicitly require its main jar to compile and run. Avoid fetching artifact dependencies with either intransitive() or notTransitive()
The wording is a bit confusing because it discourages the use of transitive()
or notTransitive()
without explaining why or when (all the time?).
A verb can be described as transitive or intransitive based on whether it requires an object to express a complete thought or not. A transitive verb is one that only makes sense if it exerts its action on an object. An intransitive verb will make sense without one. Some verbs may be used both ways.
The major difference between transitive and intransitive verbs is that a sentence with a transitive verb can be changed into passive voice and a sentence with an intransitive verb cannot be changed into passive voice.
The main difference between a transitive verb and an intransitive verb is that transitive verbs always require or demand an object to make complete sense, whereas intransitive verbs do not need any object to construct a complete sentence.
"Have" and all forms of the verb "to have" are transitive verbs.
I think you're just misreading the sentence. "Avoid fetching artifact dependencies with either intransitive() or notTransitive()" is intended to mean "If you want to avoid fetching artifact dependencies, the way to do this is with either intransitive() or notTransitive()".
intransitive
is discouraged because :
provided
is reserved for when the dependency is expected to be in the runtime, e.g. an application container.
I would reserve intransitive
for cases where the dependency is not needed in the runtime, only at compile-time. e.g. compiler annotations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With