Skip to content

Commit 0425f5f

Browse files
committed
some read me.
1 parent 3fe4753 commit 0425f5f

File tree

1 file changed

+79
-3
lines changed

1 file changed

+79
-3
lines changed

README.md

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ So be sure to add `<extension>true</extension>` in the plugin definition to enab
2424
<version>version</version>
2525
<extension>true</extension>
2626
<configuration>
27+
<referenceBranch>refs/remotes/origin/master</referenceBranch>
2728
...
2829
</configuration>
2930
</plugin>
@@ -136,12 +137,87 @@ User properties override system properties overrides plugin configuration, overr
136137
| ignoreChanged | No | empty | Comma separated pattern of project Id's to ignore from changed project calculation. Ex. com.acme:* ignores changes from all projects with group Id com.acme. These projects are included in the build if they are considered in the default maven build. |
137138

138139

139-
## Use Cases
140+
## Getting Started
140141

142+
Let's illustrate the working principle of the plugin with a simple use case.
143+
Here we have a simple multi-module project, versioned in Git :
141144

145+
* reactor
146+
* child1
147+
* child2
148+
* grandchild1
149+
* grandchild2
150+
* child3
151+
* child4
152+
153+
If we build this project on reactor root we would see the following.
154+
155+
```bash
156+
mvn validate -Dpartial.enabled=false [94bcac6]
157+
[INFO] Scanning for projects...
158+
[INFO] Partial build disabled...
159+
[INFO] ------------------------------------------------------------------------
160+
[INFO] Reactor Build Order:
161+
[INFO]
162+
[INFO] parent
163+
[INFO] child1
164+
[INFO] child2
165+
[INFO] grandchild1
166+
[INFO] grandchild2
167+
[INFO] child3
168+
[INFO] child4
169+
[INFO]
170+
[INFO] ---------------------
171+
```
172+
173+
So far so good.
174+
Maven reactor aggregated all projects and constructed the standard build order.
175+
Let's make some changes in modules child3 and child4 and commit those.
176+
177+
```bash
178+
touch child3/file
179+
touch child4/file
180+
git commit --all -m 'modify child3 and child4'
181+
```
182+
183+
Now we activate the partial build and tell it to take into account only changes in the last commit.
184+
185+
```bash
186+
mvn validate -Dpartial.enabled=true -Dpartial.referenceBranch=HEAD~1 -Dpartial.baseBranch=HEAD [94bcac6]
187+
[INFO] Scanning for projects...
188+
[INFO] Starting Partial build...
189+
[INFO] Git root is: /Users/ogunalp/dev/partial-test/.git
190+
[INFO] Head of branch HEAD is commit of id: commit 94bcac65da63a8578fbec2b241edc7f122219c5d 1470907753 -----p
191+
[INFO] Head of branch HEAD~1 is commit of id: commit eebfc84bed00343ab2c4dd203b1c26e7771d8f6b 1470907544 -----p
192+
[INFO] Using merge base of id: commit eebfc84bed00343ab2c4dd203b1c26e7771d8f6b 1470907544 -tr-sp
193+
[INFO] ------------------------------------------------------------------------
194+
[INFO] Changed Projects:
195+
[INFO]
196+
[INFO] child4
197+
[INFO] child3
198+
[INFO]
199+
[INFO] ------------------------------------------------------------------------
200+
[INFO] Reactor Build Order:
201+
[INFO]
202+
[INFO] child3
203+
[INFO] child4
204+
[INFO]
205+
```
206+
207+
Here the plugin only included changed projects in the build session and omited the others.
208+
209+
This case was overly simplistic.
210+
The plugin does more than that.
211+
It follows dependencies between projects to calculate projects to build.
212+
It can be used in complex build configurations and integrated in your build and release lifecycle.
213+
214+
Try it out, tell us what you think.
215+
216+
## Known Issues
217+
218+
* `--resume-from` builds are not supported yet.
219+
* Changed projects console dump is not ordered.
142220

143221
## Requirements
144222

145223
- Maven version 3+.
146-
147-
## To-do

0 commit comments

Comments
 (0)