Skip to content

Commit

Permalink
Merge pull request #27 from GianDeManincor/adding-commit-and-rollback…
Browse files Browse the repository at this point in the history
…-documentation

Enhance How to use it documentation
  • Loading branch information
dearrudam committed Jan 27, 2024
2 parents 2836ad9 + 0fb84bc commit 8d186bf
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Facilitate manipulation such as managing POM dependencies through CLI (command l

== How to use it

==== Add a dependency

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:

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

==== Confirm the changes

When you perform the goal add-dep with the command below:

[source,sh]
$ mvn pom-editor:add-dep -Dgav='junit:junit:4.13'

The plugin will create a backup POM file based on the target POM if such one doesn't exist.

[source,sh]
$ tree .
.
├── pom.xml
└── pom.xml.backup

You could perform multiple times the add-dep goal as you need.

Then, when you're done, if there's no problem with the changed POM, you could confirm the changes by performing the commit goal.

[source,sh]
$ mvn pom-editor:commit

==== Revert the changes

You could also perform the rollback goal:

[source,sh]
$ mvn pom-editor:rollback

This goal will revert the changes, replacing the changed POM file to the backup POM file.

== Goals

It covers the following goals:
Expand Down

0 comments on commit 8d186bf

Please sign in to comment.