网站建设兼职工资,教学资源库网站建设立项申报书,太原市网站,seo搜索推广费用多少上一章中#xff0c;我们已经成功安装了nexus#xff0c;现在我们将在eclipse中集成maven插件#xff0c;并将nexus配置成maven的仓库。 1、安装eclipse的svn插件subeclipse#xff0c;打开你的eclipse#xff08;笔者使用的是eclipse 3.6#xff09;#xff0c;依次打开…上一章中我们已经成功安装了nexus现在我们将在eclipse中集成maven插件并将nexus配置成maven的仓库。 1、安装eclipse的svn插件subeclipse打开你的eclipse笔者使用的是eclipse 3.6依次打开help-Software Updates-Find and instill如下图 在弹出的窗口中选择第二个单选框然后下一步 点击右面的New Remote site…按钮新建一个远程插件更新地址在弹出的对话框中填写如下内容 Name:subeclipse(名字可以随便填) URL:http://subclipse.tigris.org/update_1.6.x 在短暂的读条过程之后会依次出现若干个对话框有询问的一律统一然后Next或者Finish到底就是了。之后会开始插件的安装eclipse会从远程下载插件安装安装完毕后会提示重启eclipse。如果重启后能在视图菜单中找到SVN资源库研究就说明安装成功了如图 maven插件的安装稍微要不同一点首页help-install new software…在弹出的对话框中点击add按钮然后再在弹出的对话框中填入下面的内容 Namem2e URLhttp://m2eclipse.sonatype.org/sites/m2e 在点击ok后eclipse会从远程服务器读取相关信息直到出现 勾选这条记录然后一路Next到Finish。然后eclipse会从远程服务器下载m2e插件下载速度敢不敢再慢点..擦后面的过程与安装svn插件时基本相同了在这里就不阐述了。 重庆之后如果出现如下警告请参照该地址的解决办法http://www.sunchis.com/html/hsware/software/2011/1102/371.html 好了如果在新建菜单中出现了maven的相关项就说明安装maven成功了如下图 然后我们开始配置maven将nexus配置为maven的仓库。 安装完m2e后会在用户文件夹下面的新建一个中央仓库文件夹而因为是直接安装的eclipse的m2e插件所以需要手动新建一个setting.xml文件。 进入目录C:\Users\用户名\.m2 然后新建一个settings.xml文件内容如下 settings.xml ?xml version1.0 encodingUTF-8?
settings xmlnshttp://maven.apache.org/SETTINGS/1.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/SETTINGS/1.0.0http://maven.apache.org/xsd/settings-1.0.0.xsdmirrorsmirror!--This is used to direct the public snapshots repo in the profile below over to a different nexus group --idnexus-public-snapshots/idmirrorOfpublic-snapshots/mirrorOfurlhttp://127.0.0.1:8081/nexus/content/groups/public-snapshots/url/mirrormirror!--This sends everything else to /public --idnexus/idmirrorOf*/mirrorOfurlhttp://127.0.0.1:8081/nexus/content/groups/public/url/mirror/mirrorsprofilesprofileiddevelopment/idrepositoriesrepositoryidcentral/idurlhttp://central/urlreleasesenabledtrue/enabled/releasessnapshotsenabledtrue/enabled/snapshots/repository/repositoriespluginRepositoriespluginRepositoryidcentral/idurlhttp://central/urlreleasesenabledtrue/enabled/releasessnapshotsenabledtrue/enabled/snapshots/pluginRepository/pluginRepositories/profileprofile!--this profile will allow snapshots to be searched when activated--idpublic-snapshots/idrepositoriesrepositoryidpublic-snapshots/idurlhttp://public-snapshots/urlreleasesenabledfalse/enabled/releasessnapshotsenabledtrue/enabled/snapshots/repository/repositoriespluginRepositoriespluginRepositoryidpublic-snapshots/idurlhttp://public-snapshots/urlreleasesenabledfalse/enabled/releasessnapshotsenabledtrue/enabled/snapshots/pluginRepository/pluginRepositories/profile/profilesactiveProfilesactiveProfiledevelopment/activeProfile/activeProfiles
/settings 根据Maven权威指南描述: 在你将Nexus 配置成所有仓库的镜像之后Maven 现在会从本地的 Nexus 安装查阅而非去外面查阅中央Maven 仓库。如果对Nexus 有一个构件请求本地的Nexus 安装会提供这个构件。如果 Nexus 没有这个构件Nexus 会从远程仓库获取这个构件然后添加至远程仓库的本地镜像。 要测试Nexus 如何工作的从你的本地Maven 仓库中删除一个目录然后运行Maven 构建。如果你删除了~/.m2/repository/org你会删除一大堆的依赖包括Maven 插件。下次你运行Maven 的时候你应该看到如下的信息 $ mvn clean install ... Downloading: http://localhost:8081/nexus/content/groups/public/ ... 3K downloaded 这个输出应该能让你相信Maven 正和你本地的Nexus 通讯而非向外面的中央Maven 仓库获取构件。在你基于本地的 Nexus 运行过一些构建之后你就可以浏览缓存在你本地Nexus 中的内容。登陆Nexus 然后点击导航菜单的左边的构件搜索。在搜索框中输入maven 你应该能看到一些像下面的内容。 至此为止本章的内容已经全部完成。下一章将介绍如何在该环境下创建SSH环境。转载于:https://www.cnblogs.com/fatlee/archive/2012/05/18/nexus_maven_eclipse.html