Created
May 23, 2016 20:51
-
-
Save philippreston/15b9ac39880fd910ceea22dadaa253c9 to your computer and use it in GitHub Desktop.
Create version file in Gradle - Spring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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