原
Maven deploy部署jar到远程私服仓库
修改maven配置文件,在$MAVEN_HOME/conf/setting.xml中增加如下配置:
<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
注意,这里配置的id为releases何snapshots,当然可以改为其他,先记得这里有过id的配置,后面有用
二、配置远程发布到私服
修改项目pom文件,,增加如下配置:
<distributionManagement>
<repository>
<id>releases</id>
<url>http://192.168.254.12:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://192.168.254.12:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
注意,这里的id就是之前配置的id
三、执行部署操作
- 方式一,直接使用
mvn deploy
命令 - 方式二,使用IDE中的maven快捷操作,以idea为例,如图,双击deploy即可:
更多内容:http://www.toocruel.net/maven-deploy/
<script>
(function(){
function setArticleH(btnReadmore,posi){
var winH = $(window).height();
var articleBox = $("div.article_content");
var artH = articleBox.height();
if(artH > winH*posi){
articleBox.css({
'height':winH*posi+'px',
'overflow':'hidden'
})
btnReadmore.click(function(){
if(typeof window.localStorage === "object" && typeof window.csdn.anonymousUserLimit === "object"){
if(!window.csdn.anonymousUserLimit.judgment()){
window.csdn.anonymousUserLimit.Jumplogin();
return false;
}else if(!currentUserName){
window.csdn.anonymousUserLimit.updata();
}
}
articleBox.removeAttr("style");
$(this).parent().remove();
})
}else{
btnReadmore.parent().remove();
}
}
var btnReadmore = $("#btn-readmore");
if(btnReadmore.length>0){
if(currentUserName){
setArticleH(btnReadmore,3);
}else{
setArticleH(btnReadmore,1.2);
}
}
})()
</script>
</article>