0

I'm using buildnumber-maven-plugin and maven-war-plugin to generate and put SVN revision into manifest.mf file in my WAR file as an entry.

<Implementation-Build>${buildNumber}</Implementation-Build>

So far, so good.

I would like to display it on Tapestry page (5.3.6 version). How would I do that? What is the best approach?

MartinC
  • 546
  • 11
  • 26

3 Answers3

0

Question previously answered :

Reading my own Jar's Manifest

Manifest API on JDK Javadoc

Community
  • 1
  • 1
gma
  • 2,563
  • 15
  • 14
0
<html t:type="layout" title="" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
    <div>
        <h4>Version:</h4>
             ${project.version}
        <h4>Revision:</h4>
            ${buildNumber}
    </div>
</html>
MartinC
  • 546
  • 11
  • 26
0

Add in your MANIFEST.MF

Implementation-Build

Implementation-Version: 11111

In your AppModule.java

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration) {
    .......
    String version = "0";
    if (null != AppModule.class.getPackage()) {
        version = AppModule.class.getPackage().getImplementationVersion();
    }

    configuration.add(SymbolConstants.APPLICATION_VERSION, version);
    .......
}

Add property in your page class

@Inject
@Symbol(SymbolConstants.APPLICATION_VERSION)
@Property
protected String buildNumber;
xl0e
  • 361
  • 3
  • 9
  • hey, thank you, I will try it out. I've noticed that my solution displays buildnumber of the particular page only, which is wrong. – MartinC Jun 17 '13 at 07:34