Skip to content

Commit 3f5f8bc

Browse files
authored
Readme.md: add more maven tips (mutlithread + docker servers only) (#14)
1 parent 4ce5a15 commit 3f5f8bc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ $ mvn package -pl servers/study-server -am -Dpowsybl-ws-commons.version=1.6.0-SN
2727
[INFO] Study Server [jar]
2828
```
2929

30+
### Faster Multithreaded compile (useful for the long subsequent commands)
31+
32+
add `-T 2.0C` (optionally adjust the number of threads) to the mvn command line flags to build in parallel.
33+
This has the downside of interleaving the output of all builds. An alternative is to use `mvnd` which displays
34+
an interactive progress and dumps all the build logs at the end in the correct order and has `-T2.0C` on by default and starts faster.
35+
3036
### Full java recompile for one project and dependencies
3137
A full java recompile for all dependent libs for one project can be done like this (adapt version numbers to match current versions in source poms)
3238
```
@@ -106,6 +112,20 @@ $ mvn package -pl servers/study-server -am \
106112
TODO: can the version finding be automated?
107113
TODO: should we use .mvn/maven.config to record versions and maintain the list ?
108114

115+
### Rebuild only all docker images
116+
117+
```
118+
# in maven4, aggregators automatically represent their reactor children
119+
$ cd backend/servers
120+
$ mvn install -Dpowsybl.docker.install
121+
```
122+
123+
```
124+
# maven3, semi manual hack project list with ls, to be tweaked to have the correct project list
125+
$ cd backend/servers
126+
$ mvn install -Dpowsybl.docker.install \
127+
-pl $(echo $(ls -d */) | sed -e 's/ /,/g')
128+
```
109129

110130
### Full java recompile for all docker images
111131
A full java recompile and docker image generation for all projects

0 commit comments

Comments
 (0)