The Java Library Best Practices are a set of rules that we believe will minimize problems for consumers of interconnected Java libraries. These practices come from decades of aggregated experience in maintaining open source Java libraries and are informed by many hard-learned lessons from mistakes that have been made. We have found that following these rules will result in higher quality Java libraries with fewer dependency conflicts and other kinds of problems. The list is open-ended, so new ones may be added from time to time.
Note This list is currently in "Alpha," which means we are still figuring out the complete set of best practices to use. Best practices here could be removed or significantly changed before the set is classified as Beta.
-
Glossary: Terms used in the best practices and other places in cloud-opensource-java.
-
JLBP-1: Minimize dependencies
-
JLBP-2: Minimize API surface
-
JLBP-3: Use Semantic versioning
-
JLBP-4: Avoid dependencies on unstable libraries and features
-
JLBP-5: Avoid dependencies that overlap classes with other dependencies
-
JLBP-6: Package and artifact renaming rules
-
JLBP-7: Make breaking transitions easy
-
JLBP-8: Advance widely used functionality to a stable version
-
JLBP-9: Support the minimum Java version of your consumers
-
JLBP-10: Maintain API stability as long as needed for consumers
-
JLBP-11: Stay up to date with compatible dependencies
-
JLBP-12: Make level of support and API stability clear
-
JLBP-13: Quickly remove references to deprecated features in dependencies
-
JLBP-14: Do not use version ranges
-
JLBP-15: Produce a BOM for multi-module projects
-
JLBP-16: Ensure upper version alignment of dependencies for consumers
-
JLBP-17: Coordinate Rollout of Breaking Changes
-
JLBP-18: Only shade dependencies as a last resort