Scripting, maven: use getArtifacts to get the plugin's runtime classpath

..to correctly pass the dependencies in the ExecuteKotlinScriptMojo.
#KT-50306 fixed

Also add a test that a script has access to plugin-configured
dependencies.
If plugin/dependencies is populated, the extra artifacts should be
made available when the script is run. This test uses 'junit' simply
because it's commonly-used, but not already present, or shaded as part
of another artifact.
This commit is contained in:
Joseph Walton
2021-12-16 13:03:36 +11:00
committed by teamcity
parent 2bd53e3dea
commit f38e1b218d
4 changed files with 57 additions and 1 deletions
@@ -247,7 +247,7 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
}
private List<File> getThisPluginDependencies() {
return plugin.getDependencies().stream().map(this::getDependencyFile).collect(Collectors.toList());
return plugin.getArtifacts().stream().map(this::getArtifactFile).collect(Collectors.toList());
}
private File getThisPluginAsDependency() {