一、下文中需要的资源地址汇总
-
Maven
- Apache Maven网站 http://maven.apache.org/
- Maven下载地址: http://maven.apache.org/download.cgi
-
Jersey
-
Jersey(JAX-RS 2.1 / Jersey 2.26+)下载:https://jersey.github.io/download.html
- Jersey JAX-RS 2.1 RI bundle bundle contains the JAX-RS 2.1 API jar, all the core Jersey module jars as well as all the required 3rd-party dependencies.
- Jersey 2.26 Examples bundle provides convenient access to the Jersey 2 examples for off-line browsing.
- Jersey 2.26 API Documentation在线DOC:https://jersey.github.io/apidocs/latest/jersey/index.html
-
Jersey(JAX-RS 2.1 / Jersey 2.26+)下载:https://jersey.github.io/download.html
-
findJAR
- 如果需要其他Jar包,可以去findJAR网站下载:http://www.findjar.com/index.x
二、Jersey是什么?了解一下
Jersey RESTful 框架是开源的RESTful框架, 实现了JAX-RS (JSR 311 & JSR 339) 规范。
它扩展了JAX-RS 参考实现, 提供了更多的特性和工具, 可以进一步地简化 RESTful service 和 client 开发。
尽管相对年轻,它已经是一个产品级的 RESTful service 和 client 框架。与Struts类似,它同样可以和hibernate,spring框架整合。
由于Struts2+hibernate+spring整合在市场的占有率太高,所以很少一部分人去关注Jersey。
Jersey1.X的版本是sun公司提供的独立的jar包,在2.X版本中,已经将jersey放在glassfish下(开源)。
(上图原文地址:http://dyygusi.iteye.com/blog/2148029?utm_source=tuicool)
Jersey系列文章:
三、学Jersey前,先看看Maven
特别详细的配置Maven的文章,没什么可多说的,照做即可:原文地址:https://blog.csdn.net/java_2017_csdn/article/details/77450598/
【下面是我做的Step by Step截屏】
第一步、下载Maven,配置settings.xml文件
Maven下载地址: http://maven.apache.org/download.cgi
下载后放在C根目录下。打开settings.xml文件编辑。
编辑的目的是让我们的Maven项目能使用阿里云提供的Maven镜像库提升速度。
如果不做任何配置,默认Maven项目会自动连接使用maven中央库也是OK的。但是,由于中央库在国外, 受到中国防火墙等因素影响,其访问速度很慢, 只有连接到国内镜像库(例如阿里云)才能提高Maven运行速度。
settings.xml文件有2种修改方法:
(1)省事的,把下面“替换settings.xml内容”的内容替换到你本机的settings.xml文件即可,全部替换,原来的文件内容不留。
<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- 配置本地MAVEN仓库位置,默认在:C:\Users\机器名\.m2\repository <localRepository>D:\Program Files\mvn\</localRepository> ** Eclipse->Windows->Preferences->java->Build Path->Classpath Variables --> <pluginGroups> </pluginGroups> <proxies> </proxies> <servers> </servers> <mirrors> <mirror> <id>aliyun</id> <name>aliyun Maven</name> <mirrorOf>*</mirrorOf> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> </mirror> </mirrors> <profiles> </profiles> <activeProfiles> </activeProfiles> </settings>