0

I have a maven project and respective pom.xml files. it is just a ear file, which is getting generated with my proejct name. but i want it dyanmic with projectname_datetime.ear file using pom.xml. Can you please give me a static example which will create a ear file with current dateand time of build number with major_minor or something link that.

Thanks in Advance.

Nilesh

Nilesh
  • 33
  • 7

2 Answers2

1

See this answer: https://stackoverflow.com/a/2077869/116509. You'll also need to add

<build>      
    <finalName>${project.artifactId}-${project.version}-${maven.build.timestamp}
    </finalName>

However you should use probably be using -SNAPSHOT version numbers during development. If you want to be able to a refer to a definitive version, you can release that version. It's also possible to refer to a specific snapshot, see http://mojo.codehaus.org/versions-maven-plugin/examples/lock-snapshots.html.

Community
  • 1
  • 1
artbristol
  • 32,010
  • 5
  • 70
  • 103
0

If you are using svn for your source code management, Codehaus' buildnumber-maven-plugin may be used to put the svn revision number into the manifest of any artifact you build, including snapshots. The plugin has a goal to format timestamps too, if you need it.

user944849
  • 14,524
  • 2
  • 61
  • 83