maven 发布项目到nexus服务器中

首先对Nexus服务器的Repositories中的类型有个了解,主要分为group、Hosted、Proxy和Virtual四种类型。
我们只能用Hosted作为发布的目标仓库。
1、配置.m2/settings.xml

<servers>
  <server>
    <id>nexus-releases</id>
     <username>admin</username>
     <password>****</password>
  </server>
   <server>
     <id>nexus-snapshots</id>
     <username>admin</username>
     <password>****</password>
   </server>
 </servers>

2.配置项目POM.xml



nexus-releases
public
http://localhost:8080/nexus/content/repositories/releases


nexus-snapshots
Snapshots
http://localhost:8080/nexus/content/repositories/snapshots


3.发布项目
进入项目目录执行mvn deploy结束后,构件就自动加入到服务器中,其他项目就可以进行关联引用。

参考:
Maven2部署构件到Nexus时出现的Failed to transfer file错误
Maven2中需要注意的问题
maven deploy到nexus私服出错问题

Maven发布jar到本地与远程库中

由于电信短信平台二次开发中使用了maven进行项目管理,在添加依赖jar包时,需要将sendMsg_jdk1.6.jar安装到maven中,让maven自动进行加载。
使用maven2的安装命令。
命令格式如下:
1、本地发布
[color=Green]mvn install: install-file -Dfile=sendMsg_jdk1.6.jar -DgroupId=com.linkage
-DartifactId=netmsg -Dversion=2.0(jdk1.6) -Dpackaging=jar[/color]
2、远程发布
[color=Green]mvn deploy:deploy-file -DgroupId=com.link
age -DartifactId=netmsg -Dversion=2.0(jdk1.6) -Dpackaging=jar -Dfile=sendMsg_jdk
1.6.jar -Durl=http://localhost:8080/nexus/content/repositories/releases
-DrepositoryId=nexus-releases[/color]

在项目POM.xml中加入:


com.linkage
netmsg

2.0(jdk1.6)

注:关于repositoryId=nexus-releases说明,nexus-releases在.m2/settings.xml中已经配置。
参考:16.7.3. 部署第三方构件

项目管理的测试版发布

最近有时间将以前没有写完的项目管理程序进一步完善,加入了项目任务之间的关连。

功能:
1、任务的关连
Start to finish
Start to start
Finish to start
Finish to finish

2、任务关连表环路检测
3、采用MVC模式进行开发
4、自动导出XML
5、双击连接线可以设置、删除任务之间的关连

6、选中一个任务时用红线与绿线为区别影响与被影响关系

后继工作:
1、完成导入、导出Ms Project的项目文件
2、完成资源的配置和负载
下载