http://blog.csdn.net/liuchuanhong1/article/details/52880598
(1)若報錯如下:
Failed to read artifact descriptor for org.glassfish.jersey.containers:jersey-container-servlet:jar:2.17
解決方法如下:
I was able
to resolve the issue with below steps: Right click on the maven project in Eclipse -> Maven -> Update Project -> Check "Force update of snapshots/Releases" check box.
(2)若報錯如下:
java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer
解決方法如下:
For web projects in Eclipse, it is almost always advisable to manage dependencies with Maven. Use a Maven plugin like m2e. Once you add a dependency to your Maven project, it should automatically deploy those libraries to WEB-INF/lib. If it does not (for whatever reasons), you can explicit do so:
- Right-click on your project in Project Explorer
- Select Properties
- Select Deployment Assembly
- If Maven Dependencies is not one of the entries, the libraries were not added automatically, so we'll add them now
- Select Add
- Select Java Build Path Entries
- Select Maven Dependencies
- Click Finish
This should add the libraries to WEB-INF/lib, although you'd still not see them in the Project Explorer view. But your ClassNotFoundException should go away now.