How to specify git remote url for Maven Release plugin using standard SSH syntax?

Direct for a specific task

If I specify a "fully qualified" SSH address with a loop in pom.xml

<scm>
  <developerConnection>scm:git:username@hostname:/absolute/path/to/repo.git</developerConnection>
</scm>

and use it as a team, for example

mvn --batch-mode release:prepare -Dtag=whatever -DreleaseVersion=3.0 -DdevelopmentVersion=4.0-SNAPSHOT

then I get an error like

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project maven_dependencies: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] fatal: 'hostname/absolute/path/to/repo.git' does not appear to be a git repository
[ERROR] fatal: Could not read from remote repository.

NOTE: The semicolon between hostnameand /absolute/path/to/repo.git, which was at pom.xml, disappeared in the error output!

additional information

Absolute and relative path

In fact, I can use Git with a non-absolute path in the SSH URL (relative to the source directory usernname). For example, using

scm:git:username@hostname:path/to/repo.git

instead

scm:git:username@hostname:/home/username/path/to/repo.git

works great.

Official documentation

Maven Git , URL-, SSH, , , , URL-:

scm:git:ssh://username@hostname[:port]/~/path/to/repository

( SSH , /). , : hostname SSH- URL- hostname path ( )!

, URL- Git SSH Maven Release - !

+4

All Articles