Files
wahyd4.github.com/source/_posts/maven-deploy-external-jar.md
Hermes Bot 232ecd7c22 Rebuild blog source from GitHub Pages artifact
- 308 posts reverse-extracted from wahyd4.github.com (Hexo 6.3.0 + NexT 8.25)
- Hexo project with NexT theme, reading-experience custom styles
- publish-post.sh: write post -> hexo build -> PR (master untouched)
2026-08-04 09:44:07 +10:00

31 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Maven 直接部署第三方jarbundle,war包到仓库"
date: 2012-03-09 00:00:00
---
上一个月,很忙碌。到后面还没退加班到9点,所以就很久很久没有打理自己的博客了。今天说一些如何使用maven部署一个只有编译后的jar的第三方包到我们的nexus仓库服务器。通常我们说的部署都是部署一个maven项目,有pom.xml,里面写有部署管理  \*\*  \*\*元素。我们直接使用maven deploy即可以部署成功。今天我们所有的只有一个编译好的jar文件,下面开始部署
我们将使用 mvn deploy:deploy-file 命令执行部署。在命令行中输入下面命令:
```xml
mvn deploy:deploy-file
-Dfile=
-DgroupId=
-DartifactId =
-Dversion=
-Dpackaging =
-Drep[ositoryId =
-Durl =
```
回车即可执行了,需要注意的是,版本里面定义的snapshots 和release 要和后面部署的仓库地址对应哦,即是:snaposhot版本只能部署到snapshot仓库。这个很重要。
如果你确保所有信息都输入正确,仍然不能部署成功,请尝试 mvn -e deploy:deploy-file