[ 
https://issues.apache.org/jira/browse/EAGLE-581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Huizhi Lu updated EAGLE-581:
----------------------------
    Description: 
Use case:
we need to know what version(latest commit revision) of source code we are 
using for the current build so that it will be convenient for us to clarify 
different builds. So when you might make 100 builds of version 0.5.0-SNAPSHOT, 
you can differentiate between them all.

Solution:
Use buildnumber-maven-plugin
1. Add Maven plugin buildnumber-maven-plugin to pom.xml file
2. Add build property placeholders
create a build.properties file (e.g. in  src/main/resources):
build.properties:
build.version=${version}  # Maven version
build.revision=${buildNumber} # Source code revision number 
build.timestamp=${timestamp} # long value of check in time
3. Using build number in web app
@Value(“${build.revision}”)
private String buildRevision;



  was:
Use case:
we need to know what version(latest commit revision) of source code we are 
using for the current build so that it will be convenient for us to clarify 
different builds.

Solution:
Use buildnumber-maven-plugin
1. Add Maven plugin buildnumber-maven-plugin to pom.xml file
2. Add build property placeholders
create a build.properties file (e.g. in  src/main/resources):
build.properties:
build.version=${version}  # Maven version
build.revision=${buildNumber} # Source code revision number 
build.timestamp=${timestamp} # long value of check in time
3. Using build number in web app
@Value(“${build.revision}”)
private String buildRevision;




> Generate a build number when building the project.
> --------------------------------------------------
>
>                 Key: EAGLE-581
>                 URL: https://issues.apache.org/jira/browse/EAGLE-581
>             Project: Eagle
>          Issue Type: New Feature
>    Affects Versions: v0.5.0
>            Reporter: Huizhi Lu
>            Assignee: Huizhi Lu
>             Fix For: v0.5.0
>
>
> Use case:
> we need to know what version(latest commit revision) of source code we are 
> using for the current build so that it will be convenient for us to clarify 
> different builds. So when you might make 100 builds of version 
> 0.5.0-SNAPSHOT, you can differentiate between them all.
> Solution:
> Use buildnumber-maven-plugin
> 1. Add Maven plugin buildnumber-maven-plugin to pom.xml file
> 2. Add build property placeholders
> create a build.properties file (e.g. in  src/main/resources):
> build.properties:
> build.version=${version}  # Maven version
> build.revision=${buildNumber} # Source code revision number 
> build.timestamp=${timestamp} # long value of check in time
> 3. Using build number in web app
> @Value(“${build.revision}”)
> private String buildRevision;



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to