Skip to content

Commit a9d91e6

Browse files
committed
Get version from git commit or tag
1 parent 01fd5d3 commit a9d91e6

File tree

1 file changed

+82
-9
lines changed

1 file changed

+82
-9
lines changed

pom.xml

Lines changed: 82 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
53
<modelVersion>4.0.0</modelVersion>
6-
74
<groupId>com.exceljava</groupId>
85
<artifactId>strata-excel</artifactId>
9-
<version>1.1-SNAPSHOT</version>
6+
<version>SNAPSHOT</version>
107
<packaging>jar</packaging>
118
<name>Strata-Excel</name>
129
<description>Excel bindings for Strata</description>
13-
10+
1411
<!-- ==================================================================== -->
1512
<build>
13+
<finalName>${project.artifactId}-${version.number}</finalName>
14+
1615
<resources>
1716
<resource>
1817
<directory>src/main/resources</directory>
18+
<filtering>true</filtering>
19+
<includes>
20+
<include>**/*.properties</include>
21+
<include>**/*.xml</include>
22+
<include>**/*.txt</include>
23+
</includes>
1924
</resource>
2025
</resources>
26+
2127
<plugins>
2228
<plugin>
2329
<groupId>org.apache.maven.plugins</groupId>
2430
<artifactId>maven-compiler-plugin</artifactId>
31+
<version>3.8.0</version>
2532
<configuration>
2633
<source>1.8</source>
2734
<target>1.8</target>
2835
</configuration>
2936
</plugin>
37+
3038
<plugin>
3139
<artifactId>maven-dependency-plugin</artifactId>
3240
<executions>
@@ -41,9 +49,72 @@
4149
</execution>
4250
</executions>
4351
</plugin>
52+
53+
<plugin>
54+
<groupId>pl.project13.maven</groupId>
55+
<artifactId>git-commit-id-plugin</artifactId>
56+
<version>2.2.5</version>
57+
<executions>
58+
<execution>
59+
<phase>validate</phase>
60+
<goals>
61+
<goal>revision</goal>
62+
</goals>
63+
</execution>
64+
</executions>
65+
<configuration>
66+
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
67+
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
68+
<generateGitPropertiesFile>false</generateGitPropertiesFile>
69+
<injectAllReactorProjects>true</injectAllReactorProjects>
70+
</configuration>
71+
</plugin>
72+
73+
<plugin>
74+
<artifactId>maven-install-plugin</artifactId>
75+
<version>2.4</version>
76+
<executions>
77+
<execution>
78+
<id>default-install</id>
79+
<phase>install</phase>
80+
<goals>
81+
<goal>install</goal>
82+
</goals>
83+
</execution>
84+
</executions>
85+
<configuration>
86+
<skip>true</skip>
87+
</configuration>
88+
</plugin>
89+
90+
<plugin>
91+
<artifactId>maven-install-plugin</artifactId>
92+
<version>2.4</version>
93+
<executions>
94+
<execution>
95+
<id>default-install</id>
96+
<phase>install</phase>
97+
<goals>
98+
<goal>install-file</goal>
99+
</goals>
100+
</execution>
101+
</executions>
102+
<configuration>
103+
<file>${project.basedir}/target/${artifactId}-${version.number}.${project.packaging}</file>
104+
<groupId>${project.groupId}</groupId>
105+
<artifactId>${project.artifactId}</artifactId>
106+
<version>${version.number}</version>
107+
<packaging>jar</packaging>
108+
</configuration>
109+
</plugin>
44110
</plugins>
45111
</build>
46-
112+
113+
<!-- ==================================================================== -->
114+
<properties>
115+
<version.number>${git.commit.id.describe-short}</version.number>
116+
</properties>
117+
47118
<!-- ==================================================================== -->
48119
<dependencies>
49120
<!-- Jinx -->
@@ -52,22 +123,24 @@
52123
<artifactId>jinx</artifactId>
53124
<version>[1.0.0,)</version>
54125
</dependency>
55-
126+
56127
<!-- OpenGamma, relying on transitive dependencies -->
57128
<dependency>
58129
<groupId>com.opengamma.strata</groupId>
59130
<artifactId>strata-measure</artifactId>
60131
<version>2.0.0</version>
61132
</dependency>
133+
62134
<dependency>
63135
<groupId>com.opengamma.strata</groupId>
64136
<artifactId>strata-report</artifactId>
65137
<version>2.0.0</version>
66138
</dependency>
139+
67140
<dependency>
68141
<groupId>com.opengamma.strata</groupId>
69142
<artifactId>strata-loader</artifactId>
70143
<version>2.0.0</version>
71144
</dependency>
72145
</dependencies>
73-
</project>
146+
</project>

0 commit comments

Comments
 (0)