Displaying the build time-stamp in an application
问题 I would like to display the time-stamp of when the application was built in an about box. This will allow me tracking different versions of the application. How can I retrieve this information in Java? 回答1: There's a much simpler maven solution which doesn't require the antrun plugin. Maven has a special variable maven.build.timestamp (since Maven 2.1.0-M1). <plugin> <artifactId>maven-war-plugin</artifactId> <!-- or maven-jar-plugin --> <version>2.2</version> <configuration> <archive>