Skip to content

Commit 0ded128

Browse files
authored
chore: duplicating subheaders (#5660)
1 parent 33decb9 commit 0ded128

1 file changed

Lines changed: 25 additions & 26 deletions

File tree

docs/topics/maven/maven-configure-project.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,31 @@ see an example in [Compile Kotlin and Java sources](#compile-kotlin-and-java-sou
6161
>
6262
{style="note"}
6363

64+
<anchor name="maven-compiler-extensions-version"/>
65+
66+
Currently, the default version of the Maven compiler plugin used with `<extensions>` is **%mavenExtensionsVersion%**.
67+
You can set a different version separately:
68+
69+
```xml
70+
<build>
71+
<plugins>
72+
<!-- Kotlin compiler plugin configuration -->
73+
<plugin>
74+
<groupId>org.jetbrains.kotlin</groupId>
75+
<artifactId>kotlin-maven-plugin</artifactId>
76+
<version>${kotlin.version}</version>
77+
<extensions>true</extensions>
78+
</plugin>
79+
<!-- Maven compiler plugin configuration for Java classes -->
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-compiler-plugin</artifactId>
83+
<version>%mavenPluginVersion%</version>
84+
</plugin>
85+
</plugins>
86+
</build>
87+
```
88+
6489
### JVM target version
6590

6691
The `<extensions>` option ensures that the Kotlin and Maven compilers target the same bytecode version.
@@ -111,37 +136,11 @@ Keep in mind that `target` and `release` options of the Maven compiler behave di
111136
| `maven.compiler.target` | Yes | No | No − the build's JDK classpath stays visible |
112137
| `maven.compiler.release` | Yes | Yes | Yes − to the specific API version only |
113138

114-
115139
> The `<extensions>` option only checks project-level properties and the global `maven-compiler-plugin` configuration.
116140
> It doesn't check the configurations defined in the plugin's `<executions>` section.
117141
>
118142
{style="note"}
119143

120-
### Maven compiler version
121-
122-
Currently, the default version of the Maven compiler plugin used with `<extensions>` is **%mavenExtensionsVersion%**.
123-
You can set a different version separately:
124-
125-
```xml
126-
<build>
127-
<plugins>
128-
<!-- Kotlin compiler plugin configuration -->
129-
<plugin>
130-
<groupId>org.jetbrains.kotlin</groupId>
131-
<artifactId>kotlin-maven-plugin</artifactId>
132-
<version>${kotlin.version}</version>
133-
<extensions>true</extensions>
134-
</plugin>
135-
<!-- Maven compiler plugin configuration for Java classes -->
136-
<plugin>
137-
<groupId>org.apache.maven.plugins</groupId>
138-
<artifactId>maven-compiler-plugin</artifactId>
139-
<version>%mavenPluginVersion%</version>
140-
</plugin>
141-
</plugins>
142-
</build>
143-
```
144-
145144
## Manual configuration
146145

147146
Without enabling `<extensions>` in the Kotlin Maven plugin, you need to configure the project manually to ensure that

0 commit comments

Comments
 (0)