相关疑难解决方法(0)

Maven使用子POM中的子路径解析哪些URL?

我在某处读到如果Maven项目使用继承,那么它的子项目将使用子项目自动向URL添加子路径artifactId.但现在我找不到参考.

哪个继承的URL将Maven从父POM逐字继承,并且它将为子POM添加子路径?例如,以下是我可以找到的一些网址:

  • <project><url>
  • <project><scm><url>
  • <project><distributionManagement><site><url>

也许我错了,他们都没有添加一个子路径,但我在笔记中有它.不幸的是,我似乎找不到使用互联网搜索的确定答案.

请尝试在答案中提供权威参考.(当然,如果没有相关的文档,直接测试将是第二好的.)在此先感谢.

java maven

10
推荐指数
1
解决办法
203
查看次数

父pom.xml中的$ {project.artifactId}解析为奇数

我有大量的项目,在他们的pom.xml中有相同的URL:

<url>https://github.com/malkusch/${project.artifactId}</url>

<scm>
    <connection>scm:git:git://github.com/malkusch/${project.artifactId}.git</connection>
    <developerConnection>scm:git:git@github.com:malkusch/${project.artifactId}.git</developerConnection>
    <url>https://github.com/malkusch/${project.artifactId}</url>
</scm>

<issueManagement>
    <system>github</system>
    <url>https://github.com/malkusch/${project.artifactId}/issues</url>
</issueManagement>
Run Code Online (Sandbox Code Playgroud)

所以我认为把它放到父pom.xml中是一个好主意.但有效的pom会产生奇怪的$ {project.artifactId}:

<parent>
  <groupId>de.malkusch.parent</groupId>
  <artifactId>oss-parent</artifactId>
  <version>1.1-SNAPSHOT</version>
</parent>
<groupId>de.malkusch.localized</groupId>
<artifactId>localized</artifactId>
<url>https://github.com/malkusch/localized/localized</url>
<scm>
  <connection>scm:git:git://github.com/malkusch/localized.git/localized</connection>
  <developerConnection>scm:git:git@github.com:malkusch/localized.git/localized</developerConnection>
  <url>https://github.com/malkusch/localized/localized</url>
</scm>
<issueManagement>
  <system>github</system>
  <url>https://github.com/malkusch/localized/issues</url>
</issueManagement>
Run Code Online (Sandbox Code Playgroud)

您注意到只有issueManagement.url已正确解析.其他的都很奇怪,特别是$ {project.artifactId} .git - > localized.git/localized.我正在使用Maven 3.0.4.我使用了一些未定义的功能吗?这是一个错误吗?

maven

7
推荐指数
1
解决办法
7550
查看次数

标签 统计

maven ×2

java ×1