我正在尝试使用标记deploy
在 Maven 3.0.4 POM 中配置步骤。<distributionManagement>
从XSD for POM(第 1389 行),它建议仅提供应该允许 Maven 也从文件中id
查找相应的值。settings.xml
我在. -X
_ 但是,当我只是在我的 POM 中提供并尝试时,我收到一个错误,即 Maven 缺少存储库的 URL,但是当我明确提供作品时。[DEBUG] Repositories (dependencies): [archiva.snapshots (http://snap-mvnrepo.initech.com/archiva/repository/snapshots, releases+snapshots)]
settings.xml
<id>
deploy
<url>
deploy
有谁知道我应该怎么做才能让它只通过 id 工作?我不想对 URL 进行硬编码。
免责声明:错别字很可能是匿名化的结果,但它们可能是“真实的”,因此请随时指出。
关于来自 POM 的XSD 的<id>
子标签(第 1389 行):<repository>
存储库的唯一标识符。例如,这用于将存储库与
settings.xml
文件中的配置相匹配。
从我的settings.xml
:
<profile>
<id>archiva_dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>archiva.snapshots</id>
<name>Initech Internal Snapshot Repository</name>
<url>http://snap-mvnrepo.initech.com/archiva/repository/snapshots</url>
</repository>
</repositories>
</profile>
从我的(失败)pom.xml
:
<distributionManagement>
<repository>
<id>archiva.snapshots</id>
<!--
<name>Initech Internal Snapshot Repository</name>
<url>http://snap-mvnrepo.initech.com/archiva/repository/snapshots</url>
-->
</repository>
</distributionManagement>
错误:
Caused by: java.lang.IllegalStateException: Failed to create release distribution repository for com.initech.ws:initechws:pom:1.0-SNAPSHOT
at org.apache.maven.project.MavenProject.getReleaseArtifactRepository(MavenProject.java:1853)
at org.apache.maven.project.MavenProject.getDistributionManagementArtifactRepository(MavenProject.java:1377)
at org.apache.maven.plugin.deploy.DeployMojo.getDeploymentRepository(DeployMojo.java:227)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:118)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
Caused by: org.apache.maven.artifact.InvalidRepositoryException: URL missing for repository archiva.snapshots
at org.apache.maven.repository.legacy.LegacyRepositorySystem.buildArtifactRepository(LegacyRepositorySystem.java:775)
at org.apache.maven.project.MavenProject.getReleaseArtifactRepository(MavenProject.java:1843)
... 24 more