Maven: Is there any way to pull and checkout to specified branch of git repositories, if repository is already present on specified directory?

321 views Asked by At

Can maven does following?

  1. Clone a repository with branch (Release-1.0) using maven-scm-plugin to specified target directory.(target/additional)
  2. Do not clean target directory and update pom.xml (clone same repository at same directory just change branch to Release-1.1). Can maven just Pull and checkout the local repository with branch Release-1.1.

Say:

Step 1: Using pom.xml clone a repository with branch Release-1.0 Step 2: Update pom.xml with same repository just different branch Release-1.1.

If, I use configuration (skipCheckoutIfExists) then Maven is not updating remote repository with changed branch i.e Release-1.1

If i don't use skipCheckoutIfExists, it just overrides the old remote repository.

Can anyone give me alternate solution for this issue?

0

There are 0 answers