I have a project Maven ear modules, and i like to rename the ear from ProjectIt-4.1.0.ear to ProjectIt-4_1_0.ear in fact to have a version like that : x_y_z to resolve a deployement contraints
Asked
Active
Viewed 363 times
0
-
Did you already tried something ? Something like : http://stackoverflow.com/questions/18173316/maven-ear-plugin-rename-the-app – yunandtidus Oct 29 '14 at 10:21
-
Yes, but i need to rename juste version from x.y.z to x_y_z – Inforedaster Oct 29 '14 at 10:25
-
And you want this to be automaticaly done ... I see – yunandtidus Oct 29 '14 at 10:26
-
yes automatically to deliver thé artifact to à deployment mechanism – Inforedaster Oct 29 '14 at 11:42
-
I believe the version can only contain numbers and dots: http://stackoverflow.com/questions/3724415/maven-artifact-and-groupid-naming – Display Name is missing Oct 29 '14 at 17:05
1 Answers
0
You can define a custom property holding your key with your own separtor between major, minor and maintenance version. Then you can use that property in the build name of your artifact:
<project>
...
<properties>
<custom.version>x_y_z</custom.version>
</properties>
...
<build>
<finalName>${project.artifactId}-${custom.version}</finalName>
</build>
</project>
Meanwhile, I wouldn't advice such a method of shipping artifacts version, because it would not fit the common version syntax. You can read more about Semantic Versionin in semver.

tmarwen
- 15,750
- 5
- 43
- 62
-
Thank's for answer, but in this case i must update the version in every version increment :( – Inforedaster Oct 30 '14 at 08:53
-
Sure, that is why it would be better if you stick to the default schema. The release plugin won't be able to do the incrementation for you. – tmarwen Oct 30 '14 at 11:00