2014-06-30 52 views
3

Sonatype網站上的說明很簡單,關於重定位poms的maven文檔引用了對存儲庫文件的本地文件系統訪問(並建議移動文件)。我需要在新的groupId中部署新版本的多模塊項目,然後在舊的groupId中爲該版本發佈重定向pom。我已經準備好了重新定位poms--是否將它們交換爲主要的pom.xml文件,然後重新運行我的部署(當我這樣做時它會部署jar內容),還是有其他方法將這些pom工件推送到oss.sonatype.org?任何人都有這方面的最佳做法?如何將重定位pom.xml部署到sonatype的OSS存儲庫

+0

我會建議在maven用戶列表中詢問該主題。 – khmarbaise

回答

0

使用舊的groupId(s)部署新版本的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> 
相關問題