Correct way to use maven dependency scope for library maintainers

This page summarizes the projects mentioned and recommended in the original post on /r/javahelp

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • SSLContext-Kickstart

    🔐 A lightweight high level library for configuring a http client or server based on SSLContext or other properties such as TrustManager, KeyManager or Trusted Certificates to communicate over SSL TLS for one way authentication or two way authentication provided by the SSLFactory. Support for Java, Scala and Kotlin based clients with examples. Available client examples are: Apache HttpClient, OkHttp, Spring RestTemplate, Spring WebFlux WebClient Jetty and Netty, the old and the new JDK HttpClient

  • I also want to provide some context to make this question more clear. I created sslcontext-kickstart which is just a high-level library for configuring ssl for a server or client. The library has additional separate dependencies which the end-user can use to make it more easy to use for their use case. So the core library has only a dependency on slf4j-api. However there are separate libraries which contain mappers which I also created for apache4, apache5, netty and jetty which relay on the core library. Apache4, apache5, netty and jetty are currently a compile scoped dependency and therefor the end-user will also get the version which is specified in my pom. Let's assume someone is using the apache4 version. So should the end-user exclude the dependency manually when they are using my library and don't want the specific transitive apache4 dependency? Or should I mark apache4 as provided scope type. In that way there will be no transitive dependency, however the end-user should have the apache4 dependency present on their classpath or else they will get a runtime exception when they use my library.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts