将Jar安装到本地仓库和Jar上传到私服
举例
1. 依赖如下:
- <dependency>
- <groupId>org.quartz-scheduler.internal</groupId>
- <artifactId>quartz-terracotta-bootstrap</artifactId>
- <version>2.2.2-SNAPSHOT</version>
- </dependency>
将Jar包安装到本地仓库命令:
- mvn install:install-file -Dfile=D:\quartz-terracotta-bootstrap-2.2.2-SNAPSHOT.jar -DgroupId=org.quartz-scheduler.internal -DartifactId=quartz-terracotta-bootstrap -Dversion=2.2.2-SNAPSHOT -Dpackaging=jar
-- DgroupId和DartifactId构成了该jar包在pom.xml的坐标, 对应依赖的DgroupId和DartifactId
-- Dfile表示需要上传的jar包的绝对路径
-- Dpackaging 为安装文件的种类
2. 上传Jar到私服
命令:
- mvn deploy:deploy-file -DgroupId=org.terracotta.toolkit -DartifactId=terracotta-toolkit-api-internal -Dversion=1.12 -Dpackaging=jar -Dfile=D:\terracotta-toolkit-api-internal-1.12.jar -Durl=http://ip:port/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty
-- DgroupId和DartifactId构成了该jar包在pom.xml的坐标, 对应依赖的DgroupId和DartifactId
-- Dfile表示需要上传的jar包的绝对路径
-- Durl私服上仓库的url精确地址(打开nexus左侧repositories菜单,可以看到该路径)
-- DrepositoryId服务器的表示id,在nexus的configuration可以看到
mvn install:install-file -Dfile=D:\test\com.exmyth.gprinter.jar -DgroupId=com.exmyth -DartifactId=gprinter -Dversion=1.0 -Dpackaging=jar
mvn install:install-file -DgroupId=com.exmyth -DartifactId=gprinter -Dversion=1.0 -Dfile=D:\test\com.exmyth.gprinter.jar -Dpackaging=jar -DgeneratePom=true -DlocalRepositoryPath=D:\test\mvn -DcreateChecksum=true
mvn deploy:deploy-file -DgroupId=com.exmyth -DartifactId=gprinter -Dversion=1.0 -Dpackaging=jar -Dfile=D:\test\com.exmyth.gprinter.jar -Durl=http://192.168.199.182:9091/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty
本地
D:\test\mvn>mvn install:install-file -Dfile=D:\test\com.exmyth.gprinter.jar -D
groupId=com.exmyth -DartifactId=gprinter -Dversion=1.0 -Dpackaging=jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM)
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom
---
[INFO] Installing D:\test\com.exmyth.gprinter.jar to D:\repository\com\exmyth\gp
rinter\1.0\gprinter-1.0.jar
[INFO] Installing C:\Users\WPWL\AppData\Local\Temp\mvninstall8371599131162576038
.pom to D:\repository\com\exmyth\gprinter\1.0\gprinter-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.528 s
[INFO] Finished at: --21T13::+:
[INFO] Final Memory: 7M/123M
[INFO] ------------------------------------------------------------------------
私服
D:\test\mvn>mvn deploy:deploy-file -DgroupId=com.exmyth -DartifactId=gprinter -D
version=1.0 -Dpackaging=jar -Dfile=D:\test\com.exmyth.gprinter.jar -Durl=http://
192.168.199.182:/nexus/content/repositories/thirdparty/ -DrepositoryId=third
party
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM)
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) @ standalone-pom --
-
Uploading: http://192.168.199.182:9091/nexus/content/repositories/thirdparty/com
/exmyth/gprinter/1.0/gprinter-1.0.jar
Uploading: http://192.168.199.182:9091/nexus/content/repositories/thirdparty/com
/exmyth/gprinter/1.0/gprinter-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.726 s
[INFO] Finished at: --21T14::+:
[INFO] Final Memory: 8M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts:
Could not transfer artifact com.exmyth:gprinter:jar:1.0 from/to thirdparty (htt
p://192.168.199.182:9091/nexus/content/repositories/thirdparty/): Failed to tran
sfer file: http://192.168.199.182:9091/nexus/content/repositories/thirdparty/com
/exmyth/gprinter/1.0/gprinter-1.0.jar. Return code is: , ReasonPhrase: Unauth
orized. -> [Help ]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help ] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception D:\test\mvn>
将Jar安装到本地仓库和Jar上传到私服的更多相关文章
- Maven:将Jar安装到本地仓库和Jar上传到私服
1.依赖如下: <dependency> <groupId>org.quartz-scheduler.internal</groupId> <artifact ...
- Maven : 将Jar安装到本地仓库和Jar上传到私服 转
http://blog.csdn.net/we_shell/article/details/49819221 Jar的maven配置 <dependency><groupId> ...
- maven如何将本地jar安装到本地仓库
1.首先确认你的maven是否已经配置: 指令:mvn -v 2.本地的jar包位置: 3.在自己项目pom.xml中添加jar依赖: <dependency> <groupId&g ...
- github将本地仓库的代码上传到Github
本篇主要参考博文:https://blog.csdn.net/IT_faquir/article/details/52516214 你要先完成上一篇的操作,即将代码上传到本地仓库中,才能上传到gith ...
- Maven 手动把本地jar安装到本地仓库
首先,你要安装的.jar包要下载下来放在电脑上面,然后maven已经配置好了,如下图: 然后,执行一下命令就可以了 mvn install:install-file -Dfile=path-to-fi ...
- maven——将jar安装到本地仓库
环境变量MAVEN_HOME配置正确后,cmd窗口执行此命令: mvn install:install-file -Dfile=C:\hehe.jar -DgroupId=com.rockontro ...
- git入门手册:git的基本安装,本地库管理,远程上传
前言: git是分布式的版本库控制系统,它能方便你将自己的代码寄存于远程服务器上,从而实现集体合作开发.git有GUI 图形界面,然而使用终端命令仍是主流.以下基于Ubuntu系统操作git(其方式也 ...
- 本地jar包安装到本地仓库
将本地jar包安装到本地仓库中,记得参数上有双引号 mvn install:install-file -Dfile="jar全路径" -DgroupId="groupId ...
- 本地jar包 安装到本地仓库中的命令
maven 项目 本地jar包 安装到本地仓库中去: 首先进入到该文件所在文件夹内 若不在直接绝对路径就可以.注意命令中的空格 mvn install:install-file -Dfile=文件名 ...
随机推荐
- Ruby: 获取IE的一些信息(其实应用AutoIt脚本本身,获取这些信息更加简单)
require'win32/registry' hkey_local_machine=Win32::Registry::HKEY_LOCAL_MACHINE defgetKeyValue(hive, ...
- 洛谷 P1315 观光公交 —— 贪心
题目:https://www.luogu.org/problemnew/show/P1315 问题是想不明白改动一条边会对后面造成怎样的影响: 实际上影响的会是一段,当某个车站出发时间受其来人牵制时, ...
- zabbix 监控ssdb
zabbix 的啥基础知识啥的,请看由本站大牛凉白开先生写的zabbix教程.这里说说如何监控ssdb.SSDB 是一个 C/C++ 语言开发的高性能 NoSQL 数据库, 支持 KV, list, ...
- [转]如何用git将项目代码上传到github
注册账户以及创建仓库 要想使用github第一步当然是注册github账号了.之后就可以创建仓库了(免费用户只能建公共仓库),Create a New Repository,填好名称后Create,之 ...
- Hardcoded string "下一步", should use @string resource警告 (转载)
转自:http://blog.csdn.net/iqv520/article/details/7579513 在布局文件中,文本的设置使用如下写法时会有警告:Hardcoded string &quo ...
- 【插件开发】—— 13 GEF双击模型事件
前文回顾: 1 插件学习篇 2 简单的建立插件工程以及模型文件分析 3 利用扩展点,开发透视图 4 SWT编程须知 5 SWT简单控件的使用与布局搭配 6 SWT复杂空间与布局搭配 7 SWT布局详解 ...
- 【牛客-14602】xinjun与阴阳师(01背包)
xinjun与阴阳师 题目描述 xinjun是各类手游的狂热粉丝,因随手一氪.一氪上千而威震工大,现在他迷上了阴阳师.xinjun玩手游有一个习惯,就是经过层层计算制定出一套方案来使操作利益最大化(因 ...
- Elasticsearch的功能、使用场景以及特点
1.Elasticsearch的功能,干什么的 2.Elasticsearch的适用场景,能在什么地方发挥作用 3.Elasticsearch的特点,跟其他类似的东西不同的地方在哪里 1.Elasti ...
- Miller&&Pollard POJ 1811 Prime Test
题目传送门 题意:素性测试和大整数分解, N (2 <= N < 254). 分析:没啥好讲的,套个模板,POJ上C++提交 收获:写完这题得到模板 代码: /************** ...
- 题解报告:hdu 1230 火星A+B(字符串)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1230 Problem Description 读入两个不超过25位的火星正整数A和B,计算A+B.需要 ...