1

i'm using the maven release plugin 2.5.3. I'm using git as repo. I want to use the shallow clone (depth 1) option at the time of release plugin. I saw the shallow clone option has been introduced in maven-scm-api starting from 1.10.0 version but with default value as false. So how i can override this property using 'shallow' option = true ? My actual situation is the following: (i added the dependencies of git and scm, otherwise the versions used by release plugin had version 1.9.4 that doesn't contain the shallow option).

      <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
                <preparationGoals>clean install</preparationGoals>
                <!--<arguments>-Dprepare-release=true</arguments>-->
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.maven.scm</groupId>
                    <artifactId>maven-scm-api</artifactId>
                    <version>1.11.2</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.maven.scm</groupId>
                    <artifactId>maven-scm-provider-gitexe</artifactId>
                    <version>1.11.2</version>
                </dependency>
            </dependencies>
        </plugin>
        <plugin>

Anyway with this config, i'm not able to force the shallow option to true. I know the maven-release-plugin 3.0.0-M1 has 'true' as default value for shallow option, but i dont want to upgrade the maven plugin version.

David
  • 11
  • 1
  • 1
    First your dependency in your configuration is wrong cause the install-plugin is not a dependency of maven-release-plugin ... furthermore why do you use `clean install` as preparation goals and don't keep the defaults... Apart from that I strongly recommend to upgrade to 3.0.0-M1 release plugin version... What is the problem with updating? – khmarbaise Dec 01 '20 at 14:45
  • I tried but i got this: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M1:prepare (default-cli) on project bo-connector-modules: Unable to commit files [ERROR] Provider message: [ERROR] The git-push command failed. [ERROR] Command output: [ERROR] ssh_exchange_identification: Connection closed by remote host [ERROR] fatal: Could not read from remote repository. [ERROR] [ERROR] Please make sure you have the correct access rights [ERROR] and the repository exists. [ERROR] -> [Help 1] Anyway how can i use the shallow with 2.5.3? – David Dec 01 '20 at 18:35

0 Answers0