简体   繁体   English

nexus-staging-maven-plugin如何使用 <scm> 信息?

[英]How does nexus-staging-maven-plugin use <scm> information?

I have a single Git repository that contains several Maven modules, using Maven inheritance and Maven aggregation. 我有一个Git存储库,它包含几个Maven模块,使用Maven继承和Maven聚合。 That is, in the root directory, there is a parent POM, that defines some modules, each of which use that root POM as their parent. 也就是说,在根目录中,有一个父POM,它定义了一些模块,每个模块都使用该根POM作为它们的父模块。

<project>
  …
  <groupId>io.example</groupId>
  <artifactId>parent</artifactId>
  <version>1.2.3-SNAPSHOT</version>
  <packaging>pom</packaging>
  …
  <scm>
    <connection>scm:git:https://bitbucket.org/example/foobar.git</connection>
    <developerConnection>scm:git:https://bitbucket.org/example/foobar.git</developerConnection>
    <url>https://bitbucket.org/example/foobar</url>
  </scm>
  …
  <modules>
    <module>foo</module>
    <module>bar</module>
  </modules>
  …

I recently found out that Maven will append the module path to the <scm><url> value for each module ( foo and bar above). 我最近发现 Maven会将模块路径附加到每个模块的<scm><url>值(上面的foobar )。 For example, the foo submodule would get an SCM URL of https://bitbucket.org/example/foobar/foo . 例如, foo子模块将获得https://bitbucket.org/example/foobar/foo的SCM URL。

So should each of my modules redeclare the <scm> section, so that the submodule POMs have the same SCM URL as the parent POM? 那么我的每个模块都应该重新声明 <scm>部分,以便子模块POM具有与父POM相同的SCM URL? How does the Nexus Staging Maven Plugin use this SCM information, anyway? 无论如何,Nexus Staging Maven插件如何使用此SCM信息?

I have also cross-posted this at Sonatype . 我也在Sonatype交叉发布了这个。

Regarding your initial question in the title: It does not use it given the code provided at github . 关于标题中的初始问题:鉴于github提供的代码,它不使用它。 When you search for 'scm' in all .java files you have zero hits. 当您在所有.java文件中搜索“scm”时,您的命中率为零。 Of course they could do some weird tricks like building the String like "s" + "c" + "m" or it is hidden in some third party dependency or... Still I think besides an offical answer, this is the best any outsider can tell. 当然,他们可以做一些奇怪的技巧,比如构建像"s" + "c" + "m"这样的字符串,或者它隐藏在某些第三方依赖中或者......我仍然认为除了一个正式答案,这是最好的局外人可以说。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM