This scm provider implementation allows the usage of git with the release and scm plugin without having to install a nativ git client. This implementation uses username and password instead of a public/private keys to authenticate the requests to a remote repository like GitHub.
Usage with the maven-release-plugin
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.3</version> <configuration> <providerImplementations> <git>jgit</git> </providerImplementations> </configuration> <dependencies> <dependency> <groupId>org.apache.maven.scm</groupId> <artifactId>maven-scm-provider-jgit</artifactId> <version>1.9.5</version> </dependency> </dependencies> </plugin>
Usage with the maven-scm-plugin
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-scm-plugin</artifactId> <version>1.9.5</version> <configuration> <providerImplementations> <git>jgit</git> </providerImplementations> </configuration> <dependencies> <dependency> <groupId>org.apache.maven.scm</groupId> <artifactId>maven-scm-provider-jgit</artifactId> <version>1.9.5</version> </dependency> </dependencies> </plugin>
Examples ____
changelog
mvn org.apache.maven.plugins:maven-scm-plugin:1.9.5:changelog
release
mvn release:prepare release:perform -Dresume=false -Dusername=XXX -Dpassword=XXX
Committer / Author ____
The jgit provider per default uses the information of the “user” section in the .gitconfig. If you explicitly configure a user there, this user will be used as author and committer. If you don’t define a user in the .gitconfig, then the user passed as “username” with the maven execution is used. The email per default will be ‘username’@hostname. If you don’t like the hostname to be used as the domain. you can configure a default domain in the .gitconfig as follows:
git config --global maven-scm.maildomain mycomp.com
You can also enforce the usage of the “username” for the author and committer (omit the default in the .gitconfig):
git config --global maven-scm.forceUsername true
this is a brief list of the supported maven-scm-provider-jgit’s integration status with regard to some core maven plugins