欢迎来到天天文库
浏览记录
ID:12689143
大小:542.50 KB
页数:15页
时间:2018-07-18
《基于myeclipse搭建maven与springmvc整合图文教程(含源码)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、JDFJKDHFKAHGJHLKFHJHAKHFLJKDHFKLJASHDFKJHAKLDFHDLSFHKLDSJ本教程是基于MyEclipse环境下基于maven搭建的springmvc步骤(图文教程),文章结尾含有源码下载地址:新建mavenprojectFile->New->Project选择MavenProject选择项目路径UsedefaultWorkspacelocation默认工作空间DFSGSJDFKGHERUHJKDHKLSHDKJHKSHKFHLKGHDLSFGHDSKLFHGLDKSFHGLKFGDSJDFJKDHFKAHGJHLKFHJ
2、HAKHFLJKDHFKLJASHDFKJHAKLDFHDLSFHKLDSJ选择项目类型在ArtifactId中选择maven-archetype-webapp输入GroupID和ArtifactID,以及PackageGroupID一般写大项目名称。ArtifactID是子项目名称。DFSGSJDFKGHERUHJKDHKLSHDKJHKSHKFHLKGHDLSFGHDSKLFHGLDKSFHGLKFGDSJDFJKDHFKAHGJHLKFHJHAKHFLJKDHFKLJASHDFKJHAKLDFHDLSFHKLDSJ例如Spring的web包,GroupI
3、D:org.springframework,artifactId:spring-web。Package是默认给你建一个包,不写也可以。建好后如下图:接下来需要添加src/main/java,src/test/java,src/test/resources三个文件夹。右键项目根目录点击New->SourceFolder,建出这三个文件夹。注意不是建普通的Folder,而是SourceFolder。DFSGSJDFKGHERUHJKDHKLSHDKJHKSHKFHLKGHDLSFGHDSKLFHGLDKSFHGLKFGDSJDFJKDHFKAHGJHLKFHJHA
4、KHFLJKDHFKLJASHDFKJHAKLDFHDLSFHKLDSJ更改文件夹显示的顺序:右击->属性->OrderandExportDFSGSJDFKGHERUHJKDHKLSHDKJHKSHKFHLKGHDLSFGHDSKLFHGLDKSFHGLKFGDSJDFJKDHFKAHGJHLKFHJHAKHFLJKDHFKLJASHDFKJHAKLDFHDLSFHKLDSJ更改JDK版本:在Libraries双击JRESystemLibrary,要1.6版本更改class路径右键项目,JavaBuildPath->SourceDFSGSJDFKGHERUHJ
5、KDHKLSHDKJHKSHKFHLKGHDLSFGHDSKLFHGLDKSFHGLKFGDSJDFJKDHFKAHGJHLKFHJHAKHFLJKDHFKLJASHDFKJHAKLDFHDLSFHKLDSJ下面应该有4个文件夹。src/main/java,src/main/resources,src/test/java,src/test/resources。 双击每个文件夹的Outputfolder,选择路径。src/main/java,src/main/resources,选择target/classes;src/test/java,src/test/re
6、sources,选择target/test-classes; 选上Allowoutputfoldersforsourcefolders.点击项目名称右击,然后如图选择DFSGSJDFKGHERUHJKDHKLSHDKJHKSHKFHLKGHDLSFGHDSKLFHGLDKSFHGLKFGDSJDFJKDHFKAHGJHLKFHJHAKHFLJKDHFKLJASHDFKJHAKLDFHDLSFHKLDSJ在pom.xml中添加所需要的jar包使用MavenPOMeditor打开项目中的pom.xml文件,选择Dependencies,在Dependencies栏
7、目点击Add进行,首先弹出一个搜索按钮,例如输入spring-web,就会自动搜索关于spring-web相关的jar包,我们选择3.0.5版本的spring。将spring包全部添加进来。需要添加的其他jar包有:junit、jstl。或者点击pom.xml直接编辑pom.xml文件。这样可以直接copy过来dependencies内容。DFSGSJDFKGHERUHJKDHKLSHDKJHKSHKFHLKGHDLSFGHDSKLFHGLDKSFHGLKFGDSJDFJKDHFKAHGJHLKFHJHAKHFLJKDHFKLJASHDFKJHAKLDFHDL
8、SFHKLDSJ设置jar包的scop
此文档下载收益归作者所有