在 pom.xml 中制作 deb 包的最佳实践是什么?

What are the best practices regarding deb package making in pom.xml?

一些多模块项目有 pom.xml 文件层次结构。我需要将目标模块的 jar 打包到结果 deb 包中。如何使用 jdeb 或其他东西来实现它,以便在内部使用目标 jar 制作 deb 包(以及内部的 postins、preinst 脚本)。
我的另一个问题:将一些 "dep-package-making" 插件放入顶级 pom 是否有意义?备选方案 - 另一个子模块项目(假项目),其 pom.xml 内部继承自顶层 pom.xml 并将 deb package maker 插件放入其中。

您可以在您的 maven 构建中使用 jdeb 插件

<plugin>
<artifactId>jdeb</artifactId>
<groupId>org.vafer</groupId>
<version>0.3</version>
<executions>
    <execution>
        <phase>package</phase>
        <goals>
            <goal>deb</goal>
        </goals>
    </execution>
</executions>

或 debian-maven-plugin 有关更多信息,您可以查看使用页面(文档){http://debian-maven.sourceforge.net/usage.html}

可以在此处找到 jdeb 插件的示例用法:https://github.com/tcurdt/jdeb/blob/master/src/examples/maven/pom.xml