回答

1

最简单的事情就是将zips部署到存储库。对于本地存储库,请使用install:install-file和中央存储库使用deploy:deploy-file。

您可以在第二个模块中声明拉链作为依赖关系。

0

所以有人提到将其部署到您的存储库。如果您已经设置了将构建的构件部署到存储库,则很容易,如果不是,请检查http://maven.apache.org/plugins/maven-deploy-plugin/

接下来,您需要使用插件从存储库中检出zip文件。你可以使用阴影,或者maven-dependency-plugin。让我们假设Maven的依赖,插件http://maven.apache.org/plugins/maven-dependency-plugin/usage.html

所以在插件部分添加到您的Maven POM文件:

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-dependency-plugin</artifactId> 
    <executions> 
     <execution> 
      <id>unpack</id> 
      <phase>process-sources</phase> 
      <goals> 
       <goal>unpack</goal> 
      </goals> 
      <configuration> 
       <artifactItems> 
        <artifactItem> 
         <groupId>my.artifact.group.id</groupId> 
         <artifactId>my-artifact</artifactId> 
         <version>My-version</version> 
         <type>zip</type> 
         <overWrite>false</overWrite> 
         <outputDirectory>${project.build.directory}/see</outputDirectory> 
        </artifactItem> 
       </artifactItems> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

显然,你需要改变工件的细节。这将解压缩您的zip文件到target/see。如果你想要真正的压缩文件(这看起来像你所要求的,但不清楚),只需将目标从“解压缩”更改为“复制依赖”。您可能还需要删除outputDirectory或更改配置的其他位。只需使用它来获取它所需的位置,并查看上面提到的Maven-dependency-plugin的页面以获取更多详细信息。

希望有所帮助。

相关问题