Why modelVersion of pom.xml is necessary and always set to 4.0.0?

It is always set to 4.0.0 in Maven 2 and 3, because, at present, there is no other model.

Notice that modelVersion contains 4.0.0. That is currently the only supported POM version, and is always required. [source]

But it wouldn’t necessarily need to always be set to 4.0.0 if there was another version of the model. A POM has to comply with a model. Let’s say Maven 4 comes up with model 4.1. If you write your pom to comply with 4.1, it wouldn’t be compatible with Maven 3 and model 4.0.0.

It’s defined as a mandatory, possibly to enforce a specific XML model in case new models are defined.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)