So you could have scope=compile&optional=true (which means the dep is non-transitive)
On Wed 27 Dec 2017 at 00:26, Andy Feldman <an...@wealthfront.com> wrote: > On Dec 26, 2017 11:34, "Stephen Connolly" <stephen.alan.conno...@gmail.com > > > wrote: > > On Sun 24 Dec 2017 at 18:01, Andy Feldman <an...@wealthfront.com> wrote: > > > Assuming I have a dependency relationship of "my-project -> my-library -> > > upstream-library", with each dependency in compile scope, I know that > > my-project transitively picks up a compile scope dependency on > > upstream-library. Reading the documentation at > > > > https://maven.apache.org/guides/introduction/introduction-to-dependency- > mechanism.html > <https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html> > > I see a note about this transitive dependency: > > > > "(*) Note: it is intended that this should be runtime scope instead, so > > that all compile dependencies must be explicitly listed - however, there > is > > the case where the library you depend on extends a class from another > > library, forcing you to have available at compile time. For this reason, > > compile time dependencies remain as compile scope even when they are > > transitive." > > > > If I know that my-library does not have this issue, is there any way to > > declare the dependencies such that I can get the intended behavior? I > want > > upstream-library to be picked up as runtime scope for my-project, not as > > compile scope. > > > Declare it with scope “runtime”? > > > It needs to be compile scope in my-library since my-library uses classes > from upstream-library. I'd like to avoid declaring upstream-library at all > in my-project if possible, since my-project has nothing to do with > upstream-library. > > > > > > > > Thanks, > > -- > > Andy Feldman > > > -- > Sent from my phone > -- Sent from my phone