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:

  1. mvn org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file -Durl=http://localhost:8081/repomanager/ \
  2. -DrepositoryId=some.id \
  3. -Dfile=path/to/artifact-name-1.0.jar \
  4. -DpomFile=path-to-your-pom.xml \
  5. -Dfiles=path/to/artifact-name-1.0-debug.jar,path/to/site.pdf \
  6. -Dclassifiers=debug,site \
  7. -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

  1. mvn org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file -Durl=http://localhost:8081/repomanager/ \
  2. -DrepositoryId=some.id \
  3. -Dfile=path-to-your-artifact-jar \
  4. -DpomFile=path-to-your-pom.xml \
  5. -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. pom.xml将jar包导入

    2.5是Maven的版本

  2. mysql报错:1130 -host 'localhost' is not allowed to connect to this mysql server

    错误提示:1130 -host 'localhost' is not allowed to connect to this mysql server 原因:手贱把mysql数据库系统中mysql数据库 ...

  3. Android开源项目SlidingMenu学习(二)

    前一篇SlidingMenu学习(一)文章中了解了导入SlidingMenu到我们项目经常出现的问题,下面我们正式学习. 先看一个效果: 看到两幅图片的差别了吗,左边的一栏时可以滑动的,可以隐藏掉,现 ...

  4. Window Server 2008 R2系统备份

    1.安装Backup 2.打开Backup工具 3.一次性备份 下一步

  5. java中关于AtomicInteger的使用

    在Java语言中,++i和i++操作并不是线程安全的,在使用的时候,不可避免的会用到synchronized关键字.而AtomicInteger则通过一种线程安全的加减操作接口.咳哟参考我之前写的一篇 ...

  6. CentOS7下FTP的安装与配置

    1.安装vsftpd 1 [root@localhost modules]# yum install -y vsftpd 2.编辑ftp配置文件 1 [root@localhost modules]# ...

  7. MySQL架构与业务总结图

    MySQL架构与业务总结图如下:

  8. EditText控件设置只读

    android的文本框输入控件(EditText),有时需要设置控件为只读,最简单的方法就是在layout xml文件中设置EditText的android:editable属性值为false即可,但 ...

  9. hadoop权威指南学习(一) - 天气预报MapReduce程序的开发和部署

    看过Tom White写的Hadoop权威指南(大象书)的朋友一定得从第一个天气预报的Map Reduce程序所吸引, 殊不知,Tom White大牛虽然在书中写了程序和讲解了原理,但是他以为你们都会 ...

  10. 设置nginx和php-fpm更改上传文件大小限制

    Nginx和php默认不支持上传过大的文件.假如我们要求上传的文件大小为20M,默认配置就不允许上传了. 下面我们更改nginx和php配置,设定上传的限制为20M. Nginx配置更改 如果上传文件 ...