【发布时间】:2018-02-20 08:00:32
【问题描述】:
由于我们的客户想要在他的环境中构建项目,我们必须交付(除了源代码之外)我们的依赖项和我们使用的插件,这两者都不能从 MavenCentral 获得。
如何复制使用的插件(包括它们的依赖项,但不引用每个插件),就像依赖项插件为“普通”库所做的那样?
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-acme-dependencies</id>
<phase>verify</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<addParentPoms>true</addParentPoms>
<copyPom>true</copyPom>
<useRepositoryLayout>true</useRepositoryLayout>
<overWriteReleases>true</overWriteReleases>
<includeGroupIds>org.acme</includeGroupIds>
<excludeGroupIds>${project.groupId}</excludeGroupIds>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
-
您的客户是否有像jFrog 这样的内部工件?如果是,那么您可以在那里部署它们以供进一步使用。
-
我必须打包我们的依赖项并将它们交付给客户。他们会将它们导入到他们的存储库中。
标签: maven dependencies