【问题标题】:Copy dependencies AND plugins with Maven使用 Maven 复制依赖项和插件
【发布时间】: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


【解决方案1】:

最可靠的方法是针对空的 Maven 本地存储库构建项目,然后复制/枚举之后找到的工件。

不幸的是,我从未找到列出“构建给定项目所需的一切”的 Maven 插件。

【讨论】:

    猜你喜欢
    • 2015-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-25
    • 1970-01-01
    • 1970-01-01
    • 2022-01-22
    相关资源
    最近更新 更多