Can you inherit the version from the parent POM in Maven?

user710818 picture user710818 · Nov 6, 2011 · Viewed 40.5k times · Source

I have a bunch of projects like:

project1
project2
project3
........
project111

Each project compiled in jar: project-1.1.1.1.jar, .... Does it possible in parent folder add pom.xml so I can define version 1 time for all projects?

Answer

bmargulies picture bmargulies · Nov 6, 2011

If you omit <version/> it inherits from the parent. However, the <parent/> element must contain a <version/> for the parent, so the version must occur in every single POM, but only once.