maven备忘

--------------------------------------------------------------------------------------------------------------------------------------------------
maven central 镜像服务器:
1. http://repository.jboss.org/nexus/content/groups/public
2. http://mirrors.ibiblio.org/pub/mirrors/maven2
3. http://repo2.maven.org/maven2
--------------------------------------------------------------------------------------------------------------------------------------------------
生成项目archetype并发布到nexus私服:
1.配置好maven\conf目录下settings.xml文件的<servers>段,如

<servers>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>release</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>

具体参考相关文章

2.在要生成archetype项目上点右键,运行方式->Maven clean,清理一下项目

3.点击Maven build...,在goal栏填写archetype:create-from-project,并运行

4.生成成功后,打开项目目录下的target\generated-sources\archetype\pom.xml文件,加入

<distributionManagement>
<repository>
<id>release</id>
<url>http://tentcoo-source:8081/nexus/content/repositories/release</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://tentcoo-source:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository></distributionManagement>

具体参考相关文章

5.打开系统控制台,进入项目目录下的target\generated-sources\archetype\,运行mvn deploy

提示build success的话,你的archetype就上传到服务器了,默认的artifactId就是原来项目的artifactId加上-archetype
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值