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. 部署第三方构件

下面文章或许你还感兴趣

  • maven 发布项目到nexus服务器中
  • 解决Spring Tool Suite和Maven2找不到JDK的问题
  • Maven2 常用命令
  • 转-MyEclipse9 破解方法
  • FWD: Creating an Executable Apache Pivot App using Maven
  • 收藏 M2Eclipse:Maven Eclipse插件无法搜索远程库的解决方法
  • Maven 2 JasperReports Plugin配置
  • Flexmojos Using ASDoc
  • 收藏Flexmojos Adding libraries to compilation
  • flexmojos 创建flex项目常用构建命令

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>