diff --git a/libraries/tools/kotlin-annotation-processing/kotlin-annotation-processing-maven-build.txt b/libraries/tools/kotlin-annotation-processing/kotlin-annotation-processing-maven-build.txt
new file mode 100644
index 00000000000..038fc782c57
--- /dev/null
+++ b/libraries/tools/kotlin-annotation-processing/kotlin-annotation-processing-maven-build.txt
@@ -0,0 +1,9 @@
+The presence of this file enables the "tools_jar_profile" profile in kotlin-annotation-processing,
+ which adds "tools.jar" to the compile dependencies.
+
+When Gradle loads this artifact, the "tools_jar_profile" profile should not be activated
+ (cause it adds an extra dependency from the path based on the environment variable).
+
+It wouldn't in fact because:
+1. This file is normally absent when Gradle build with kapt is launched;
+2. Gradle poorly supports Maven profiles.
\ No newline at end of file
diff --git a/libraries/tools/kotlin-annotation-processing/pom.xml b/libraries/tools/kotlin-annotation-processing/pom.xml
index 697e1b0dfab..a93f6f96806 100755
--- a/libraries/tools/kotlin-annotation-processing/pom.xml
+++ b/libraries/tools/kotlin-annotation-processing/pom.xml
@@ -56,13 +56,6 @@
1.1.0
provided
-
- jdk
- tools
- system
- 1.8
- ${env.JDK_18}/lib/tools.jar
-
@@ -184,4 +177,28 @@
+
+
+
+ tools_jar_profile
+
+ false
+
+ kotlin-annotation-processing-maven-build.txt
+
+
+
+ ${env.JDK_18}/lib/tools.jar
+
+
+
+ com.sun
+ tools
+ 1.8.0
+ system
+ ${toolsjar}
+
+
+
+