Skip to content

Commit 8c8845c

Browse files
authored
Remove obsolete space (#184)
1 parent 573a5ba commit 8c8845c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ It is recommended to use a [convention plugin](https://docs.gradle.org/current/s
5050
Add this to the build file of your convention plugin's build
5151
(e.g. `gradle/plugins/build.gradle(.kts)` or `buildSrc/build.gradle(.kts)`).
5252

53-
```
53+
```kotlin
5454
dependencies {
5555
implementation("org.gradlex:extra-java-module-info:1.12")
5656
}
@@ -59,7 +59,7 @@ dependencies {
5959
## Defining extra module information
6060
In your convention plugin, apply the plugin and define the additional module info:
6161

62-
```
62+
```kotlin
6363
plugins {
6464
...
6565
id("org.gradlex.extra-java-module-info")
@@ -112,7 +112,7 @@ extraJavaModuleInfo {
112112
Now dependencies defined in your build files are all treated as modules if enough extra information was provided.
113113
For example:
114114

115-
```
115+
```kotlin
116116
dependencies {
117117
implementation("com.google.code.gson:gson:2.8.6") // real module
118118
implementation("net.bytebuddy:byte-buddy:1.10.9") // real module with multi-release jar
@@ -157,7 +157,7 @@ The plugin will automatically retrofit all the available `META-INF/services/*` d
157157

158158
The plugin also allows you to ignore some unwanted services from being automatically converted into `provides .. with ...` declarations.
159159

160-
```
160+
```kotlin
161161
extraJavaModuleInfo {
162162
module("groovy-all-2.4.15.jar", "groovy.all", "2.4.15") {
163163
requiresTransitive("java.scripting")
@@ -172,7 +172,7 @@ extraJavaModuleInfo {
172172

173173
You can also be more granular and ignore specific implementations while leaving the remaining active.
174174

175-
```
175+
```kotlin
176176
extraJavaModuleInfo {
177177
module("org.liquibase:liquibase-core", "liquibase.core") {
178178
...
@@ -191,7 +191,7 @@ Only if you use _real_ modules (Jars with `module-info.class`) everywhere you ca
191191
Still, using automatic modules is more convenient if you need to work with a lot of legacy libraries, because you do not need to define `exports` and `requires` directives.
192192
Alternatively though, this plugin offers a way to define a _real_ module, without defining all of those directives explicitly:
193193

194-
```
194+
```kotlin
195195
extraJavaModuleInfo {
196196
module("org.apache.httpcomponents:httpclient", "org.apache.httpcomponents.httpclient") {
197197
exportAllPackages() // Adds an `exports` for each package found in the Jar
@@ -213,7 +213,7 @@ You see the same dependency many times in the _External Libraries_ list and Inte
213213
To circumvent this, you need to construct a common classpath – as a _resolvable configuration_ – that the transform can use.
214214
This needs to be done in all subprojects. You use the `versionsProvidingConfiguration` to tell the plugin about the commons classpath.
215215

216-
```
216+
```kotlin
217217
extraJavaModuleInfo {
218218
versionsProvidingConfiguration = "mainRuntimeClasspath"
219219
}
@@ -223,7 +223,7 @@ To create such a common classpath, some setup work is needed.
223223
And it depends on your overall project structure if and how to do that.
224224
Here is an example setup you may use:
225225

226-
```
226+
```kotlin
227227
val consistentResolutionAttribute = Attribute.of("consistent-resolution", String::class.java)
228228

229229
// Define an Outgoing Variant (aka Consumable Configuration) that knows about all dependencies
@@ -270,15 +270,15 @@ NOTE: This functionality requires Gradle to be run with Java 11+ and failing on
270270

271271
If your goal is to fully modularize your application, you should enable the following configuration setting, which is disabled by default.
272272

273-
```
273+
```kotlin
274274
extraJavaModuleInfo {
275275
failOnAutomaticModules = true
276276
}
277277
```
278278

279279
With this setting enabled, the build will fail unless you define a module override for every automatic module that appears in your dependency tree, as shown below.
280280

281-
```
281+
```kotlin
282282
dependencies {
283283
implementation("org.yaml:snakeyaml:1.33")
284284
}
@@ -297,8 +297,8 @@ The Java Module System does not allow the same package to be used in more than o
297297
This is an issue with legacy libraries, where it was common practice to use the same package in multiple Jars.
298298
This plugin offers the option to merge multiple Jars into one in such situations:
299299

300-
```
301-
extraJavaModuleInfo {
300+
```kotlin
301+
extraJavaModuleInfo {
302302
module("org.apache.zookeeper:zookeeper", "org.apache.zookeeper") {
303303
mergeJar("org.apache.zookeeper:zookeeper-jute")
304304

@@ -316,7 +316,7 @@ In some cases, it may also be sufficient to remove appearances of the problemati
316316
This can be the case if classes are in fact duplicated, or if classes are not used.
317317
For this, you can utilise the `removePackage` functionality:
318318

319-
```
319+
```kotlin
320320
extraJavaModuleInfo {
321321
module("xerces:xercesImpl", "xerces") {
322322
removePackage("org.w3c.dom.html")
@@ -331,7 +331,7 @@ To fix a library with a broken `module-info.class`, you can override the modular
331331
However, you need to specify `patchRealModule()` to overwrite the existing `module-info.class`.
332332
You can also use `preserveExisting()`, if the exiting `module-info.class` is working in general, but misses entries.
333333

334-
```
334+
```kotlin
335335
extraJavaModuleInfo {
336336
module("org.apache.tomcat.embed:tomcat-embed-core", "org.apache.tomcat.embed.core") {
337337
patchRealModule() // overwrite existing module-info.class
@@ -350,7 +350,7 @@ This opt-in behavior is designed to prevent over-patching real modules, especial
350350
If you use legacy libraries and want to use the Java Module System with all its features, you should patch all Jars to include a `module-info`.
351351
However, if you get started and just want things to be put on the Module Path, you can set the following option:
352352

353-
```
353+
```kotlin
354354
extraJavaModuleInfo {
355355
deriveAutomaticModuleNamesFromFileNames = true
356356
}

0 commit comments

Comments
 (0)