Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why and/or when to avoid intransitive() or notTransitive()?

Tags:

sbt

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?).

like image 811
lloydmeta Avatar asked Oct 02 '14 01:10

lloydmeta


People also ask

What is the rule for transitive and intransitive verb?

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.

Why do we need to know if a verb is transitive or intransitive?

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.

How do you tell if a sentence is transitive or intransitive?

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.

Do I need transitive or intransitive?

"Have" and all forms of the verb "to have" are transitive verbs.


2 Answers

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()".

like image 64
lmm Avatar answered Oct 21 '22 23:10

lmm


intransitive is discouraged because :

  • downstream users don't see it in their POM and it might break their runtime,
  • even if they know what dependency to add, its version won't be synced with upstream.

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

like image 43
mauhiz Avatar answered Oct 21 '22 23:10

mauhiz