Skip to main content

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

If I'm understanding this correctly you can use this to get SOME non-null value into your application when running under eclipse but you can't get the ACTUAL time of the build there using m2e.

I was looking (hoping) for a way to force eclipse to do the resource filtering as maven does.

On 04/17/2013 01:09 PM, Fred Bricon wrote:
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=388874#c4


On Wed, Apr 17, 2013 at 8:04 PM, Steve Cohen <scohen@xxxxxxxxxxxxxxx
<mailto:scohen@xxxxxxxxxxxxxxx>> wrote:

    Constant?  It's the time the build happened.  Please give me an
    example of how this can work.

    Thanks.


    On 04/17/2013 01:00 PM, Igor Fedorenko wrote:

        The easiest is to introduce pom profile that defines the
        property to a
        well-known constant when running inside m2e.

        --
        Regards,
        Igor

        On 2013-04-17 1:50 PM, Steve Cohen wrote:

            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
            <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
            <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
            _________________________________________________
            m2e-users mailing list
            m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
            https://dev.eclipse.org/__mailman/listinfo/m2e-users
            <https://dev.eclipse.org/mailman/listinfo/m2e-users>

        _________________________________________________
        m2e-users mailing list
        m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
        https://dev.eclipse.org/__mailman/listinfo/m2e-users
        <https://dev.eclipse.org/mailman/listinfo/m2e-users>



    _________________________________________________
    m2e-users mailing list
    m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
    https://dev.eclipse.org/__mailman/listinfo/m2e-users
    <https://dev.eclipse.org/mailman/listinfo/m2e-users>




--
"Have you tried turning it off and on again" - The IT Crowd


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users




Back to the top