Inforedaster Inforedaster - 1 year ago 73
Java Question

Having the same timestamp value for all maven project modules

i have a pom parent where we declare all our variable like timestamp
and i have a maven project with 2 modules where i create artifact for each module look at this picture
my maven project

the created artifacts havn't the same value of timestamp !!
i need to set the same value of the timestamp in the version for all created artifact.

any help please

Answer Source

I have found the solution for this issue with jenkins pipeline By passing the timestamp in maven command like this :

    //Get the timestamp
        def now = new Date()
        def timestamp = now.format("yyyyMMdd-HHmmss",TimeZone.getTimeZone('GMT+2'))

       $ mvn clean install -Dcurrent.time=${timestamp}

and i just found this link :build-helper-maven-plugin

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download