From 07296e3d1bed0a57c16a4904a7dbb1040373ad3c Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 16 Oct 2024 10:21:57 +0200 Subject: [PATCH] Document usage in a module descriptor Resolves #29. --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ea449e..e37a3c6 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ Library that provides the `@API` annotation that is used to annotate public type ## How to use it -The @API Guardian library is deployed to Maven Central. You can simply add it as a dependency: +The @API Guardian library is deployed to Maven Central. To avoid compile-time warnings, you need to declare it as a _transitive_ compile-time dependency. ### Apache Maven + ```xml org.apiguardian @@ -27,3 +28,11 @@ dependencies { compileOnlyApi("org.apiguardian:apiguardian-api:1.1.2") } ``` + +### Java Platform Module System + +```java +module org.example { + requires static transitive org.apiguardian.api; +} +```