buid-helper-maven-plugin简单使用
简介
官方文档
https://www.mojohaus.org/build-helper-maven-plugin/index.html
常用的Goals
| 名称 | 说明 |
|---|---|
| build-helper:add-source | 添加一个或者多个目录到POM. |
| build-helper:add-test-source | 添加测试目录到 POM. |
| build-helper:add-resource | 添加资源目录到POM. |
| build-helper:add-test-resource | 添加测试资源目录到POM. |
| build-helper:attach-artifact | 附加要安装和部署的其他部件。 |
| build-helper:maven-version | 设置一个包含当前版本的 maven 的属性。 |
| build-helper:regex-property | 通过将正则表达式替换规则应用于提供的值来设置属性。 |
| build-helper:regex-properties | 通过将正则表达式替换规则应用于提供的值来设置属性. |
| build-helper:released-version | 解决本项目最新发布的版本. |
| build-helper:parse-version | 将版本解析为不同的属性. |
| build-helper:remove-project-artifact | 从本地存储库中删除项目的工件. |
| build-helper:reserve-network-port | 保留随机和未使用的网络端口列表. |
| build-helper:local-ip | 检索当前主机 IP 地址. |
| build-helper:hostname | 检索当前主机名. |
| build-helper:cpu-count | 检索可用 CPU 的数量. |
| build-helper:timestamp-property | 根据当前日期和时间设置属性. |
| build-helper:uptodate-property | 根据文件集的输出相对于其输入是否是最新的来设置属性. |
| build-helper:uptodate-properties | 根据多个文件集的输出相对于它们的输入是否是最新的来设置多个属性. |
| build-helper:rootlocation | 设置定义多模块构建的根文件夹的属性. |
简单用法
...
org.codehaus.mojo
build-helper-maven-plugin
3.3.0
add-source
generate-sources
add-source
some directory
...
timestamp-property
timestamp-property
current.time
yyyyMMddHHmmss
GMT+8
获得当前时间的那个,可以通过configuration的name在pom的其他地方通过${current.time}来引用当前时间