<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
<version>24.1.1</version>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>python</artifactId>
<version>24.1.1</version>
<type>pom</type>
</dependency>
implementation("org.graalvm.polyglot:polyglot:24.1.1")
implementation("org.graalvm.polyglot:python:24.1.1")
import org.graalvm.polyglot.Context;
try (Context context = Context.create()) {
context.eval("python", "print('Hello from GraalPy!')");
}
<plugin>
<groupId>org.graalvm.python</groupId>
<artifactId>graalpy-maven-plugin</artifactId>
<version>24.1.1</version>
<executions>
<execution>
<configuration>
<packages>
<!-- Select Python packages to install via pip. -->
<package>pyfiglet==1.0.2</package>
</packages>
</configuration>
<goals>
<goal>process-graalpy-resources</goal>
</goals>
</execution>
</executions>
</plugin>
plugins {
id("org.graalvm.python") version "24.1.1"
}
graalPy {
packages = setOf("pyfiglet==1.0.2")
}