Плагин Jetty Maven 9.4.12 с Java 11 - PullRequest
       36

Плагин Jetty Maven 9.4.12 с Java 11

0 голосов
/ 03 октября 2018

У меня проблемы с использованием jetty-maven-plugin с Java 11. Я попытался явно указать Java 11-совместимую версию asm в зависимостях плагина.

Моя конфигурация:

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>9.4.12.v20180830</version>
    <dependencies>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm-commons</artifactId>
            <version>6.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <version>6.2.1</version>
        </dependency>
    </dependencies>
    <configuration>
        <httpConnector>
            <port>9090</port>
        </httpConnector>
        <stopPort>8005</stopPort>
        <stopKey>STOP</stopKey>
        <webApp>
            <contextPath>/</contextPath>
        </webApp>
        <jvmArgs>-Dfile.encoding=UTF-8</jvmArgs>
    </configuration>
    <executions>
        <execution>
            <id>start-jetty</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <scanIntervalSeconds>0</scanIntervalSeconds>
            </configuration>
        </execution>
        <execution>
            <id>stop-jetty</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>stop</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Это не работает с

....
Caused by: java.lang.UnsupportedOperationException
at org.objectweb.asm.ClassVisitor.visitNestHostExperimental (ClassVisitor.java:158)
at org.objectweb.asm.ClassReader.accept (ClassReader.java:541)
at org.objectweb.asm.ClassReader.accept (ClassReader.java:391)
at org.eclipse.jetty.annotations.AnnotationParser.scanClass (AnnotationParser.java:933)
at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry (AnnotationParser.java:917)
at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0 (AnnotationParser.java:876)
at java.util.TreeMap$ValueSpliterator.forEachRemaining (TreeMap.java:2890)
at java.util.stream.ReferencePipeline$Head.forEach (ReferencePipeline.java:658)
at org.eclipse.jetty.annotations.AnnotationParser.parseJar (AnnotationParser.java:872)
at org.eclipse.jetty.annotations.AnnotationParser.parse (AnnotationParser.java:836)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call (AnnotationConfiguration.java:163)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run (AnnotationConfiguration.java:471)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run (QueuedThreadPool.java:683)
at java.lang.Thread.run (Thread.java:834)

Попытка другой версии asm (например, 6.1.1) завершается неудачно с:

Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 55
at org.objectweb.asm.ClassReader.<init> (ClassReader.java:166)
at org.objectweb.asm.ClassReader.<init> (ClassReader.java:148)
at org.objectweb.asm.ClassReader.<init> (ClassReader.java:136)
at org.objectweb.asm.ClassReader.<init> (ClassReader.java:237)
at org.eclipse.jetty.annotations.AnnotationParser.scanClass (AnnotationParser.java:932)
at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry (AnnotationParser.java:917)
at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0 (AnnotationParser.java:876)
at java.util.TreeMap$ValueSpliterator.forEachRemaining (TreeMap.java:2890)
at java.util.stream.ReferencePipeline$Head.forEach (ReferencePipeline.java:658)
at org.eclipse.jetty.annotations.AnnotationParser.parseJar (AnnotationParser.java:872)
at org.eclipse.jetty.annotations.AnnotationParser.parse (AnnotationParser.java:836)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call (AnnotationConfiguration.java:163)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run (AnnotationConfiguration.java:471)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run (QueuedThreadPool.java:683)
at java.lang.Thread.run (Thread.java:834)

Есть ли способ запустить плагин Jetty Maven для запускас Java 11?

Ответы [ 2 ]

0 голосов
/ 30 января 2019

...

<packaging>war</packaging>
<name>test-project</name>
<properties> 
    <maven.compiler.source>JavaVersion</maven.compiler.source> 
    <maven.compiler.target>javaVersion</maven.compiler.target> 
</properties>

....

<properties> 
    <maven.compiler.source>11</maven.compiler.source> 
    <maven.compiler.target>11</maven.compiler.target> 
</properties>
0 голосов
/ 25 декабря 2018

Кажется, что все работает должным образом с jetty-maven-plugin »9.4.14.v20181114

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...