Sonatype 网站上的说明很薄弱,有关重定位 poms 的 Maven 文档引用了基于本地文件系统的存储库文件访问(并建议移动文件)。我需要在新的 groupId 中部署多模块项目的新版本,然后在旧的 groupId 中发布该版本的重定向 pom。我已经准备好重定位 pom - 我是否只需将它们交换为主 pom.xml 文件,然后重新运行我的部署(当我这样做时,它会部署 jar 内容),或者是否有其他方法将这些 pom 工件推送到oss.sonatype.org?有人有这方面的最佳实践吗?
使用旧的 groupId 部署新版本的 pom。
包装应该是pom并且工件必须有签名。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example</artifactId>
<version>1.0.0</version>
<name>${project.artifactId}</name>
<description>Example</description>
<packaging>pom</packaging>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<licenses>
<license>
<name>BSD License</name>
<url>http://opensource.org/licenses/BSD-3-Clause</url>
</license>
</licenses>
<distributionManagement>
<relocation>
<groupId>org.example</groupId>
</relocation>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
371 次 |
| 最近记录: |