Skip to content

Commit ea2e0bd

Browse files
ligeeSpace Team
authored and
Space Team
committed
Fix maven script executor after changes in the jdk path processing
also avoid unnecessary warnign about scripts in source roots #KT-58101 fixed
1 parent d44d8ea commit ea2e0bd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/ExecuteKotlinScriptMojo.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
import java.util.List;
6363
import java.util.stream.Collectors;
6464

65+
import static org.jetbrains.kotlin.cli.jvm.JvmArgumentsKt.configureJdkHomeFromSystemProperty;
66+
6567
/**
6668
* Allows to execute kotlin script files during the build process.
6769
* You can specify script file or inline script to be executed.
@@ -173,6 +175,10 @@ private void executeScriptFile(File scriptFile) throws MojoExecutionException {
173175
configuration.add(ComponentRegistrar.Companion.getPLUGIN_COMPONENT_REGISTRARS(),
174176
new ScriptingCompilerConfigurationComponentRegistrar());
175177

178+
configureJdkHomeFromSystemProperty(configuration);
179+
180+
configuration.put(CommonConfigurationKeys.ALLOW_ANY_SCRIPTS_IN_SOURCE_ROOTS, true);
181+
176182
List<File> deps = new ArrayList<>();
177183

178184
deps.addAll(getDependenciesForScript());

0 commit comments

Comments
 (0)