语法

2016-02-27 60 views
2

我清理POM文件在我的项目,并找出我用两个略有不同的SCM记录:语法

<scm> 
    <connection>scm:git:https://github.com/jadler-mocking/jadler.git</connection> 
    <developerConnection>scm:git:https://github.com/jadler-mocking/jadler.git</developerConnection> 
    <url>https://github.com/jadler-mocking/jadler</url> 
</scm> 

VS

<scm> 
    <connection>scm:git:[email protected]:jadler-mocking/jadler.git</connection> 
    <developerConnection>scm:git:[email protected]:jadler-mocking/jadler.git</developerConnection> 
    <url>https://github.com/jadler-mocking/jadler</url> 
</scm> 

我的天堂目前为止找不到任何描述连接字符串语法的资源。这两者有什么区别?

回答

2

两者都是有效的SCM URL,它们将具有完全相同的结果。唯一的区别将在于实现与Git服务器的通信(是HTTPS还是HTTP等)。

the Maven SCM Git implementation,所有这些网址都是有效的:

scm:git:git://server_name[:port]/path_to_repository 
scm:git:http://server_name[:port]/path_to_repository 
scm:git:https://server_name[:port]/path_to_repository 
scm:git:ssh://server_name[:port]/path_to_repository 
scm:git:file://[hostname]/path_to_repository 

请注意,您可以验证您的SCM信息与的scm:validate目标帮助正确:

验证单片机的连接字符串。

为SCM连接字符串的参考格式可以在the Maven docs找到:

所有SCM连接通过一个共同的URL结构制成。

scm:[provider]:[provider_specific] 

其中provider是SCM系统的类型。