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. JavaScript_原型和继承(2017-03-15)

    一.函数创建过程 在了解原型链之前我们先来看看一个函数在创建过程中做了哪些事情,举一个空函数的例子: function A() {}; 当我们在代码里面声明这么一个空函数,js解析的本质是(肤浅理解有 ...

  2. FCKEditor在IE10下的不兼容问题解决方法

    环境介绍:FCKEditor 版本 2.x.x 问题:IE10 下FCKEditor不兼容,显示不出来 关键词:不同于其他方法之处是第一个关键点,其他网友的正则表达式不对 解放方法:(可以直接< ...

  3. android: 动态加载碎片布局的技巧

    虽然动态添加碎片的功能很强大,可以解决很多实际开发中的问题,但是它毕竟只是在 一个布局文件中进行一些添加和替换操作.如果程序能够根据设备的分辨率或屏幕大小在运 行时来决定加载哪个布局,那我们可发挥的空 ...

  4. C# ConcurrentStack实现

    我们通过C# Queue 和Stack的实现知道Stack是依靠数组实现的,那么ConcurrentStack的栈又是如何实现的了,然后它的线程安全又是怎么做到的了? 来看看其code吧 public ...

  5. 用.Net打造一个移动客户端(Android/IOS)的服务端框架NHM(四)——Android端Http访问类(转)

    本章目的 在上一章中,我们利用Hibernate Tools完成了Android Model层的建立,依赖Hibernate Tools的强大功能,自动生成了Model层.在本章,我们将继续我们的项目 ...

  6. Residual Networks

    Andrew Ng deeplearning courese-4:Convolutional Neural Network Convolutional Neural Networks: Step by ...

  7. zeromq学习笔记2——简单的客户端和服务端测试程序

    1.前言 zeromq提供了guide,http://zguide.zeromq.org/,可以帮助新手快速上手,提供了C\C++\PHP等多种语言. 2.测试程序 使用zeromq给的hwserve ...

  8. jni4net使用小结

    网站首页 http://jni4net.com/ 一个简单的例子: 1)      从这里下载binaries,然后解压缩. https://sourceforge.net/projects/jni4 ...

  9. PL/SQL学习笔记之条件控制语句

    一:IF-THEN语句 IF (condition) THEN commands; END IF; 二:IF-THEN_ELSE语句 IF (condition) THEN S1; ELSE S2; ...

  10. Kotlin VS Java:基本语法差异(转载)

    5月18号,goole宣布Kotlin成为官方支持的开发语言以来,Kotlin语言社区,公众号,qq群等全面轰炸,本文是一篇译文,来自国外的一个用户,将给大家介绍,基础语法部分Kotlin和java之 ...