Skip to content

Commit 77669dd

Browse files
committed
Move pluing into own maven module
This allows adding another module 'core' which contains the core logic which can be resued for other build tools like gradle, leiningen or sbt. Discussion for this change took place in PR #92.
1 parent c9dafa8 commit 77669dd

File tree

2,021 files changed

+230
-201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,021 files changed

+230
-201
lines changed

maven/pom.xml

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
<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/maven-v4_0_0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
4+
<parent>
5+
<groupId>pl.project13.maven</groupId>
6+
<artifactId>git-commit-id-plugin-parent</artifactId>
7+
<version>2.2.1-SNAPSHOT</version>
8+
<relativePath>../pom.xml</relativePath>
9+
</parent>
10+
11+
<artifactId>git-commit-id-plugin</artifactId>
12+
<packaging>maven-plugin</packaging>
13+
<name>Git Commit Id Plugin Maven Mojo</name>
14+
<description>
15+
git-commit-id-plugin is a plugin quite similar to
16+
https://fisheye.codehaus.org/browse/mojo/tags/buildnumber-maven-plugin-1.0-beta-4 for example but as buildnumber at
17+
the time when I started this plugin only supported CVS and SVN, something had to be done.
18+
This plugin makes basic repository information available through maven resources. This can be used to display
19+
"what version is this?" or "who has deployed this and when, from which branch?" information at runtime - making
20+
it easy to find things like "oh, that isn't deployed yet, I'll test it tomorrow" and making both testers and
21+
developers life easier.
22+
23+
The data currently exported is like this (that's the end effect from the GitRepositoryState Bean):
24+
{
25+
"branch" : "testing-maven-git-plugin",
26+
"commitTime" : "06.01.1970 @ 16:16:26 CET",
27+
"commitId" : "787e39f61f99110e74deed68ab9093088d64b969",
28+
"commitUserName" : "Konrad Malawski",
29+
"commitUserEmail" : "konrad.malawski@java.pl",
30+
"commitMessageFull" : "releasing my fun plugin :-) + fixed some typos + cleaned up directory structure + added
31+
license etc",
32+
"commitMessageShort" : "releasing my fun plugin :-)",
33+
"buildTime" : "06.01.1970 @ 16:17:53 CET",
34+
"buildUserName" : "Konrad Malawski",
35+
"buildUserEmail" : "konrad.malawski@java.pl"
36+
}
37+
38+
Note that the data is exported via maven resource filtering and is really easy to use with spring -
39+
which I've explained in detail in this readme https://github.com/ktoso/maven-git-commit-id-plugin
40+
</description>
41+
42+
<prerequisites>
43+
<maven>[${maven-plugin-api.version},)</maven>
44+
</prerequisites>
45+
46+
<properties>
47+
<maven-plugin-api.version>3.1.1</maven-plugin-api.version>
48+
49+
<jgit.version>4.0.0.201506090130-r</jgit.version>
50+
<slf4j.version>1.7.12</slf4j.version>
51+
<junit.version>4.12</junit.version>
52+
<mockito.version>2.0.5-beta</mockito.version>
53+
54+
<fest-assert.version>1.4</fest-assert.version>
55+
</properties>
56+
57+
<dependencies>
58+
<!-- MAVEN -->
59+
<dependency>
60+
<groupId>org.apache.maven</groupId>
61+
<artifactId>maven-plugin-api</artifactId>
62+
<version>${maven-plugin-api.version}</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.apache.maven</groupId>
66+
<artifactId>maven-core</artifactId>
67+
<version>${maven-plugin-api.version}</version>
68+
</dependency>
69+
70+
<dependency>
71+
<groupId>com.fasterxml.jackson.core</groupId>
72+
<artifactId>jackson-databind</artifactId>
73+
<version>2.5.1</version>
74+
</dependency>
75+
76+
<!-- Joda Time -->
77+
<dependency>
78+
<groupId>joda-time</groupId>
79+
<artifactId>joda-time</artifactId>
80+
<version>2.7</version>
81+
</dependency>
82+
83+
<!-- Guava -->
84+
<dependency>
85+
<groupId>com.google.guava</groupId>
86+
<artifactId>guava</artifactId>
87+
<version>18.0</version>
88+
</dependency>
89+
90+
<!-- IntelliJ Annotations -->
91+
<dependency>
92+
<groupId>com.intellij</groupId>
93+
<artifactId>annotations</artifactId>
94+
<version>12.0</version>
95+
</dependency>
96+
97+
<!-- JGit -->
98+
<dependency>
99+
<groupId>org.eclipse.jgit</groupId>
100+
<artifactId>org.eclipse.jgit</artifactId>
101+
<version>${jgit.version}</version>
102+
</dependency>
103+
104+
<dependency>
105+
<groupId>org.slf4j</groupId>
106+
<artifactId>slf4j-api</artifactId>
107+
<version>${slf4j.version}</version>
108+
</dependency>
109+
110+
<dependency>
111+
<groupId>org.slf4j</groupId>
112+
<artifactId>slf4j-simple</artifactId>
113+
<version>${slf4j.version}</version>
114+
</dependency>
115+
116+
<!-- Test stuff -->
117+
<dependency>
118+
<groupId>junit</groupId>
119+
<artifactId>junit</artifactId>
120+
<version>${junit.version}</version>
121+
<scope>test</scope>
122+
</dependency>
123+
124+
<dependency>
125+
<groupId>org.easytesting</groupId>
126+
<artifactId>fest-assert</artifactId>
127+
<version>${fest-assert.version}</version>
128+
<scope>test</scope>
129+
</dependency>
130+
131+
<dependency>
132+
<groupId>org.codehaus.plexus</groupId>
133+
<artifactId>plexus-utils</artifactId>
134+
<version>3.0.21</version>
135+
<scope>test</scope>
136+
</dependency>
137+
138+
<dependency>
139+
<groupId>org.mockito</groupId>
140+
<artifactId>mockito-core</artifactId>
141+
<version>${mockito.version}</version>
142+
<scope>test</scope>
143+
</dependency>
144+
145+
<dependency>
146+
<groupId>commons-io</groupId>
147+
<artifactId>commons-io</artifactId>
148+
<version>2.4</version>
149+
<type>jar</type>
150+
<scope>test</scope>
151+
</dependency>
152+
153+
<dependency>
154+
<groupId>pl.pragmatists</groupId>
155+
<artifactId>JUnitParams</artifactId>
156+
<version>1.0.4</version>
157+
<scope>test</scope>
158+
</dependency>
159+
</dependencies>
160+
161+
<build>
162+
<!-- GIT COMMIT ID PLUGIN CONFIGURATION -->
163+
<resources>
164+
<resource>
165+
<directory>src/main/resources</directory>
166+
<filtering>true</filtering>
167+
<includes>
168+
<include>**/*.properties</include>
169+
<include>**/*.xml</include>
170+
</includes>
171+
</resource>
172+
</resources>
173+
174+
<plugins>
175+
<!-- we need to create a uber-jar for https://github.com/ktoso/maven-git-commit-id-plugin/issues/196 -->
176+
<plugin>
177+
<groupId>org.apache.maven.plugins</groupId>
178+
<artifactId>maven-shade-plugin</artifactId>
179+
<version>2.3</version>
180+
<executions>
181+
<execution>
182+
<phase>package</phase>
183+
<goals>
184+
<goal>shade</goal>
185+
</goals>
186+
<configuration>
187+
<createDependencyReducedPom>false</createDependencyReducedPom>
188+
<transformers>
189+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
190+
<mainClass>pl.project13.maven.git.GitCommitIdMojo</mainClass>
191+
</transformer>
192+
</transformers>
193+
<artifactSet>
194+
<includes>
195+
<include>org.slf4j:*</include>
196+
</includes>
197+
</artifactSet>
198+
</configuration>
199+
</execution>
200+
</executions>
201+
</plugin>
202+
203+
<!--<plugin>-->
204+
<!--<artifactId>maven-plugin-plugin</artifactId>-->
205+
<!--<version>${maven-plugin-api.version}</version>-->
206+
<!--<executions>-->
207+
<!--<execution>-->
208+
<!--<id>generated-helpmojo</id>-->
209+
<!--<goals>-->
210+
<!--<goal>helpmojo</goal>-->
211+
<!--</goals>-->
212+
<!--<configuration>-->
213+
<!--<goalPrefix>git-commit-id</goalPrefix>-->
214+
<!--<helpPackageName>pl.project13.maven</helpPackageName>-->
215+
<!--</configuration>-->
216+
<!--</execution>-->
217+
<!--</executions>-->
218+
<!--</plugin>-->
219+
</plugins>
220+
</build>
221+
222+
</project>
223+

src/test/java/pl/project13/maven/git/AvailableGitTestRepo.java renamed to maven/src/test/java/pl/project13/maven/git/AvailableGitTestRepo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public enum AvailableGitTestRepo {
6868
* </pre>
6969
*/
7070
WITH_THREE_COMMITS_AND_TWO_TAGS_CURRENTLY_ON_COMMIT_WITHOUT_TAG("src/test/resources/_git_three_commits_and_two_tags_currently_on_commit_without_tag"),
71-
MAVEN_GIT_COMMIT_ID_PLUGIN(".git");
71+
MAVEN_GIT_COMMIT_ID_PLUGIN("../.git");
7272

7373
private String dir;
7474

0 commit comments

Comments
 (0)