1,框架版本:JDK1.8 Spring-4.2.5.RELEASE hibernate-5.0.8.Final
如果用的eclipse,在菜单window -- preferences -- General -- Workspace -- Text file encoding 设置为UTF-8,这样工程下所有新建的项目编码格式都是UTF-8。
2,准备工具:我选择的是eclipse4.6.2 。
D:\Program Files\Java\jdk1.8.0_121\bin\java.exe
-startup
plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.401.v20161122-1740
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m
第一行是指定的jdk,-Dosgi.requiredJavaVersion=1.8为版本,最下面的是内存大小,mx设置为512M,设置1G项目小很浪费分配的内存空间,ms256或512。
2.1 :eclipse有了,讲下maven,maven只是一个很简单的管理插件。
maven:jar包管理仓库,方便引用可以打包,项目结构也比经典的WEB项目要清晰。
1:先搞清楚版本对应,我常用的对应是:jdk1.6对3.2.5 , jdk1.7对3.3.3 , jdk1.8对3.3.9,maven配置变量完毕后,还要修改下conf下配置文件。
2:默认是C盘user .M2下的repository,找着很费劲,而且还占用C盘空间。
maven配置:远程仓库地址引用和本地磁盘存储位置,配置好了这个,以后随便走哪里,拷贝一个配置文件settings.xml替换可以了。找到maven目录下的conf文件夹下的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">
<proxies></proxies>
<!--
<localRepository>e:\myCenterRepository</localRepository>
<localRepository>F:\greenProgram_dev\maven_serv_repo</localRepository>
-->
<servers>
<server>
<id>archiva.releases</id>
<username>deployment</username>
<password>deployment</password>
</server>
<server>
<id>archiva.snapshots</id>
<username>deployment</username>
<password>deployment</password>
</server>
<server>
<id>thirdparty</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<!-- 所有对central请求都转向 nexus groups -->
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>central</mirrorOf>
<!--
<url>http://172.168.3.202:8080/nexus/content/groups/public/</url>
<url>http://172.168.1.222:8080/nexus/content/groups/public/</url>-->
<url>http://repo1.maven.org/maven2</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>central</id>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>http://repo1.maven.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<name>Snapshots Repository</name>
<!--
<url>http://172.168.3.202:8080/nexus/content/repositories/snapshots/</url>
<url>http://172.168.1.222:8080/nexus/content/repositories/snapshots/</url>-->
<url>http://repo1.maven.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>http://repo1.maven.org/maven2</url>
<layout>default