Building Loom from Maven
Bren
bren at juanantonio.info
Thu Sep 1 20:35:50 UTC 2022
Hi Eric,
Try this configuration:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>19</source>
<target>19</target>
<encoding>UTF-8</encoding>
<enablePreview>true</enablePreview>
<compilerArgs>
<compilerArg>--add-modules</compilerArg>
<compilerArg>jdk.incubator.concurrent</compilerArg>
</compilerArgs>
</configuration>
</plugin>
Source:
https://github.com/jabrena/spinner-demo/blob/main/pom.xml
Sent from my iPhone
Juan Antonio
> On 8 Aug 2022, at 23:32, Rob Bygrave <robin.bygrave at gmail.com> wrote:
>
>
> maven-compiler-plugin version 3.8.1 is kind of old. Maybe try version 3.10.1 ?
>
>> On Fri, 5 Aug 2022 at 04:02, Lutz Horn <code at lhorn.de> wrote:
>> Hi,
>>
>> Am 04.08.22 um 02:33 schrieb eric at kolotyluk.net:
>> > Has anyone had any success using Structured Concurrency from JDK 19?
>>
>> Using 19.ea.33-open from SDKMAN, this makes `mvn compile` work:
>>
>> ```
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <version>3.8.1</version>
>> <configuration>
>> <release>19</release>
>> <compilerArgs>
>> <arg>--enable-preview</arg>
>> <arg>--add-modules</arg>
>> <arg>jdk.incubator.concurrent</arg>
>> </compilerArgs>
>> </configuration>
>> </plugin>
>> ```
>>
>> Note that `--add-modules jdk.incubator.concurrent` ist split on *two*
>> `arg`s.
>>
>>
>> Strangely, I fail to run `mvn test` using the following configuration of
>> the `maven-surefire-plugin` which worked with the old Loom preview build
>> 19.ea.5.lm-open.
>>
>> ```
>> <configuration>
>> <argLine>--enable-preview --add-modules
>> jdk.incubator.concurrent</argLine>
>> </configuration>
>> ```
>>
>> `mvn test-compile` works but `mvn test` fails like this:
>>
>> ```
>> java.lang.NoSuchMethodError: 'void
>> jdk.incubator.concurrent.StructuredTaskScope$ShutdownOnFailure.join()'
>> ```
>>
>> Both `main` and `test` can be compiled but running the tests fails.
>>
>> Lutz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20220901/d0277dca/attachment-0001.htm>
More information about the loom-dev
mailing list