Konubinix' opinionated web of thoughts

Dependency Management and Versioning With a Maven Multi-Module Project

Fleeting

Dependency Management and Versioning With a Maven Multi-Module Project - DZone Java

[2021-02-28 Sun 14:46]

A very important use of the dependency management section is to control, consolidate, and centralize the versions of artifacts used in dependencies and inherited by all children

[2021-02-28 Sun 14:57]

We are going to modify the parent root pom.xml and add two profiles. One is versioning for Java EE 7 and the other for Java EE 8.

And with Maven, we can run:

<profiles>
  <profile>
    <id>java-ee-7-profile</id>
    <properties>
      <javax.version>7.0</javax.version>
    </properties>
  </profile>
  <profile>
    <id>java-ee-8-profile</id>
    <properties>
      <javax.version>8.0</javax.version>
    </properties>
  </profile>
</profiles>

mvn clean install -P java-ee-7-profile OR mvn clean install -P java-ee-7-profile,java-ee-8-profile for both profiles.