Skip to content

Commit e700cf1

Browse files
authored
build: add docling-core as graalpy resource (#8)
Signed-off-by: Cesar Berrospi Ramis <[email protected]>
1 parent f381ba3 commit e700cf1

File tree

1 file changed

+51
-28
lines changed

1 file changed

+51
-28
lines changed

pom.xml

+51-28
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@
1111

1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<graalpy.version>24.2.0</graalpy.version>
15+
<graalpy.edition>python-community</graalpy.edition>
16+
<native-maven-plugin.version>0.10.4</native-maven-plugin.version>
1417
<maven.compiler.source>21</maven.compiler.source>
1518
<maven.compiler.target>21</maven.compiler.target>
16-
<surefire-version>3.1.2</surefire-version>
19+
<surefire-version>3.5.2</surefire-version>
1720
<checkstyle-plugin-version>3.6.0</checkstyle-plugin-version>
18-
<checkstyle-version>10.21.4</checkstyle-version>
21+
<checkstyle-version>10.22.0</checkstyle-version>
1922
<jacoco-plugin-version>0.8.12</jacoco-plugin-version>
2023
<compiler-plugin-version>3.14.0</compiler-plugin-version>
21-
<maven-enforcer-version>3.4.1</maven-enforcer-version>
22-
<maven-deploy-plugin-version>3.1.1</maven-deploy-plugin-version>
23-
<min-maven-version>3.5.0</min-maven-version>
24-
<min-jdk-version>11</min-jdk-version>
24+
<maven-enforcer-version>3.5.0</maven-enforcer-version>
25+
<maven-deploy-plugin-version>3.1.4</maven-deploy-plugin-version>
26+
<min-maven-version>3.6.3</min-maven-version>
27+
<min-jdk-version>21</min-jdk-version>
2528
<surefireJvmArgs></surefireJvmArgs>
2629
</properties>
2730

@@ -79,14 +82,14 @@
7982
<dependencies>
8083
<dependency>
8184
<groupId>org.graalvm.polyglot</groupId>
82-
<artifactId>python</artifactId>
83-
<version>24.2.0</version>
85+
<artifactId>${graalpy.edition}</artifactId>
86+
<version>${graalpy.version}</version>
8487
<type>pom</type>
8588
</dependency>
8689
<dependency>
87-
<groupId>org.graalvm.polyglot</groupId>
88-
<artifactId>polyglot</artifactId>
89-
<version>24.2.0</version>
90+
<groupId>org.graalvm.python</groupId>
91+
<artifactId>python-embedding</artifactId>
92+
<version>${graalpy.version}</version>
9093
</dependency>
9194
<dependency>
9295
<groupId>org.junit.jupiter</groupId>
@@ -156,7 +159,7 @@
156159
<plugin>
157160
<groupId>org.apache.maven.plugins</groupId>
158161
<artifactId>maven-source-plugin</artifactId>
159-
<version>3.0.1</version>
162+
<version>3.3.1</version>
160163
<executions>
161164
<execution>
162165
<id>attach-sources</id>
@@ -238,6 +241,30 @@
238241
<argLine>@{argLine} ${surefireJvmArgs}</argLine>
239242
</configuration>
240243
</plugin>
244+
<plugin>
245+
<groupId>org.graalvm.python</groupId>
246+
<artifactId>graalpy-maven-plugin</artifactId>
247+
<version>${graalpy.version}</version>
248+
<executions>
249+
<execution>
250+
<goals>
251+
<goal>process-graalpy-resources</goal>
252+
</goals>
253+
</execution>
254+
</executions>
255+
<configuration>
256+
<!-- specify the Java resource directory for the virtual filesystem -->
257+
<!-- put your custom scripts, datasets and other data into this directory
258+
to make them available in Python. Subdirectory "src" will be also
259+
added to PYTHONPATH, i.e., Python scripts from that directory can
260+
be imported as modules in Python -->
261+
<resourceDirectory>GRAALPY-VFS/${project.groupId}/${project.artifactId}</resourceDirectory>
262+
<!-- specify python packages and their versions as if used with pip -->
263+
<packages>
264+
<package>docling</package>
265+
</packages>
266+
</configuration>
267+
</plugin>
241268
</plugins>
242269
</build>
243270

@@ -256,32 +283,28 @@
256283
</developers>
257284

258285
<profiles>
259-
<!-- NOTE: The release profile will be removed from future versions of the super POM -->
260286
<profile>
261-
<id>release-profile</id>
262-
<activation>
263-
<property>
264-
<name>performRelease</name>
265-
<value>true</value>
266-
</property>
267-
</activation>
287+
<id>native</id>
268288
<build>
269289
<plugins>
270290
<plugin>
271-
<inherited>true</inherited>
272-
<artifactId>maven-source-plugin</artifactId>
291+
<groupId>org.graalvm.buildtools</groupId>
292+
<artifactId>native-maven-plugin</artifactId>
293+
<version>${native-maven-plugin.version}</version>
294+
<extensions>true</extensions>
273295
<executions>
274296
<execution>
275-
<id>attach-sources</id>
297+
<id>build-native</id>
276298
<goals>
277-
<goal>jar-no-fork</goal>
299+
<goal>compile-no-fork</goal>
278300
</goals>
301+
<phase>package</phase>
279302
</execution>
280303
</executions>
281-
</plugin>
282-
<plugin>
283-
<inherited>true</inherited>
284-
<artifactId>maven-deploy-plugin</artifactId>
304+
<configuration>
305+
<fallback>false</fallback>
306+
<mainClass>com.ibm.docling.HelloWorld</mainClass>
307+
</configuration>
285308
</plugin>
286309
</plugins>
287310
</build>

0 commit comments

Comments
 (0)