You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> ⚠️ Due to [this bug](https://github.com/gradle/gradle/issues/21490#issuecomment-1458887481) in Gradle which may affect the plugin, it is recommented to add the following to your `settings.gradle(.kts)` file:
70
-
> ```
70
+
> ```kotlin
71
71
> includeBuild(".")
72
72
> ```
73
73
@@ -78,7 +78,7 @@ The plugin can be used in two ways:
2. As_ProjectPlugin_in `build.gradle(.kts)` files (sometimes easier to add to existing setups)
80
80
81
-
```
81
+
```kotlin
82
82
plugins {
83
83
id("org.gradlex.java-module-dependencies")
84
84
}
@@ -88,7 +88,7 @@ plugins {
88
88
89
89
Once the plugin is applied, dependencies are automatically determined based on the `requires` directives in your `module-info.java` files. For example:
module("module-a") // Module in directory, discovers 'src/*/java/module-info.java' files
@@ -123,7 +123,7 @@ javaModules { // use instead of 'include(...)'
123
123
directory("modules") { // Auto-include all Modules in subfolders of 'modules'
124
124
group ="org.example"// group for all Modules
125
125
plugin("java-library") // apply plugin to all Modules' subprojects
126
-
module("app") { ... } // individualise Module (only if needed)
126
+
module("app") { /**/ }// individualise Module (only if needed)
127
127
128
128
// To optimze Configuration Cache hits:
129
129
exclusions.add("_.*") // do not inspect certain folders (regex)
@@ -137,7 +137,7 @@ javaModules { // use instead of 'include(...)'
137
137
If you need more control over the properties of a Gradle subproject, in particular to define a nested project path,
138
138
you can still use Gradle's `include(...)` and then register the subproject with this plugin.
139
139
140
-
```
140
+
```kotlin
141
141
include(":project:with:custom:path")
142
142
javaModules {
143
143
module(project(":project:with:custom:path")) {
@@ -161,7 +161,7 @@ With this plugin you move dependency definitions into `module-info.java` files a
161
161
However, there are certain dependency "scopes" not supported by the `module-info.java` syntax.
162
162
For this, the plugin offers an extension of Gradle's DSL to be used in `build.gradle(.kts)` files.
163
163
164
-
```
164
+
```kotlin
165
165
mainModuleInfo {
166
166
runtimeOnly("org.slf4j.simple") // runtime only dependency for the 'main' module
167
167
annotationProcessor("dagger.compiler") // annotation processor dependency for the 'main' module
@@ -173,7 +173,7 @@ For modules in other source sets, there are corresponding blocks to define depen
173
173
In case a source set does **not** contain a `module-info.java`, all dependencies can be defined in the `build.gradle(.kts)` files.
174
174
The only case where this should be used is for whitebox testing activated via the [org.gradlex.java-module-testing](https://github.com/gradlex-org/java-module-testing) plugin.
@@ -234,7 +234,7 @@ For that you can combine the `java-platform` with the `org.gradlex.java-module-v
234
234
In that block, you have the `version("module.name", "1.0")` notation to define a version by Module Name instead of coordinates.
235
235
For libraries that consist of multiple components and have a BOM for version management, you might prefer to include the BOM, which you need to do by coordinates, because a BOM does not have a Module Name.
236
236
237
-
```
237
+
```kotlin
238
238
plugins {
239
239
id("java-platform")
240
240
id("org.gradlex.java-module-versions")
@@ -258,7 +258,7 @@ dependencies {
258
258
Note: If you need to declare additional dependencies without version, or want to use Gradle's rich versions, you can also use the `ga()` shortcut to map a Module Name to the corresponding GA coordinates.
259
259
For example:
260
260
261
-
```
261
+
```kotlin
262
262
dependencies {
263
263
javaModuleDependencies {
264
264
testRuntimeOnly(ga("org.junit.jupiter.engine"))
@@ -273,7 +273,7 @@ Alternatively, versions can be defined in the `[version]` block of a [version ca
0 commit comments