开发环境搭建-Spring Tool Suite安装
2017-12-08 16:14
344 查看
在这里记录一下自己搭建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,对配置进行修改。
找到
2.4 设置网络代理(能直接访问网络,跳过这步)
如果公司需要使用代理才能上网,还需要修改proxies。找到proxies标签,修改里面对应的内容。
2.5 设置镜像
镜像用来加速下载jar包的速度,设置如下
2.6 设置默认jdk版本
maven默认使用jdk1.5,这里修改成默认使用1.8版本
到这里settings.xml就配置好了。
我的设置如下,大家可以自行修改。
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文件,然后保存。
到这里开发环境算搭建好了,下面开始测试
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 MVC-使用Spring Tool Suite IDE搭建Spring MVC开发环境
- Spring Tool Suite(Eclipse)web开发环境
- Spring tool Suite 安装配置+maven安装配置,搭建maven项目
- 基于springsource-tool-suite的Grails环境搭建
- Spring环境配置(安装springsource-tool-suite插件)及第一个Spring HelloWorld
- JAVA懒开发:mybatis-generator安装和使用(spring-tool-suite)
- spring环境搭建需要的插件-------Spring Tool Suite™ Downloads
- Spring tool Suite 安装配置+maven安装配置,搭建maven项目
- 基于springsource-tool-suite的Grails环境搭建
- Spring tool Suite 安装配置+maven安装配置,搭建maven项目
- 安装Spring+搭建Spring开发环境
- JAVA常用API或编程工具002---SpringSource Tool Suite:基于Eclipse的Spring应用开发环境
- Windows下搭建 PHP开发环境 之 Apache php mysql 安装
- 在Eclipse3.5Galileo下,安装spring tool suite(STS)
- 搭建Open Inventor开发环境——手动安装Coin3D
- 使用VirtualBox安装Ubuntu9.10,搭建java开发环境总结
- spring2.5.6学习笔记三:搭建与测试Spring的开发环境
- 搭建Open Inventor开发环境——手动安装Coin3D
- Ruby on Rails的下载及安装以及开发环境的搭建
- Windows 下安装 S60_3rd_sdk_fp1,并在 eclipse 上搭建 Nokia 的 J2ME 开发环境