Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Commit fec587c

Browse files
committed
Separate profile for jdk11.
Default profile is for running on GraalVM, and a separate, auto detected profile is used for running on jdk11.
1 parent 2f851ca commit fec587c

File tree

1 file changed

+169
-46
lines changed

1 file changed

+169
-46
lines changed

pom.xml

Lines changed: 169 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,181 @@
1111
<graalvm.version>1.0.0-rc8</graalvm.version>
1212
<compiler.dir>${project.build.directory}/compiler</compiler.dir>
1313
</properties>
14+
<profiles>
15+
<profile>
16+
<id>jdk11</id>
17+
<activation>
18+
<jdk>11</jdk>
19+
</activation>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.graalvm.sdk</groupId>
23+
<artifactId>graal-sdk</artifactId>
24+
<version>${graalvm.version}</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.graalvm.js</groupId>
28+
<artifactId>js</artifactId>
29+
<version>${graalvm.version}</version>
30+
<scope>runtime</scope>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.graalvm.js</groupId>
34+
<artifactId>js-scriptengine</artifactId>
35+
<version>${graalvm.version}</version>
36+
<scope>runtime</scope>
37+
</dependency>
38+
<dependency>
39+
<groupId>org.graalvm.tools</groupId>
40+
<artifactId>profiler</artifactId>
41+
<version>${graalvm.version}</version>
42+
<scope>runtime</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.graalvm.tools</groupId>
46+
<artifactId>chromeinspector</artifactId>
47+
<version>${graalvm.version}</version>
48+
<scope>runtime</scope>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.graalvm.truffle</groupId>
52+
<artifactId>truffle-api</artifactId>
53+
<version>${graalvm.version}</version>
54+
<scope>runtime</scope>
55+
</dependency>
56+
</dependencies>
57+
<build>
58+
<pluginManagement>
59+
<plugins>
60+
<plugin>
61+
<artifactId>maven-compiler-plugin</artifactId>
62+
<version>3.8.0</version>
63+
<configuration>
64+
<source>11</source>
65+
<target>11</target>
66+
</configuration>
67+
</plugin>
68+
<plugin>
69+
<artifactId>maven-surefire-plugin</artifactId>
70+
<version>2.22.1</version>
71+
<configuration>
72+
<argLine>-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI --module-path=${compiler.dir} --upgrade-module-path=${compiler.dir}/compiler.jar</argLine>
73+
</configuration>
74+
</plugin>
75+
<plugin>
76+
<groupId>org.apache.maven.plugins</groupId>
77+
<artifactId>maven-dependency-plugin</artifactId>
78+
<version>2.10</version>
79+
<executions>
80+
<execution>
81+
<id>copy</id>
82+
<phase>process-test-classes</phase>
83+
<goals>
84+
<goal>copy</goal>
85+
</goals>
86+
<configuration>
87+
<artifactItems>
88+
<artifactItem>
89+
<groupId>org.graalvm.compiler</groupId>
90+
<artifactId>compiler</artifactId>
91+
<version>${graalvm.version}</version>
92+
<type>jar</type>
93+
<overWrite>true</overWrite>
94+
<destFileName>compiler.jar</destFileName>
95+
</artifactItem>
96+
<artifactItem>
97+
<groupId>org.graalvm.truffle</groupId>
98+
<artifactId>truffle-api</artifactId>
99+
<version>${graalvm.version}</version>
100+
<type>jar</type>
101+
<overWrite>true</overWrite>
102+
<destFileName>truffle-api.jar</destFileName>
103+
</artifactItem>
104+
<artifactItem>
105+
<groupId>org.graalvm.sdk</groupId>
106+
<artifactId>graal-sdk</artifactId>
107+
<version>${graalvm.version}</version>
108+
<type>jar</type>
109+
<overWrite>true</overWrite>
110+
<destFileName>graal-sdk.jar</destFileName>
111+
</artifactItem>
112+
</artifactItems>
113+
<outputDirectory>${compiler.dir}</outputDirectory>
114+
</configuration>
115+
</execution>
116+
</executions>
117+
</plugin>
118+
<plugin>
119+
<groupId>org.codehaus.mojo</groupId>
120+
<artifactId>exec-maven-plugin</artifactId>
121+
<version>1.6.0</version>
122+
<executions>
123+
<execution>
124+
<id>default-cli</id>
125+
<goals>
126+
<goal>exec</goal>
127+
</goals>
128+
<configuration>
129+
<arguments>
130+
<argument>--module-path</argument>
131+
<!-- automatically creates the modulepath using all project dependencies, also adding the project build directory -->
132+
<modulepath/>
133+
<argument>-classpath</argument>
134+
<!-- automatically creates the classpath using all project dependencies, also adding the project build directory -->
135+
<classpath/>
136+
<argument>-XX:+UnlockExperimentalVMOptions</argument>
137+
<argument>-XX:+EnableJVMCI</argument>
138+
<argument>--upgrade-module-path=${compiler.dir}/compiler.jar</argument>
139+
<argument>com.mycompany.app.App</argument>
140+
</arguments>
141+
</configuration>
142+
</execution>
143+
<execution>
144+
<id>nograal</id>
145+
<goals>
146+
<goal>exec</goal>
147+
</goals>
148+
<configuration>
149+
<arguments>
150+
<argument>--module-path</argument>
151+
<!-- automatically creates the modulepath using all project dependencies, also adding the project build directory -->
152+
<modulepath/>
153+
<argument>-classpath</argument>
154+
<!-- automatically creates the classpath using all project dependencies, also adding the project build directory -->
155+
<classpath/>
156+
<argument>com.mycompany.app.App</argument>
157+
</arguments>
158+
</configuration>
159+
</execution>
160+
</executions>
161+
<configuration>
162+
<executable>${JAVA_HOME}/bin/java</executable>
163+
</configuration>
164+
</plugin>
165+
</plugins>
166+
</pluginManagement>
167+
<plugins>
168+
<plugin>
169+
<artifactId>maven-dependency-plugin</artifactId>
170+
</plugin>
171+
</plugins>
172+
</build>
173+
</profile>
174+
</profiles>
14175
<build>
15176
<pluginManagement>
16177
<plugins>
17178
<plugin>
18179
<artifactId>maven-compiler-plugin</artifactId>
19180
<version>3.8.0</version>
20181
<configuration>
21-
<source>11</source>
22-
<target>11</target>
182+
<source>1.8</source>
183+
<target>1.8</target>
23184
</configuration>
24185
</plugin>
25186
<plugin>
26187
<artifactId>maven-surefire-plugin</artifactId>
27188
<version>2.22.1</version>
28-
<configuration>
29-
<argLine>-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI --module-path=${compiler.dir} --upgrade-module-path=${compiler.dir}/compiler.jar</argLine>
30-
</configuration>
31189
</plugin>
32190
<plugin>
33191
<groupId>org.apache.maven.plugins</groupId>
@@ -78,7 +236,6 @@
78236
<version>1.6.0</version>
79237
<executions>
80238
<execution>
81-
<id>graal</id>
82239
<goals>
83240
<goal>exec</goal>
84241
</goals>
@@ -117,15 +274,16 @@
117274
</executions>
118275
<configuration>
119276
<executable>${JAVA_HOME}/bin/java</executable>
277+
<arguments>
278+
<argument>-classpath</argument>
279+
<!-- automatically creates the classpath using all project dependencies, also adding the project build directory -->
280+
<classpath/>
281+
<argument>com.mycompany.app.App</argument>
282+
</arguments>
120283
</configuration>
121284
</plugin>
122285
</plugins>
123286
</pluginManagement>
124-
<plugins>
125-
<plugin>
126-
<artifactId>maven-dependency-plugin</artifactId>
127-
</plugin>
128-
</plugins>
129287
</build>
130288
<dependencies>
131289
<dependency>
@@ -134,40 +292,5 @@
134292
<version>4.12</version>
135293
<scope>test</scope>
136294
</dependency>
137-
<dependency>
138-
<groupId>org.graalvm.sdk</groupId>
139-
<artifactId>graal-sdk</artifactId>
140-
<version>${graalvm.version}</version>
141-
</dependency>
142-
<dependency>
143-
<groupId>org.graalvm.truffle</groupId>
144-
<artifactId>truffle-api</artifactId>
145-
<version>${graalvm.version}</version>
146-
<scope>runtime</scope>
147-
</dependency>
148-
<dependency>
149-
<groupId>org.graalvm.js</groupId>
150-
<artifactId>js</artifactId>
151-
<version>${graalvm.version}</version>
152-
<scope>runtime</scope>
153-
</dependency>
154-
<dependency>
155-
<groupId>org.graalvm.js</groupId>
156-
<artifactId>js-scriptengine</artifactId>
157-
<version>${graalvm.version}</version>
158-
<scope>runtime</scope>
159-
</dependency>
160-
<dependency>
161-
<groupId>org.graalvm.tools</groupId>
162-
<artifactId>profiler</artifactId>
163-
<version>${graalvm.version}</version>
164-
<scope>runtime</scope>
165-
</dependency>
166-
<dependency>
167-
<groupId>org.graalvm.tools</groupId>
168-
<artifactId>chromeinspector</artifactId>
169-
<version>${graalvm.version}</version>
170-
<scope>runtime</scope>
171-
</dependency>
172295
</dependencies>
173296
</project>

0 commit comments

Comments
 (0)