prov-toolbox-js-embedding
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>org.openprovenance.prov</groupId> <artifactId>prov-toolbox-js-embedding</artifactId> <version>2.2.1</version> </dependency>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.openprovenance.prov</groupId> <artifactId>modules-tools</artifactId> <version>2.2.1</version> </parent> <artifactId>prov-toolbox-js-embedding</artifactId> <name> |---- PROV-TOOLBOX-JS-EMBEDDING</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <graalvm.version>24.1.0</graalvm.version> </properties> <dependencies> <dependency> <groupId>org.openprovenance.prov</groupId> <artifactId>prov-interop</artifactId> <version>2.2.1</version> </dependency> <!-- <dependency> <groupId>org.openprovenance.prov</groupId> <artifactId>prov-model</artifactId> <version>2.0.9-SNAPSHOT</version> </dependency> --> <!-- The polyglot dependency is always required for Java embeddings. It contains the polyglot embedding APIs to include any polyglot language. --> <dependency> <groupId>org.graalvm.polyglot</groupId> <artifactId>polyglot</artifactId> <version>${graalvm.version}</version> <type>jar</type> </dependency> <!-- Choose here which languages should be used. Available languages in the polyglot group are: js, ruby, python, wasm, llvm, llvm-native, java Switch to community licenses by adding a `-community` suffix to the artefact id (e.g. `js-communtiy`). Switch to native isolate versions of languages by adding a `-isolate` suffix. (`js-isolate`). Starting from GraalVM Polyglot API version 24.1.0, native isolate versions of languages for specific platforms are supported. Refer to the `isolate` profiles for instructions on how to activate them. Any dependency in the org.graalvm.polyglot group is intended for use by polyglot embeddings. --> <dependency> <groupId>org.graalvm.polyglot</groupId> <artifactId>js</artifactId> <version>${graalvm.version}</version> <type>pom</type> </dependency> <!-- Uncomment to include language tooling like a sampling profiler and the chrome inspector support. --> <!-- <dependency> <groupId>org.graalvm.polyglot</groupId> <artifactId>tools</artifactId> <version>${graalvm.version}</version> <type>pom</type> </dependency> --> <!-- Use the JUnit version of your choice. --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13.2</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.11.0</version> <configuration> <source>21</source> <target>21</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.1.2</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>3.1.0</version> <executions> <execution> <goals> <goal>exec</goal> </goals> </execution> <execution> <id>no-runtime-compilation</id> <goals> <goal>exec</goal> </goals> <configuration> <executable>${java.home}/bin/java</executable> <arguments> <!-- We recommend running from the module path by default. You can also switch to the classpath here. --> <argument>--module-path</argument> <modulepath /> <argument>-m</argument> <argument>embedding/org.example.embedding.Main</argument> </arguments> </configuration> </execution> </executions> <configuration> <executable>${java.home}/bin/java</executable> <arguments> <!-- We recommend running from the module path by default. You can also switch to the classpath here. --> <argument>--module-path</argument> <modulepath /> <argument>-m</argument> <argument>embedding/org.example.embedding.Main</argument> </arguments> </configuration> </plugin> <plugin> <artifactId>maven-jlink-plugin</artifactId> <version>3.1.0</version> <extensions>true</extensions> <configuration> <ignoreSigningInformation>true</ignoreSigningInformation> </configuration> </plugin> </plugins> </build> <profiles> <profile> <!-- Run native image build with: mvn -Pnative package. This profile may be removed if no native-image builds are needed. --> <id>native</id> <properties> <image.name>${project.artifactId}</image.name> <image.path>${project.build.directory}/${image.name}</image.path> </properties> <build> <plugins> <plugin> <groupId>org.graalvm.buildtools</groupId> <artifactId>native-maven-plugin</artifactId> <version>0.10.2</version> <extensions>true</extensions> <executions> <execution> <id>build-native</id> <goals> <goal>compile-no-fork</goal> </goals> <phase>package</phase> </execution> </executions> <configuration> <imageName>${image.name}</imageName> <mainClass>org.example.embedding.Main</mainClass> <buildArgs> <buildArg>--no-fallback</buildArg> <buildArg>-J-Xmx20g</buildArg> </buildArgs> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <executions> <execution> <id>default-cli</id> <goals> <goal>exec</goal> </goals> <configuration> <executable>${image.path}</executable> <arguments /> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <!-- Profile used when running on a different JDK than GraalVM. This profile may be removed if you are always running with a GraalVM JDK or if you don't want to use the optimizing runtime. Note: Using this configuration unlocks experimental options and is therefore not recommended for production use. --> <id>not-graalvm-jdk</id> <activation> <file> <!-- Detect if we are not running with a GraalVM JDK. --> <missing>${java.home}/lib/graalvm</missing> </file> </activation> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.6.0</version> <executions> <!-- Copies compiler dependencies to the target/compiler folder. In order to run with an optimizing runtime on other JDKs than GraalVM we need to put the compiler on the upgrade module path. --> <execution> <id>copy-dependencies</id> <phase>process-resources</phase> <goals> <goal>copy</goal> </goals> <configuration> <outputDirectory> ${project.build.directory}/compiler </outputDirectory> <overWriteReleases>true</overWriteReleases> <overWriteSnapshots>true</overWriteSnapshots> <artifactItems> <!-- Unfortunately Maven does not support resolving transitive dependencies here automatically. So the list of dependencies might need to be updated when upgrading to new versions of GraalVM. --> <artifactItem> <groupId>org.graalvm.sdk</groupId> <artifactId>collections</artifactId> <version>${graalvm.version}</version> <type>jar</type> <destFileName>collections.jar</destFileName> </artifactItem> <artifactItem> <groupId>org.graalvm.sdk</groupId> <artifactId>word</artifactId> <version>${graalvm.version}</version> <type>jar</type> <destFileName>word.jar</destFileName> </artifactItem> <artifactItem> <groupId>org.graalvm.truffle</groupId> <artifactId>truffle-compiler</artifactId> <version>${graalvm.version}</version> <type>jar</type> <destFileName>truffle-compiler.jar</destFileName> </artifactItem> <artifactItem> <groupId>org.graalvm.compiler</groupId> <artifactId>compiler</artifactId> <version>${graalvm.version}</version> <type>jar</type> <destFileName>compiler.jar</destFileName> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.1.2</version> <configuration> <argLine> -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI --upgrade-module-path=${project.build.directory}/compiler </argLine> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <executions> <execution> <id>default-cli</id> <goals> <goal>exec</goal> </goals> <configuration> <executable>${java.home}/bin/java</executable> <arguments> <argument>--module-path</argument> <modulepath /> <argument>-XX:+UnlockExperimentalVMOptions</argument> <argument>-XX:+EnableJVMCI</argument> <argument>--upgrade-module-path=${project.build.directory}/compiler/</argument> <argument>-m</argument> <argument>embedding/org.example.embedding.Main</argument> </arguments> </configuration> </execution> <execution> <id>no-runtime-compilation</id> <goals> <goal>exec</goal> </goals> <configuration> <executable>${java.home}/bin/java</executable> <arguments> <argument>--module-path</argument> <modulepath /> <argument>-m</argument> <argument>embedding/org.example.embedding.Main</argument> </arguments> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>assembly</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>3.6.0</version> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <archive> <manifest> <mainClass>org.example.embedding.Main</mainClass> </manifest> </archive> <descriptors> <descriptor>assembly.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>shade</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.5.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>org.example.embedding.Main</mainClass> </transformer> </transformers> <filters> <filter> <artifact>*:*:*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> </configuration> </plugin> </plugins> </build> </profile> <!-- Profiles for using a native isolate language version for a specific platform. Native isolate versions of languages for a specific platforms are supported since Polyglot version 24.1 for JavaScript (js) and Python (python). These profiles may be removed if you are not using native isolate versions of languages. --> <!-- Linux AMD64 --> <profile> <id>isolated-linux-amd64</id> <activation> <os> <family>unix</family> <name>linux</name> <arch>amd64</arch> </os> </activation> <properties> <isolate.platform.suffix>-linux-amd64</isolate.platform.suffix> </properties> </profile> <!-- Linux AARCH64 --> <profile> <id>isolated-linux-aarch64</id> <activation> <os> <family>unix</family> <name>linux</name> <arch>aarch64</arch> </os> </activation> <properties> <isolate.platform.suffix>-linux-aarch64</isolate.platform.suffix> </properties> </profile> <!-- macOS AMD64 --> <profile> <id>isolated-darwin-amd64</id> <activation> <os> <family>mac</family> <arch>x86_64</arch> </os> </activation> <properties> <isolate.platform.suffix>-darwin-amd64</isolate.platform.suffix> </properties> </profile> <!-- macOS AARCH64 --> <profile> <id>isolated-darwin-aarch64</id> <activation> <os> <family>mac</family> <arch>aarch64</arch> </os> </activation> <properties> <isolate.platform.suffix>-darwin-aarch64</isolate.platform.suffix> </properties> </profile> <!-- Windows AMD64 --> <profile> <id>isolated-windows-amd64</id> <activation> <os> <family>windows</family> <arch>x86_64</arch> </os> </activation> <properties> <isolate.platform.suffix>-windows-amd64</isolate.platform.suffix> </properties> </profile> <!-- Profile to package polyglot isolate libraries for all supported platforms. The profile is activated using `mvn -Pisolated -Disolated.all.platforms` --> <profile> <id>isolated-all-platforms</id> <activation> <property> <name>isolated.all.platforms</name> </property> </activation> <properties> <isolate.platform.suffix /> </properties> </profile> <!-- Profile for using isolated version of a guest language. The profile is activated by `mvn -Pisolated`. --> <profile> <id>isolated</id> <properties> <isolated.language.id>js</isolated.language.id> </properties> <dependencies> <dependency> <groupId>org.graalvm.polyglot</groupId> <artifactId>js-isolate${isolate.platform.suffix}</artifactId> <version>${graalvm.version}</version> <type>pom</type> </dependency> <!-- Including the non-isolated language as a provided dependency ensures that the non-isolated language included in the project dependencies is excluded from the Java module path. --> <dependency> <groupId>org.graalvm.polyglot</groupId> <artifactId>js</artifactId> <version>${graalvm.version}</version> <type>pom</type> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.1.2</version> <configuration> <systemPropertyVariables> <!-- The Maven Surefire plugin sets the `polyglot.engine.SpawnIsolate=<language>` system property to utilize the isolated version of the language during unit tests. --> <polyglot.engine.SpawnIsolate>${isolated.language.id}</polyglot.engine.SpawnIsolate> </systemPropertyVariables> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>3.1.0</version> <executions> <execution> <goals> <goal>exec</goal> </goals> </execution> <execution> <id>no-runtime-compilation</id> <goals> <goal>exec</goal> </goals> <configuration> <executable>${java.home}/bin/java</executable> <arguments> <argument>-Dpolyglot.engine.SpawnIsolate=${isolated.language.id}</argument> <!-- We recommend running from the module path by default. You can also switch to the classpath here. --> <argument>--module-path</argument> <modulepath /> <argument>-m</argument> <argument>embedding/org.example.embedding.Main</argument> </arguments> </configuration> </execution> </executions> <configuration> <executable>${java.home}/bin/java</executable> <arguments> <argument>-Dpolyglot.engine.SpawnIsolate=${isolated.language.id}</argument> <!-- We recommend running from the module path by default. You can also switch to the classpath here. --> <argument>--module-path</argument> <modulepath /> <argument>-m</argument> <argument>embedding/org.example.embedding.Main</argument> </arguments> </configuration> </plugin> </plugins> </build> </profile> </profiles> </project>