怎样给公司定义一份完美的maven parent pom 文件
parent pom 定义你的项目模型,包括构建方式,项目环境,项目依赖,输出JavaDoc,发布source源码等等,怎样去编写一份parent pom,这里是一个现成的并正在某些项目中使用到的:点击查看GitHub源码
peaceful-basic-platform
A best global parent pom file , you can use it in jar or war project as your maven parent pom setting
<parent><groupId>com.peaceful</groupId><artifactId>peaceful-parent</artifactId><version>1.0-SNAPSHOT</version>
</parent>
peaceful-parent
The basic configuration for build setting
- project build coding:
UTF-8
- maven repositories:
repo2
default profiles:
dev
、test
、product
. The pom think project should has three running env or build env:dev、test、product. you can specify the environment by :mvn -Penv[test][product] compile[deploy][jetty:run]
The default env is dev, you can get the env value in pom by ${project.environment} and in Java code by invoke Application.getRunningMode()
setting build plugin
- buildnumber-maven-plugin:1.3 phase:validate desc:use timestamp as build version,you can get the version value by
${timestamp}
in pom.xml and get the value in Java code by invokeApplication.getBuildVersion()
- maven-jar-plugin:2.6
- maven-compiler-plugin:3.3
- maven-war-plugin:2.0.2
- maven-resources-plugin:2.7
- maven-source-plugin:2.4 phase:deploy
- maven-javadoc-plugin:2.9.1 phase:deploy
- maven-surefire-plugin:2.7 desc: default skip test
- yuicompressor-maven-plugin:1.5.0 desc:compress style file: .js .css
jetty-maven-plugin:8.1.8.v20121106 desc: start web project in jetty, default port 8888,you can change web port in your pom to override Settings
setting dependencies
- log:slf4j log4j perf4j
- test:junit
- common tools:guava、commons-lang3、httpclient
- json:fastjson
- web:jstl、javaee-api
- db:mysql、c3p0
- framework:spring、springMvc、mybatis
peaceful-common-utils
Cooperate with the parent pom configuration files, can read building basic information, such as building time, version number, running environment of the project
The parent pom define 3 kinds of profile:dev
、test
、product
。If your project use the pom as parent pom,you need add peaceful-common-utils
dependency in your pom file.
<dependency><groupId>com.peaceful</groupId><artifactId>peaceful-common-utils</artifactId><version>1.0-SNAPSHOT</version>
</dependency>
The peaceful-common-utils
will read your build info into application.properties.
get build version
Application.getVersion()
get running mode
Application.getRunningMode()
...
Application.isTest()
Application.isProduct()
Application.isDev()
get Running time
# you need invoke Application.loadToJVM() when your application start
Application.getRunningTime()
怎样给公司定义一份完美的maven parent pom 文件相关推荐
- 三步走——带你打造一份完美的数据科学家简历|(附件有PPT福利)
更多深度文章,请关注云计算频道:https://yq.aliyun.com/cloud 互联网公司的秋招已经接近尾声,实习生的招聘已提上日程.今年互联网公司就业形势严峻,建议想投身互联网的同学早做准备 ...
- 见到了“公司”定义一个Company类,那么见到了“字段”是不是也可定义一个Column类?...
既然见到了公司,我们可以定义一个Class Company ,那么我们见到了字段,是不是也可以定义一个Class ColumnInfo呢? 公司的描述信息类: 代码 public class Comp ...
- 如何制作一份完美的Facebook广告文案?让你的广告一炮而红!
很多人会想着去copy竞争对手文案,这其实也是一个不错的办法,这里我也详细说下,我们自己如何去写出比较好的广告文案. 重点,Facebook广告文案一般包括:宣传语+产品描述+促销信息+产品短连接+素 ...
- python绘制一份完美的中国地图
本文章小编将带你学会使用python绘制一份完美的中国地图~ 昨日,突地被一大早的微博热搜 #自然资源部核查处理问题中国地图# 刷屏,恍惚中看到了近日在追的<亲爱的,热爱的>.小编还沉浸在 ...
- 领英个人简介如何支持html,普通外贸业务员怎么在领英上写一份完美的自我简介( Summary)?...
原标题:普通外贸业务员怎么在领英上写一份完美的自我简介( Summary)? 在领英上撰写优质的.完美的自我简介( Summary)是非常重要的,因为我是一名外贸业务员,所以站在我的角度来说,领英是我 ...
- 学术会议墙报_干货 | 如何打造一份完美的学术墙报?
学术会议对青年学者来说相当重要.我们在会上不仅能够结识同领域的研究者,还能向同僚和前辈们展示自己.这对于大家在学术道路上的发展颇具意义.作为自我介绍的重要途径,墙报展示尤为常见.那么如何才能打造一份完 ...
- 如何开一家公司(一份必备的开公司指南)
如何开一家公司(一份必备的开公司指南) 2014年3月份,国家工商局注册公司开始实行认缴制,降低了个人创业的门槛,一元成立公司变为事实.然而,在大众创业的同时,也带来了一些困惑,要开公司,注册很简单, ...
- VSCODE编译头文件时函数没有定义的解决方案(VSCODE手动链接C文件方法)
VSCODE编译头文件时函数没有定义的解决方案(VSCODE手动链接C文件方法) 参考文章: (1)VSCODE编译头文件时函数没有定义的解决方案(VSCODE手动链接C文件方法) (2)https: ...
- python中文名字-完美解决Python2操作中文名文件乱码的问题
Python2默认是不支持中文的,一般我们在程序的开头加上#-*-coding:utf-8-*-来解决这个问题,但是在我用open()方法打开文件时,中文名字却显示成了乱码. 我先给大家说说Pytho ...
最新文章
- R语言可视化学习笔记之相关矩阵可视化包ggcorrplot
- 为什么要低温保存_渔之歌科普课堂:冷冻食品为什么要规定零下18摄氏度冷藏?...
- UA MATH563 概率论的数学基础 中心极限定理11 强大数定律 版本1:四阶矩有界
- python应用实战系列-一文教你深入解读word2vec
- Java Stream简介, 流的基本概念.
- 面向对象-----封装
- Spring RESTful错误处理
- 22. PE结构-PE详解之输入表(导入表)、屠龙刀W32Dasm(静态)、LordPE(动态)工具入门(查找dll、调用函数)
- 常用基础Linux操作命令总结与hadoop基础操作命令
- linux云自动化运维基础知识4(系统结构,vim,管理输入输出,正则表达式)
- Git1天打卡 day13-查看仓库文件改动状态
- kafka的push与poll
- 软件测试师网络工程师,【软件测试工程师(华为项目)网络工程师面试题目|面试经验】-看准网...
- HTML5-简易Canvas绘图板
- 大数据产品价值主张_大数据对商业模式创新的影响
- tiny-emitter 源码解析
- 福田中心区文化馆航拍看楼体全景VR解读
- redmine与svn完美集成方案
- Theos(六):官方文档
- 数据库基础-以命令方式创建数据库