uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marshall Schor <...@schor.com>
Subject Re: building source-release.zip - was: [VOTE] Release build poms incorporating change to docbkx 2.0.11 version
Date Mon, 06 Sep 2010 21:21:46 GMT
 Here's more details on how the source-release.zip is built (for those who
really want to know ... )

Our build process follows the standard Apache Maven build processes, and uses
the common Apache-wide "super pom":
The source release zip artifact (e.g.  xxx-version-source-release.zip where xxx
= the maven artifactId) is created by the Apache super pom during the release
process.  Our parent-pom-top/pom.xml has, as a parent, the Apache common super
pom, http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.pom .

In that pom, there is a section within a profile named "apache-release"; here
are the relevant parts:

  <profiles>
      <!-- START SNIPPET: release-profile -->
    <profile>
      <id>apache-release</id>
      <build>
        <plugins>
          <!-- Create a source-release artifact that contains the fully buildable
               project directory source structure. This is the artifact which is
               the official subject of any release vote. -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>org.apache.apache.resources</groupId>
                <artifactId>apache-source-release-assembly-descriptor</artifactId>
                <version>1.0.2</version>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <id>source-release-assembly</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
                  <descriptorRefs>
                   
<descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
                  </descriptorRefs>
                  <tarLongFileFormat>gnu</tarLongFileFormat>
                </configuration>
              </execution>
            </executions>
          </plugin>
               ...  omitted sections ...
        </plugins>
      </build>
    </profile>
    <!-- END SNIPPET: release-profile -->
  </profiles>

To understand how this works, the assembly plugin uses the
${sourceReleaseAssemblyDescriptor} as a "built-in" descriptor.  Only, it's not
really built-in.  The assembly plugin looks up built-in descriptors following a
naming convention, in the classpath.  The <dependency> element inside the
<plugin> element adds the necessary thing to the classpath, so this is like a
"custom" built-in. 

Here's the assembly descriptor that it uses (from
http://repo1.maven.org/maven2/org/apache/apache/resources/apache-source-release-assembly-descriptor/1.0.2/
- it's inside the jar artifact - you have to unzip it to find it...)

<assembly>
  <id>source-release</id>
  <formats>
    <format>zip</format>
  </formats>
  <fileSets>
    <!-- main project directory structure -->
    <fileSet>
      <directory>.</directory>
      <outputDirectory>/</outputDirectory>
      <useDefaultExcludes>true</useDefaultExcludes>
      <excludes>
        <!-- build output -->
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/).*${project.build.directory}.*]</exclude>
       
        <!-- NOTE: Most of the following excludes should not be required
             if the standard release process is followed. This is because the
             release plugin checks out project sources into a location like
             target/checkout, then runs the build from there. The result is
             a source-release archive that comes from a pretty clean directory
             structure.
            
             HOWEVER, if the release plugin is configured to run extra goals
             or generate a project website, it's definitely possible that some
             of these files will be present. So, it's safer to exclude them.
        -->
            
        <!-- IDEs -->
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?maven-eclipse\.xml]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.project]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.classpath]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?[^/]*\.iws]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?[^/]*\.ipr]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?[^/]*\.iml]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.settings(/.*)?]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.externalToolBuilders(/.*)?]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.deployables(/.*)?]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?\.wtpmodules(/.*)?]</exclude>
       
        <!-- misc -->
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?cobertura\.ser]</exclude>
       
        <!-- release-plugin temp files -->
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?pom\.xml\.releaseBackup]</exclude>
       
<exclude>%regex[(?!((?!${project.build.directory}/)[^/]+/)*src/)(.*/)?release\.properties]</exclude>
      </excludes>
    </fileSet>
    <!-- license, readme, etc. calculated at build time -->
    <fileSet>
     
<directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
      <outputDirectory>/</outputDirectory>
    </fileSet>
  </fileSets>
</assembly>

Because this is in the apache-release profile, which is not activated normally,
the source release zip is normally not built.  The apache release plugin is
configured to activate this profile when a release is being performed.

-Marshall

Mime
View raw message