From a280b4ae9304a15496e8e276310e11fb5b19db7a Mon Sep 17 00:00:00 2001
From: srosse <stephane.rosse@frentix.com>
Date: Mon, 18 Jun 2018 09:31:26 +0200
Subject: [PATCH] no-jira: enhance gitignore, modify pom to search build
 numbers with git

---
 .gitignore | 36 +++++++++++++++++++++++++++---------
 pom.xml    | 22 +++++++++++-----------
 2 files changed, 38 insertions(+), 20 deletions(-)

diff --git a/.gitignore b/.gitignore
index 15c7af78fb1..8c101b5152d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,29 @@
+/bin/
+/target/
+/cargo/
+/.settings/
+
+# deprecated scripting files
+*.pl
+*.php
+
+# editor backup files
+*~
+*.bak
+*.swp
+
+# sundry useless files
+*.out
+mvn*.log
+
+# Mac idiosyncrasies
+.DS_Store
+
+#ignore project/.classpath file at this gets created by maven
+.classpath
+.project
+src/main/java/olat.local.properties
+
 .classpath
 /.project
 /.settings
@@ -5,12 +31,4 @@
 *.sw?
 */.classpath
 */.project
-*/.settings/*
-*/.settings/org.eclipse.core.resources.prefs
-*/.settings/org.eclipse.wst.common.component
-*/.settings/org.eclipse.wst.common.project.facet.core.xml
-*/.settings/org.eclipse.jdt.core.prefs
-*/.settings/org.eclipse.m2e.core.prefs
-*/.settings/org.eclipse.wst.jsdt.ui.*
-*/.settings/org.sonarlint.*
-*/.settings/.jsdtscope
\ No newline at end of file
+
diff --git a/pom.xml b/pom.xml
index 476a5dee020..d1c1540715f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1198,22 +1198,22 @@
 			</testResource>
 		</testResources>
 		<plugins>
-			<!-- Set the build number from mercurial -->
+			<!-- Set the build number from git -->
 			<plugin>
-				<groupId>org.openolat.mojo</groupId>
-				<artifactId>buildnumber-maven-plugin</artifactId>
-				<version>1.2.0</version>
+				<groupId>pl.project13.maven</groupId>
+				<artifactId>git-commit-id-plugin</artifactId>
+				<version>2.2.4</version>
 				<executions>
 					<execution>
-						<phase>validate</phase>
+						<id>get-the-git-infos</id>
 						<goals>
-							<goal>hgchangeset</goal>
+							<goal>revision</goal>
 						</goals>
+						<phase>validate</phase>
 					</execution>
 				</executions>
 				<configuration>
-					<doCheck>true</doCheck>
-					<doUpdate>true</doUpdate>
+					<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
 				</configuration>
 			</plugin>
 			<plugin>
@@ -1345,9 +1345,9 @@
 								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
 							</manifest>
 							<manifestEntries>
-								<Build-Change-Set>${changeSet}</Build-Change-Set>
-								<Build-Change-Set-Date>${changeSetDate}</Build-Change-Set-Date>
-								<Build-Revision-Number>${revisionNumber}</Build-Revision-Number>
+								<Build-Change-Set>${git.commit.id}</Build-Change-Set>
+								<Build-Change-Set-Date>${git.commit.time}</Build-Change-Set-Date>
+								<Build-Revision-Number>${git.commit.id.abbrev}</Build-Revision-Number>
 								<Implementation-Build>${buildNumber}</Implementation-Build>
 							</manifestEntries>
 						</archive>
-- 
GitLab