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

前端 未结 3 551
日久生厌
日久生厌 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 04:38

    The problem that current Jersey has a shaded asm 5 dependency, which doesn't work with Java 9 bytecode. Looks like Jersey 1.x is not adopted to Java 9 and it's unclear if this support is coming at all. As a temporary solution, I made a branch where I deleted shaded asm, migrated packages in code to use a regular asm dependency and put asm 6.0 in maven dependencies.

    You can build only jersey-server and jersey-servlet modules from this branch because only these two depend on asm and use these two custom artifacts in your project.

    My projects work fine with such a replacement, but I can't guarantee that it's 100% working solution, I wasn't able to build the whole distribution without fails and can't invest time for a full adoption and check right now. On the same time, the main Jersey parts built without issues.

    So, your final pom would look like:

    
    
        com.sun.jersey
        jersey-server
        ${custom-jersey-with-asm6.version}
    
    
    
         com.sun.jersey
         jersey-servlet
         ${custom-jersey-with-asm6.version}
    
    
    
         org.ow2.asm
         asm
         6.0
    
    

提交回复
热议问题