Apache 资源包

Maven 项目提供了一组资源来帮助您构建符合 Apache 规则的 Java 资源。

如果您在资源包中发现错误,请在 JIRA中报告。

JAR 资源包和孵化器免责声明资源包

在您的 jar 中生成以下内容:

  • META-INF/DEPENDENCIES
  • META-INF/LICENSE
  • META-INF/NOTICE
  • META-INF/DISCLAIMER
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <version>1.4</version>
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
            <configuration>
              <resourceBundles>
                <!-- Will generate META-INF/DEPENDENCIES META-INF/LICENSE META-INF/NOTICE -->
                <resourceBundle>org.apache.apache.resources:apache-jar-resource-bundle:1.5-SNAPSHOT</resourceBundle>
                <!-- Will generate META-INF/DEPENDENCIES.txt META-INF/LICENSE.txt META-INF/NOTICE.txt -->
                <resourceBundle>org.apache.apache.resources:apache-jar-txt-resource-bundle:1.5-SNAPSHOT</resourceBundle>
                <!-- Will generate META-INF/DISCLAIMER  -->
                <resourceBundle>org.apache.apache.resources:apache-incubator-disclaimer-resource-bundle:1.2-SNAPSHOT</resourceBundle>
              </resourceBundles>
            </configuration>
          </execution>
        </executions>
      </plugin>

源代码发布程序集描述符

创建一个包含完全可构建的项目目录源结构的源发布工件。这是任何发布投票的官方主题的工件。

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.apache.apache.resources</groupId>
            <artifactId>apache-source-release-assembly-descriptor</artifactId>
            <version>1.0.6</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>source-release-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <!--
              use this flag to generate source release assembly from the top of a multi modules
              maven project.

              <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
              -->
              <descriptorRefs>
                <!--
                  There are 3 descriptors available, choose one of them:
                  * source-release (zip only, this one is used in the ASF parent POM) 
                  * source-release-zip-tar (both zip and tar) 
                  * source-release-tar (tar only) 
                -->
                <descriptorRef>source-release</descriptorRef>
              </descriptorRefs>
              <tarLongFileMode>gnu</tarLongFileMode>
            </configuration>
          </execution>
        </executions>
      </plugin>