Skip to content

Instantly share code, notes, and snippets.

View britter's full-sized avatar

Benedikt Ritter britter

View GitHub Profile
@britter
britter / home.html
Created December 23, 2015 13:14
Using #strings to abbreviate the git commit hash
<a href="https://github.com"
th:href="#{git.commit.link}"
th:text="${#strings.substring('__#{git.commit.hash}__', 0, 7)}"
>1bb7244</a>
@britter
britter / messages.properties
Created December 23, 2015 12:54
Using the git.commit.link build property in messages.properties
git.commit.hash=${buildNumber}
git.commit.link=${git.commit.link}
@britter
britter / pom.xml
Created December 23, 2015 12:53
Constructing the git.commit.link build property in pom.xml
<properties>
<git.commit.link>${project.scm.url}/commit/${buildNumber}</git.commit.link>
</properties>
@britter
britter / messages.properties
Created December 23, 2015 12:51
Setting the commit hash via maven
git.commit.hash=${buildNumber}
git.commit.link=https://github.com/britter/spring-boot-heroku-demo/commit/${buildNumber}
@britter
britter / home.html
Created December 23, 2015 12:45
Extention of the home.html template for reading values from messages.properties
You're currently looking at version <a href="https://github.com" th:href="#{git.commit.link}"
th:text="#{git.commit.hash}">1bb7244</a>.
@britter
britter / messages.properties
Created December 23, 2015 12:40
messages.properties with static git commit hash and GitHub link
git.commit.hash=6a398ee
git.commit.link=https://github.com/britter/spring-boot-heroku-demo/commit/6a398eeb07765c203db458c6fb2240ad1bbd4654
@britter
britter / pom.xml
Created December 23, 2015 12:40
Extracting a git commit hash using the buildnumber-maven-plugin in conjunction with resource filtering
<scm>
<url>https://github.com/britter/spring-boot-heroku-demo</url>
</scm>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>messages.properties</include>
@britter
britter / build.log
Created December 23, 2015 08:49
Heroku build log showing problem with determining git revision
-----> Using set buildpack heroku/java
-----> Java app detected
-----> Installing OpenJDK 1.8... done
-----> Executing: mvn -B -DskipTests clean dependency:list install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building spring-boot-heroku-demo 0.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
@britter
britter / HomeController.java
Created December 22, 2015 17:57
Extended HomeController showing how to format messages retrieved from a MessageSource
/*
* Copyright 2015 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Commons Imaging 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ commons-imaging ---
[INFO] Deleting /Users/bene/workspace/apache/commons/imaging/target
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-maven-3) @ commons-imaging ---