Maven仓库管理制度及流程,程序员还记得仓库的几种类型

没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
君子务本,本立而道成。
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
5.部署构件至Nexus& && 要部署构件至Nexus,在distributionManagement中提供仓库URL,然后运行mvn
deploy。Maven会通过一个简单的HTTP
PUT将项目POM和构件推入至你的Nexus安装。需要配置你项目POM中distributionManagement部分的 repository。& Xml代码&&distributionManagement&& &repository&& &&& &id&releases&/id&& &&& &name&Internal Releases&/name&& &&& &url&http://localhost:8081/nexus/content/repositories/releases&/url&& &/repository&& &snapshotRepository&& &&& &id&Snapshots&/id&& &&& &name&Internal Snapshots&/name&& &&& &url&http://localhost:8081/nexus/content/repositories/snapshots&/url&& &/snapshotRepository&& &/distributionManagement&
这样还没完,这时如果部署会报错,还要在~/.m2/settings.xml中添加如下的服务器登录信息:& Xml代码&&server&& &id&releases&/id&& &username&admin&/username&& &password&admin123&/password&& &/server&& &server&& &id&Snapshots&/id&& &username&admin&/username&& &password&admin123&/password&& &/server&
部署第三方构件:& 构件可能是私有数据库的JDBC驱动如Oracle,或者你依赖于另一个JAR,它既不开源也无法免费获得。在这样的情况下,你就需要手动拿来这些构件然后发布到你自己的仓库中。Nexus提供宿主的"third-party"仓库,就是为了这个目的。& 使用以下命令发布该文件至Nexus:& Java代码&mvn deploy:deploy-file -DgroupId=com.oracle -DartifactId=ojdbc14& -Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=ojdbc.jar&&& -Durl=http://localhost:8081/nexus/content/repositories/thirdparty&&& -DrepositoryId=thirdparty
6.Nexus监听端口& 默认情况下,Nexus监听端口8081。你可以更改这个端口,通过更改${NEXUS_HOME}/conf/plexus.properties的值,为此,停止Nexus,更改文件中applicationPort的值,然后重启Nexus。& 7.Maven Profiles& &&
Maven中的profile是一组可选的配置,可以用来设置或者覆盖配置默认值。有了profile,你就可以为不同的环境定制构建。profile可 以在pom.xml中配置,并给定一个id。然后你就可以在运行Maven的时候使用的命令行标记告诉Maven运行特定profile中的目标。以下 pom.xml使用production profile覆盖了默认的Compiler插件设置。& Xml代码& &profiles&& && &profile&& &&&& &id&production&/id&& &&&& &build&& &&&&&& &plugins&& &&&&&&&& &plugin&& &&&&&&&&&& &groupId&org.apache.maven.plugins&/groupId&& &&&&&&&&&& &artifactId&maven-compiler-plugin&/artifactId&& &&&&&&&&&& &configuration&& &&&&&&&&&&&& &debug&false&/debug&& &&&&&&&&&&&& &optimize&true&/optimize&& &&&&&&&&&& &/configuration&& &&&&&&&& &/plugin&& &&&&&& &/plugins&& &&&& &/build&& && &/profile&& &/profiles&
要使用production profile来运行mvn
install,你需要在命令行传入-Pproduction参数。要验证production
profile覆盖了默认的Compiler插件配置,可以像这样以开启调试输出(-X) 的方式运行Maven。& &&& 如果你开始大量使用Maven
profile,你会希望将profile从POM中分离,使用一个单独的文件如profiles.xml。你可以混合使用定义在pom.xml中和外部 profiles.xml文件中的profile。只需要将profiles元素放到${basedir}目录下的profiles.xml文件中,然后 照常运行Maven就可以。profiles.xml文件的大概内容如下:& Xml代码&&profiles&& &&& &profile&& &&&&& &id&development&/id&& &&&&& &build&& &&&&&&& &plugins&& &&&&&&&&& &plugin&& &&&&&&&&&&& &groupId&org.apache.maven.plugins&/groupId&& &&&&&&&&&&& &artifactId&maven-compiler-plugin&/artifactId&& &&&&&&&&&&& &configuration&& &&&&&&&&&&&&& &debug&true&/debug&& &&&&&&&&&&&&& &optimize&false&/optimize&& &&&&&&&&&&& &/configuration&& &&&&&&&&& &/plugin&& &&&&&&& &/plugins&& &&&&& &/build&& &&& &/profile&& &&& &profile&& &&&&& &id&production&/id&& &&&&& &build&& &&&&&&& &plugins&& &&&&&&&&& &plugin&& &&&&&&&&&&& &groupId&org.apache.maven.plugins&/groupId&& &&&&&&&&&&& &artifactId&maven-compiler-plugin&/artifactId&& &&&&&&&&&&& &configuration&& &&&&&&&&&&&&& &debug&false&/debug&& &&&&&&&&&&&&& &optimize&true&/optimize&& &&&&&&&&&&& &/configuration&& &&&&&&&&& &/plugin&& &&&&&&& &/plugins&& &&&&& &/build&& &&& &/profile&& &/profiles&
settings profile可以应用到所有你使用Maven构建的项目。你可以在两个地方定义settings
profile:定义在~/.m2/settings.xml中的用户特定settings
profile,或者定义在${M2_HOME}/conf/settings.xml中的全局settings profile。Maven仓库汇总 1、maven 仓库地址: 共有的仓库
私有的仓库
& 同时可以搭建自己的maven仓库:私服, 搭建的方式参考如下:
2、收集的外部仓库地址
阅读(8403)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'Maven仓库的搭建',
blogAbstract:'转载自:
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!Maven仓库私服索引配置(详细)
1首先将maven私服搭建好,
?要解决的问题
&局域网中仅有一台电脑接入Internet
?原材料:nexus-latest-bundle.zip
&解压nexus-latest-bundle.zip
&进入nexus-latest-bundle\nexus-2.10.0-02\bin\jsw目录,选择与当前操作匹配的目录
&以管理员身份运行: console-nexus.bat
&以管理员身份运行: install-nexus.bat(创建Nexus服务)
&以管理员身份运行: start-nexus.bat(启动Nexus服务)
下载maven私服工具
&Thenexus service was launched, but failed to start.
&找到nexus-latest-bundle\nexus-2.10.0-02\bin\jsw\conf\wrapper.conf文件
&找到#Set the JVM executable
&修改wrapper.java.command属性,例如: wrapper.java.command=D:\DevInstall\\jdk1.8.0_111\bin\java
?Nexus默认访问中央仓库,下载速度很慢。访问阿里云镜像则会快很多。
?阿里云镜像地址:https://maven.aliyun.com/nexus/content/groups/public/
这时候,就开始进行maven的本地仓库设置,在maven中找到conf中的settings.xml
的配置文件
这样配置后,就下载的东西,能节省仓库空间,不需要额外多一分。没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!

我要回帖

更多关于 仓库管理系统 的文章

 

随机推荐