Skip to content

Instantly share code, notes, and snippets.

@philippreston
Created May 23, 2016 20:51
Show Gist options
  • Save philippreston/15b9ac39880fd910ceea22dadaa253c9 to your computer and use it in GitHub Desktop.
Save philippreston/15b9ac39880fd910ceea22dadaa253c9 to your computer and use it in GitHub Desktop.
Create version file in Gradle - Spring
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.PropertySource
@Configuration
@PropertySource('classpath:application.properties')
class AppConfig {
@Value('${app.version.major}')
def major
@Value('${app.version.minor}')
def minor
@Value('${app.version.patch}')
def patch
@Value('${app.version.release}')
def release
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment