Skip to content

Commit 8d186bf

Browse files
authored
Merge pull request #27 from GianDeManincor/adding-commit-and-rollback-documentation
Enhance How to use it documentation
2 parents 2836ad9 + 0fb84bc commit 8d186bf

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Facilitate manipulation such as managing POM dependencies through CLI (command l
1414

1515
== How to use it
1616

17+
==== Add a dependency
18+
1719
Let's suppose that you need to add JUnit Jupiter version 5.9.2 into your POM in the test scope, you could perform the following command inside on the target maven project:
1820

1921
[source, sh]
@@ -41,6 +43,37 @@ Then you'll be able to perform the plugin by its prefix:
4143
mvn pom-editor:add-dep -Dgav='org.junit.jupiter:junit-jupiter:5.9.2' -Dscope=test
4244
----
4345

46+
==== Confirm the changes
47+
48+
When you perform the goal add-dep with the command below:
49+
50+
[source,sh]
51+
$ mvn pom-editor:add-dep -Dgav='junit:junit:4.13'
52+
53+
The plugin will create a backup POM file based on the target POM if such one doesn't exist.
54+
55+
[source,sh]
56+
$ tree .
57+
.
58+
├── pom.xml
59+
└── pom.xml.backup
60+
61+
You could perform multiple times the add-dep goal as you need.
62+
63+
Then, when you're done, if there's no problem with the changed POM, you could confirm the changes by performing the commit goal.
64+
65+
[source,sh]
66+
$ mvn pom-editor:commit
67+
68+
==== Revert the changes
69+
70+
You could also perform the rollback goal:
71+
72+
[source,sh]
73+
$ mvn pom-editor:rollback
74+
75+
This goal will revert the changes, replacing the changed POM file to the backup POM file.
76+
4477
== Goals
4578

4679
It covers the following goals:

0 commit comments

Comments
 (0)