Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jetty maven插件9.4.12和Java 11_Java_Maven_Jetty_Java 11 - Fatal编程技术网

Jetty maven插件9.4.12和Java 11

Jetty maven插件9.4.12和Java 11,java,maven,jetty,java-11,Java,Maven,Jetty,Java 11,我在Java 11中使用jetty maven插件时遇到了问题。我已经尝试在插件依赖项中显式指定与Java 11兼容的asm版本 我的配置: <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.4.12.v20180830</version>

我在Java 11中使用jetty maven插件时遇到了问题。我已经尝试在插件依赖项中显式指定与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>
尝试其他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)
原因:java.lang.IllegalArgumentException:不支持的类文件主版本55
位于org.objectweb.asm.ClassReader。(ClassReader.java:166)
位于org.objectweb.asm.ClassReader。(ClassReader.java:148)
位于org.objectweb.asm.ClassReader。(ClassReader.java:136)
位于org.objectweb.asm.ClassReader。(ClassReader.java:237)
位于org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:932)
位于org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:917)
位于org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:876)
位于java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
位于java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
位于org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:872)
位于org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:836)
位于org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
位于org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:471)
位于org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
位于org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
在java.lang.Thread.run(Thread.java:834)

有没有办法让jetty maven插件与Java 11一起运行?

使用jetty maven插件9.4.14.v20181114时,一切似乎都正常运行

<packaging>war</packaging>
<name>test-project</name>
<properties> 
    <maven.compiler.source>JavaVersion</maven.compiler.source> 
    <maven.compiler.target>javaVersion</maven.compiler.target> 
</properties>
战争
测试项目
Java版本
Java版本


11
11

针对ASM 7的Java 11支持(目前处于早期beta版)-可能希望跟踪Jetty端的开放问题,如果您尝试ASM 7.0-beta版而不是6.2.1版,会怎么样?它是几天前发布的。也尝试了asm 7.0测试版,但失败了,出现了另一个错误:“java.lang.UnsupportedOperationException:此功能需要ASM7”asm v7已经发布-您可能希望对您的答案添加一些解释,以帮助那些可能不理解答案的人[链接]
<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>