《maven配置和项目创建(超详细).docx》由会员分享,可在线阅读,更多相关《maven配置和项目创建(超详细).docx(24页珍藏版)》请在优知文库上搜索。
1、2.点击确定之后,打开Cmd窗口:输入mvn-VerSiOn,出现如下内容表示安装胜利。3. Maven添加本地仓库:打开本地存放maven书目例如:D:ProgramFilesapache-maven-3.2.1,将共享的配置文件(syunpan/CSaEcvsTYKgbk访问密码4199)羽盖conf文件夹下的sttings.ml覆盖后打开settings.ml文件,找至!lVlocaIRepositoryD:/PrOgramFilesjavaapache-maven-3.3.3repository,把文彳牛夹路径换成自己实际的路径IAUCpU3UUCXUUttA&AVCU14W3CkU3
2、UUXCSX*U3.IIDefault:$D:/FroaraaFlles/)ava/Apacbe-Mavcn-3.3.3/rpository?XnXraCmHOde比如:DProgramFilesapache-maven-3.3.3repo4. eclipse中的设置:为Eclipse安装Maven插件(默认已有,无需安装)为Eclipse配置MAVEN从Eclipse的菜单栏点击Windows-Preferences-MyEcIipse-Installations,将之前解压的maven添加进来,如图所示点击UserSettings运用我们自己的Maven配告,如图所示5.QPreferen
3、cestypefftertext *ndEditorsGrflInttfnetTook JvSrtttrpnWProjc1JMvMaveMMyfcIipteArchetypesDcowyInstallationsJavaEE11te9rat0nUfecycleMaPPin9,TemplatesMO必TookProfilerProjectlibraryPrj;/JPAProjettOpenAl.三ntrmApplioitionPropelOoseCtrl.WDynamicWebProjectCkH.AlCMSMUW*DBProjrt*ConnectorProjectSavectri*s.3App
4、kMionCliencProjetSaveAs.J-WebPrcctSaveAllRevertCttUSWwS方MeVenPr*?PrcktartRE1.EASE0rg.apache.maven.archetype5maven-rchetype-siteRE1.EASEorg.apache.maven.archeypesmaven-archetype-site-simpleRE1.EASEI0rg.apache.maven.archetypc5maven-archetype-webappRE1.EASEorg.apche.maven.archetype5softeu-archetype-jsf
5、RE1.EASE0rg.apache.mavefi.archetype5ofteu-archetype-seamRE1.EASEorg.apache.mavefl.archetypes5fteu-archetype-seam-5impleRE1.EASEVAsimpleJavawebapplicationShowthelastVerSi8ofArchetypeonlyIncludesnapshotarchetypesAddArchetype-AdvancedBackNextFinishCancel这里一般最常用的是选择maven-archetype-webapp其次是maven-archety
6、pe-quickstartSBNwMiNewMavtSpecifyArcGroupId:ArtifactId:vnProject-nproectKetypeparameterscom.chujrvyunrf3Version:Package:Properties0.0.1-SNAPSHOTvcom.chujnyun.cf3vibfromarchjIICaKdMlComxhujMnyunVS70.0.1-SNAPSHOTZ3com.chujnyn.cf2VVersion:GroupId:ArtifaetId:Package:Propertiesvbfromrchye:NameVlutBemOVeA
7、dvanced能DeploymentDescriptor:ArchetypeCreatedWi9JavaResources力src/main/resources飘1.ibraries JavaScriptResources DeployedResources7Q&aCvgzmain邑resourcesy龄weboppWEB-INF扇indexjspbtargetmpomxml首先maven得配Ir主要是在pomxml文件记录在这里配置好依靠的jarmaven会自动下教详纣哪批包怎么配置参考y/mvnrepository/输入即可若到配置和版本Found772resultsJUnitJUmtjn
8、*jUndef39320usagesJUmtumttesbngframeworkfoeJava,createdbyEhchCammaandKentBeck.JUnit2JUnit888usagesJuniCJurwtYleoIindXTMbnoRamewodcfiJUmtaregressiontetrgframeworkwnttebyEnchGammaandKentBeck.KisUMdbythedeveloperWhOimplementsumttstsSJava.ArquMlIanTtRunnrquiNa.)umtarqulhnjurcontnrJUmtContnrImpkimQntabon
9、fortheArqu三anProject72Q点击对应的JUnitTesbngFrameworksJUnItjuntunderJUnitisaunittestingframeworkforJava,createdbyErichGammaandK4.10underTeSbngFrameWOfkSJUnitisaunittestingframeworkforJava,createdbyErichGammaaArtifactDownload(JAR)(248KB)POMFileViewDate(Sep29z2011)HomePagehttp:/junit.orgOrganizationJUnitMa
10、venGradIeSBTRyGrapeM1.elrmgenJBUIldr!-http./Avwpository.ccdependency)juitesjmitftetld4.lIndudecommentwithlinktodedaration假如不采纳maven点击Artifact右面的dov/nload也可辂jar下载到本地。请用意!wm.sun.jetseyjerseyjsoncom.sun.jr$eyJBSeVs9tv”commonsdicommonscb8mmCgrQrSYOeJSONUbRESTFranwwocfcOJParscr6,1进入某个版本以后有些会显示下面编译像靠”就是你加入这个掰下面的也必需加入CompileDependenc