开发环境搭建-Spring Tool Suite安装
来源:互联网 发布:芈十四知乎 编辑:程序博客网 时间:2024/05/16 08:43
在这里记录一下自己搭建spring开发环境的过程。要求电脑必须联网。
1,下载并安装jdk8。安装过程这里不详细说明了。
2,下载并安装maven。
2.1 下载maven
下载地址是http://maven.apache.org/download.cgi
我这里下载的可以直接在window上直接用的版本,apache-maven-3.5.2-bin.zip。
2.2 解压maven
在磁盘上新建一个文件夹,用来存放解压后的maven。我这里创建H:\maven文件夹。把apache-maven-3.5.2解压到maven文件夹中。然后再maven文件夹中新建respository文件夹,用来作为maven的仓库。
2.3 配置maven仓库
进入apache-maven-3.5.2文件夹中,进入conf文件夹,会看到有settings.xml文件,这个就是maven的配置文件。用写字板打开settings.xml,对配置进行修改。
找到<localRepository>/path/to/local/repo</localRepository>
,这是本地仓库的位置,我们修改成自己的文件夹<localRepository>H:\maven\respository</localRepository>
2.4 设置网络代理(能直接访问网络,跳过这步)
如果公司需要使用代理才能上网,还需要修改proxies。找到proxies标签,修改里面对应的内容。
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username><!--代理的用户名-->
<password>proxypass</password><!--代理的密码-->
<host>proxy.host.net</host><!--代理的主机名-->
<port>80</port><!--代理的端口号-->
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
</proxies>
2.5 设置镜像
镜像用来加速下载jar包的速度,设置如下
<mirrors><mirror><id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf></mirror><mirror><id>repo2</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://repo2.maven.org/maven2/</url></mirror><mirror><id>ui</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://uk.maven.org/maven2/</url></mirror><mirror><id>ibiblio</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url></mirror><mirror><id>jboss-public-repository-group</id><mirrorOf>central</mirrorOf><name>JBoss Public Repository Group</name><url>http://repository.jboss.org/nexus/content/groups/public</url></mirror> </mirrors>
2.6 设置默认jdk版本
maven默认使用jdk1.5,这里修改成默认使用1.8版本
<profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile>
到这里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"> <localRepository>H:\maven\respository</localRepository> <pluginGroups> </pluginGroups> <proxies> <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <host>proxy3.xx.xxxx</host> <port>8080</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> </proxies> <servers> </servers><mirrors><mirror><id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf></mirror><mirror><id>repo2</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://repo2.maven.org/maven2/</url></mirror><mirror><id>ui</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://uk.maven.org/maven2/</url></mirror><mirror><id>ibiblio</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url></mirror><mirror><id>jboss-public-repository-group</id><mirrorOf>central</mirrorOf><name>JBoss Public Repository Group</name><url>http://repository.jboss.org/nexus/content/groups/public</url></mirror> </mirrors> <profiles><profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile></profiles></settings>
3 下载配置Spring Tool Suite
3.1 下载Spring Tool Suite
Spring Tool Suite是为开发spring应用定制的eclipse。下载地址https://spring.io/tools/sts/all/
下载windows版本,解压得到sts-bundle文件夹。sts-bundle文件夹内有三个文件夹。进入sts-bundle下的sts-3.9.1.RELEASE文件夹,运行STS.exe,便启动了Spring Tool Suite。
3.2 修改Spring Tool Suite字体和编码
和eclipse一样。点击window->preferences,进入preferences对话框。在对话框左边点开General->Appearance->Colors And Fonts。在右边选择Basic->Text Font,点击edit进入编辑页面,设置自己喜欢的字体大小和样式。
然后,设置默认编码为utf-8。还是在preferences对话框中,左边点击General->workspace,右边向下拉,text file encoding选择other utf-8。
3.3 配置maven
在preferences对话框中,选择maven->Installations,在右边点击add
在新弹出的对话框中点击Directory按钮。选择我们解压maven 的路径
选择后Installation name会自动填入值。点击finish。
然后点击Apply and Close
配置maven仓库
在preferences对话框中,选择maven->UserSerttings。在UserSettings中选择maven中修改好的settings.xml文件,然后保存。
到这里开发环境算搭建好了,下面开始测试
- 开发环境搭建-Spring Tool Suite安装
- STS(Spring tool suite) JAVA开发环境搭建
- Spring MVC-使用Spring Tool Suite IDE搭建Spring MVC开发环境
- Spring tool suite安装
- spring tool suite在线安装
- Eclipse安装Spring-tool-suite
- eclipse安装spring tool suite插件
- Spring Tool Suite插件的安装
- eclipse安装spring tool suite插件
- eclipse安装spring tool suite插件
- springmvc学习之安装spring tool suite
- Eclipse安装Spring插件springsource-tool-suite
- Spring Tool Suite下载与安装
- Spring Tool Suite 安装 Gradle 插件
- spring tool suite安装不进去
- 在Eclipse上安装Spring Tool Suite
- eclipse安装spring source-tool-suite
- eclipse安装spring tool suite插件
- Liunx Zookeeper集群安装
- 最基础的HTML知识点
- Okabe and Banana Trees 思路题
- MySQL使用存储实现快速创建多分表
- Collections.sort()方法的使用及Comparable和comparator的qubie
- 开发环境搭建-Spring Tool Suite安装
- 正交向量和子空间学习
- ROS包全攻略:消息vs服务;可执行vs插件
- 自己来写RPC框架—第一章
- 四、Android安全机制之数据加密
- 最全的常用正则表达式大全
- 用Python实现常见机器学习算法(三)
- 机器学习之-逻辑回归算法【人工智能工程师--AI转型必修课】
- skynet学习笔记项目搭建(mac环境)