I am looking for a restructuring of a large Maven project ...
A basic overview of our current structure:
build [MVN plugins, third party dependency management]:5.1
NRW Utils:6.0.0.0-beta12-SNAPSHOT
server-utils:6.0.0.0-beta12-SNAPSHOT
...
CMW Root:6.0.0.0-beta12-SNAPSHOT
cmw-webapp:6.0.0.0-beta12-SNAPSHOT
cmw-core [dependencies on NRW Utils]:6.0.0.0-beta12-SNAPSHOT
...
NRW Root :6.0.0.0-beta12-SNAPSHOT
nrw-webapp [depends on NRW Utils & CMW Root modules]:6.0.0.0-beta12-SNAPSHOT
...
Reason for change:
The size of each collective module (i.e., NRW Utils, CMW root, and NRW root) becomes larger and the build process begins to take an unbearable amount of time (sometimes ~ 4 hours).
New plan:
build [MVN plugins, third party dependency management]:5.1
NRW Utils:6.0.0.0-NU-beta4-SNAPSHOT
server-utils:6.0.0.0-NU-beta4-SNAPSHOT
...
CMW Root:6.0.0.0-CMW-beta12-SNAPSHOT
cmw-webapp:6.0.0.0-CMW-beta12-SNAPSHOT
cmw-core [dependencies on NRW Utils]:6.0.0.0-CMW-beta12-SNAPSHOT
...
NRW Root :6.0.0.0-NRW-beta9-SNAPSHOT
nrw-webapp [depends on NRW Utils & CMW Root modules]:6.0.0.0-NRW-beta9-SNAPSHOT
...
We began to introduce “keys” in the version in order to distinguish between different “collective modules” and, therefore, stepwise releases can be easily performed. In addition, our utility modules are much more stable, so we may not need almost as many beta versions - now there are no restrictions on keeping beta numbers in sync.
, 5 " " ( 3), ( ), , , 5 POM.
POM " " .
:
build [MVN plugins, third party dependency management]:5.1
nrw-version-management:6.0.0.0-beta-SNAPSHOT
[contains properties defining latest versions of each collective module]
NRW Utils:6.0.0.0-NU-beta4-SNAPSHOT
server-utils:6.0.0.0-NU-beta4-SNAPSHOT
...
CMW Root:6.0.0.0-CMW-beta12-SNAPSHOT
cmw-webapp:6.0.0.0-CMW-beta12-SNAPSHOT
cmw-core [dependencies on NRW Utils]:6.0.0.0-CMW-beta12-SNAPSHOT
...
NRW Root :6.0.0.0-NRW-beta9-SNAPSHOT
nrw-webapp [depends on NRW Utils & CMW Root modules]:6.0.0.0-NRW-beta9-SNAPSHOT
...
nrw-version-management (pom.xml):
...
<parent>
<groupId>com.project</groupId>
<artifactId>build</artifactId>
<version>5.1</version>
</parent>
<groupId>com.project</groupId>
<artifactId>nrw-versions-manager</artifactId>
<version>6.0.0.0-beta-SNAPSHOT</version>
<name>Version Maven Properties</name>
<description>A centralised place for all module property versions</description>
<packaging>pom</packaging>
<properties>
<nrw.utilities.version>6.0.0.0-NU-beta4-SNAPSHOT</nrw.utilities.version>
<nrw.cmw.version>6.0.0.0-CMW-beta12-SNAPSHOT</nrw.cmw.version>
<nrw.version>6.0.0.0-NRW-beta9-SNAPSHOT</nrw.version>
</properties>
...
CMW (pom.xml):
...
<parent>
<groupId>com.project</groupId>
<artifactId>nrw-versions-manager</artifactId>
<version>${nrw.core.version}</version>
...
</parent>
<groupId>com.project</groupId>
<artifactId>CMW-root</artifactId>
<version>6.0.0.0-CMW-beta12-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
...
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>server-utils</artifactId>
<version>${nrw.utilities.version}</version>
</dependency>
...
</dependencyManagement>
<profiles>
<profile>
<id>all</id>
<modules>
<module>cmw-webapp</module>
<module>cmw-core</module>
...
</modules>
</profile>
...
</profiles>
...
N.B. ${nrw.core.version} 6.3.0.0-beta-SNAPSHOT ( ).
( 6.0.0.0):
- 5.1,
- nrw-version-management 6.0.0.0 ( , )
- Build NRW Utils 6.0.0.0-NU
cmd args: -Dnrw.core.version = 6.0.0.0
- Build CMW Root 6.0.0.0-CMW
cmd args: -Dnrw.core.version = 6.0.0.0 -Dnrw.utilities.version = 6.0.0.0-NU
- Build NRW Root 6.0.0.0-NRW
cmd args: -Dnrw.core.version = 6.0.0.0 -Dnrw.utilities.version = 6.0.0.0-NU -Dnrw.cmw.version = 6.0.0.0-CMW
- nrw-version-management 6.0.0.0
cmd args: -Dnrw.core.version = 6.0.0.0 -Dnrw.utilities.version = 6.0.0.0-NU -Dnrw.cmw.version = 6.0.0.0-CMW
- nrw-version-management 6.1.0.0-beta-SNAPSHOT dev POM
:
, nrw.
, :
'version' ,
, , , ( ):
:
.