Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] Accessing ${maven.build.timestamp} while running in eclipse

I am building a standalone java project with maven and it needs to display the build timestamp in the application.

Based on http://stackoverflow.com/questions/13228472/how-to-acces-maven-build-timestamp-for-resource-filtering

which refers to

http://java.dzone.com/tips/stamping-version-number-and

which in turn refers to a bug in maven

I define the following property in my pom

<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>

and then in a property resource, define

build.date=${timestamp}.

This works fine when I build using Maven explicitly, but does not work when running the application from within eclipse.

Is there some way I can make m2e do this resource filtering when running code from eclipse?

Thanks


Back to the top