http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploying-with-classifiers.html

Beside the main artifact there can be additional files which are attached to the Maven project. Such attached filed can be recognized and accessed by their classifier.

For example: from the following artifact names, the classifier is be located between the version and extension name of the artifact.

  • artifact-name-1.0.jar the main jar which contains classes compiled without debugging information (such as linenumbers)
  • artifact-name-1.0-debug.jar the classified jar which contains classes compiled with debugging information, so will be smaller
  • artifact-name-1.0-site.pdf a pdf which contains an export of the site documentation.

You can deploy the main artifact and the classified artifacts in a single run. Let's assume the original filename for the documentation is site.pdf:

mvn org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file -Durl=http://localhost:8081/repomanager/ \
-DrepositoryId=some.id \
-Dfile=path/to/artifact-name-1.0.jar \
-DpomFile=path-to-your-pom.xml \
-Dfiles=path/to/artifact-name-1.0-debug.jar,path/to/site.pdf \
-Dclassifiers=debug,site \
-Dtypes=jar,pdf

If you only want to deploy the debug-jar and want to keep the classifier, you can execute the deploy-file like

mvn org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file -Durl=http://localhost:8081/repomanager/ \
-DrepositoryId=some.id \
-Dfile=path-to-your-artifact-jar \
-DpomFile=path-to-your-pom.xml \
-Dclassifier=bin

Note: By using the fully qualified path of a goal, you're ensured to be using the preferred version of the maven-deploy-plugin. When using mvn deploy:deploy-file its version depends on its specification in the pom or the version of Apache Maven.

classifier in maven的更多相关文章

  1. Maven之——坐标和依赖(上)

    Maven之--坐标和依赖(上) 1.    Maven坐标概念 Maven通过构件的坐标来在Maven仓库中定位到详细的构件.Maven的坐标元素包含groupId.artifactId.versi ...

  2. 读书笔记-《Maven实战》-2018/4/17

    第五章 坐标和依赖 1.如同笛卡尔坐标系一样,Maven也通过坐标三元素定位一个资源. <groupId>com.dengchengchao.test</groupId> &l ...

  3. Java学习篇之---json-lib(Maven)

    json-lib(Maven) java中用于解释json的主流工具有org.json.json-lib与gson.本篇文章介绍json-lib. 项目中要用到json-lib.在pom.xml文件里 ...

  4. Maven 相关知识点解释

    在PC端上面关于Maven的安装等情况我这里就不再复述了,不懂的请自行百度谷歌. 今天聊一下Maven 里面的结构,及相关依赖解释. groupId,artfactId,version,type,cl ...

  5. 搭建简单SBT工程实践

    在本机jdk(主要配置环境变量).scala(主要配置环境变量).sbt(主要配置①私服repositories  ②sbtconfig.txt)都已经安装且配置好的情况下. repositories ...

  6. Maven 的classifier的作用

    直接看一个例子,maven中要引入json包,于是使用了 <dependency> <groupId>net.sf.json-lib</groupId> <a ...

  7. Maven坐标 groupId artifactId version packaging classifier name

    groupId定义项目属于哪个组,这个组往往和项目所在的组织或公司存在关联.譬如在googlecode上建立一个名为myapp的项目,那么groupId就应该是com.googlecode.myapp ...

  8. maven 标签classifier 研究一下

    研究一下maven的标签: <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcn ...

  9. Maven classifier 元素妙用

    首先来看这么一个依赖 <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json- ...

随机推荐

  1. BZOJ4261 : 建设游乐场

    将图黑白染色,每个点拆成两个点,分别表示水平和竖直方向,再增加一个点以控制流量,那么每个格子都需要找两个方向去连接. $S$到每个黑点的控制点连边,流量$2$,费用$0$: 控制点向两个方向的点各连两 ...

  2. U3D面试题六

    U3D面试题大全   1.Unity中碰撞器(Collider)和触发器(Trigger)的区别? 两方都必须要有碰撞体,且一方要有刚体,但在发生碰撞的条件下,Collide碰撞器会生产 碰撞反弹的物 ...

  3. C++泛型编程(1)--自己实现C++迭代器/遍历器 iterator

    1.原理 迭代器又称为遍历器,用于访问容器中的数据,迭代器旨在算法和容器之间搭建访问的桥梁,从而使算法和数据分离,不用关心数据具体的存储细节.具体的原理描述请参考以下两个博客: [1].C++迭代器 ...

  4. mongodb.mongoose维护内嵌数组元素

    运行环境: - Nodejs - MongoDB 文档实例名: ProjectJob 文档格式如下: { "_id" : ObjectId("5bc69eb0b298b3 ...

  5. Android:使用shape制作素材

    最近看到朋友制作的Android APP使用了极少的图片,但是图形却极其丰富,问了之后得知是使用shape绘制的,有很多优点. 下面是我整理的一些素材: 预览 下面是图片预览: 代码 布局文件 < ...

  6. LeetCode Permutations问题详解

    题目一 permutations 题目描述 Given a collection of numbers, return all possible permutations. For example,[ ...

  7. QT程序打包发布

    本来感觉这是一个简单的操作,今天看见群里有人在问这个问题,他说网上查了很多都不成功,突然就想把自己初学的时候记录一下! 题目谢了QT程序的打包发布,那就是两步骤:打包+发布! 注释:这篇博文用的是Qt ...

  8. 鼠标滑过table时修改表格行的背景颜色

    方法一: #customers tr:hover { background-color: #f00; } 方法二: <tr onmouseover="style.backgroundC ...

  9. 基于SIFT特征的全景图像拼接

    基于SIFT特征的全景图像拼接 分类: image Machine learning2013-07-05 13:33 2554人阅读 评论(3) 收藏 举报 基于SIFT特征的全景图像拼接 分类: 计 ...

  10. JavaScript回调函数的实现

    https://github.com/forsigner/blog/blob/master/source/_posts/javascript-callback.md 在JavaScript中,回调函数 ...