0

我正在构建一个sar存档文件类型。我正在使用jboss-packaging-maven-pluginfrom 。但是,如果它可以满足我org.codehaus.mojo的需要,我会很乐意使用它。maven-ear-plugin

我正在构建的 sar 文件有点奇怪。这些库保存在根目录中(这没有问题),但是还有几十个附加属性文件和 xml 文件也打包到这个 sar 中。

我正在查看 和 的文档jboss-packaging-maven-pluginmaven-ear-plugin但没有看到在该<configuration>部分中指定其他文件的方法(例如<fileSet>参数)。我可以切换到程序集并以这种方式构建 sar,但它看起来不像程序集那样sar格式化(至少在默认情况下)。

那么,如何sar通过maven-ear-plugin或将这些附加属性文件添加到jboss-packaging-maven-plugin?

是否可以在程序集中指定标准格式以外的其他格式?如果是这样,我该怎么做?

这是我的pom.xml

<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.vegicorp</groupId>
    <artifactId>parent</artifactId>
    <version>1.0.0</version>
  </parent>
  <artifactId>child-sar</artifactId>
  <packaging>jboss-sar</packaging>
  <version>1.0.0</version>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jboss-packaging-maven-plugin</artifactId>
        <version>2.2</version>
        <extensions>true</extensions>
        <configuration>
          <!-- Here be dragons -->
          <deploymentDescriptorFile>${project.parent.basedir}/config/jboss/jboss-service.xml</deploymentDescriptorFile>
          <libDirectory>${project.build.directory}/${project.build.finalName}</libDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>com.vegicorp</groupId>
      <artifactId>child-jar</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>com.vegicorp</groupId>
      <artifactId>child-jar</artifactId>
      <classifier>mdb</classifier>
      <version>1.0.0</version>
    </dependency>
  </dependencies>
</project>

而且,如果可能的话,我想避免这种maven-antrun-plugin情况。

4

1 回答 1

1

Maven Assembly Plugin 确实构建sar了工件,即使它没有在文档中提到这一点。我刚刚切换到使用程序集并且有效。

于 2017-03-01T15:08:25.737 回答