Other SCM Commands

The SCM plugin requires the SCM to be configured in the pom.xml.

<project>
  ...
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>SCM Sample Project</name>
  <url>http://somecompany.com</url>
  <scm>
    <connection>scm:svn:http://somerepository.com/svn_repo/trunk</connection>
    <developerConnection>scm:svn:https://somerepository.com/svn_repo/trunk</developerConnection>
    <url>http://somerepository.com/view.cgi</url>
  </scm>
  ...
</project>

Alternatively you can configure the SCM url also in via plugin parameters.

If you want to change the used SCM provider implementation, for example you want to use the JGit instead of the CLI based default implementation, you must configure your plugin like that:

<project>
  ...
  <build>
    ...
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-plugin</artifactId>
        <version>2.2.0</version>
        <configuration>
          <providerImplementations>
            <git>jgit</git>
          </providerImplementations>
        </configuration>
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>

Once the SCM has been configured, SCM operations can be performed.

pom.xml configuration :

<project>
  ...
  <build>
    ...
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-plugin</artifactId>
        <version>2.2.0</version>
        <configuration>
          <startDate>YYYY-MM-DD</startDate>
          <endDate>YYYY-MM-DD</endDate>
        </configuration>
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>

Command :

  mvn scm:changelog

or you can specify the startDate and endDate on the commandline

  mvn -DstartDate=YYYY-MM-DD -DendDate=YYYY-MM-DD scm:changelog

pom.xml configuration :

<project>
  ...
  <build>
    ...
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-plugin</artifactId>
        <version>2.2.0</version>
        <configuration>
          <startRevision>connection</startRevision>
          <endRevision>connection</endRevision>
        </configuration>
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>

Command :

   mvn scm:diff

or you can specify the startRevision and endRevision in the command line

   mvn -DstartRevision=<revision> -DendRevision=<revision> scm:diff

Command :

  mvn scm:edit

Command :

   mvn scm:status

pom.xml configuration :

<project>
  ...
  <build>
    ...
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-plugin</artifactId>
        <version>2.2.0</version>
        <configuration>
          <tag>tag name</tag>
        </configuration>
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>

Command :

   mvn scm:tag

or you can specify the tag name in the command line

   mvn -Dtag="<tag name>" scm:tag

Command :

   mvn scm:unedit

Command :

   mvn scm:validate

or passing the scmConnection or/and the developerConnection in the command line

   mvn -DscmConnection="<scm url>" -DscmDeveloperConnection="<scm url>" scm:validate