What Jersey version do I need to download for JDK 1.9?

前端 未结 3 552
日久生厌
日久生厌 2021-02-09 04:22

I am using jdk 1.9. I am trying to bring up a simple ReST service. Created the project using the maven archetype: jersey-quickstart-webapp. Then I went ahead and mo

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-09 05:01

    There are quite a few artifacts that you might need to update. To start with you shall check your module's mvn dependency:tree to look out for any source of asm that brings in version < 6.0.x since that is not compatible with Java9. From the current pom.xml and as inferred from your execution logs, you can update

    
    
        asm
        asm
        3.3.1
    
    

    to

    
        org.ow2.asm
        asm
        6.0
    
    

    Importantly, use Java 9 compatible maven plugins such as -

    
        org.apache.maven.plugins
        maven-compiler-plugin
        3.7.0
        true
        
            9
            9
        
    
    

    On a side note, you might end up still facing some other challenges(I can see conflicting jaxb dependencies, even asm might be transitive from jersey) to resolve which you shall run

    mvn dependency:analyze
    

    and make sure that conflicting dependencies are excluded in such cases to make use of their updated version.

提交回复
热议问题