pom.xml scm连接字符串的语法 [英] Syntax of the pom.xml scm connection string

查看:410
本文介绍了pom.xml scm连接字符串的语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在清理项目中的pom文件,并发现我使用了两个略有不同的scm记录:

I'm cleaning up pom files in my project and find out I use two slightly different scm records:

<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

vs

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

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

I haven't been able to find any resource describing the syntax of the connection strings so far. What is the difference between these two?

推荐答案

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

Both are valid SCM URLs and they will have exactly the same result. The only difference will be in the implementation of the communication with the Git server (is it HTTPS or HTTP etc.).

From Maven SCM Git实现,所有这些URL都是有效的:

From the Maven SCM Git implementation, all those URLs are valid:

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:validate 目标:

Note that you can validate that your SCM information is correct with the help of the scm:validate goal:


验证scm连接字符串。

Validate scm connection string.

SCM连接字符串的参考格式可以在 Maven文档

The reference format for the SCM connection string can be found in the Maven docs:


<所有SCM连接都是通过一个通用的URL结构进行的。

All SCM connections are made through a common URL structure.

scm:[provider]:[provider_specific]

其中provider是SCM系统的类型。

Where provider is the type of SCM system.

这篇关于pom.xml scm连接字符串的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆