You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by tu...@apache.org on 2011/10/14 00:38:03 UTC
svn commit: r1183151 - in /hadoop/common/trunk: ./
hadoop-assemblies/src/main/resources/assemblies/ hadoop-project-dist/
Author: tucu
Date: Thu Oct 13 22:38:03 2011
New Revision: 1183151
URL: http://svn.apache.org/viewvc?rev=1183151&view=rev
Log:
HADOOP-7743. Add Maven profile to create a full source tarball. (tucu)
Modified:
hadoop/common/trunk/BUILDING.txt
hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-dist.xml
hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-mapreduce-dist.xml
hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-src.xml
hadoop/common/trunk/hadoop-project-dist/pom.xml
hadoop/common/trunk/pom.xml
Modified: hadoop/common/trunk/BUILDING.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/BUILDING.txt?rev=1183151&r1=1183150&r2=1183151&view=diff
==============================================================================
--- hadoop/common/trunk/BUILDING.txt (original)
+++ hadoop/common/trunk/BUILDING.txt Thu Oct 13 22:38:03 2011
@@ -1,5 +1,4 @@
-
-Build instructions for Hadoop Common/HDFS using Maven
+Build instructions for Hadoop
----------------------------------------------------------------------------------
Requirements:
@@ -9,19 +8,24 @@ Requirements:
* Maven 3.0
* Forrest 0.8 (if generating docs)
* Findbugs 1.3.9 (if running findbugs)
+* ProtocolBuffer 2.4.1+ (for MapReduce)
* Autotools (if compiling native code)
* Internet connection for first build (to fetch all Maven and Hadoop dependencies)
----------------------------------------------------------------------------------
-Maven modules:
+Maven main modules:
- hadoop (Main Hadoop project)
- - hadoop-project (Parent POM for all Hadoop Maven modules. )
- (All plugins & dependencies versions are defined here.)
- - hadoop-project-dist (Parent POM for modules that generate distributions.)
- - hadoop-annotations (Generates the Hadoop doclet used to generated the Javadocs)
- - hadoop-common (Hadoop Common)
- - hadoop-hdfs (Hadoop HDFS)
+ hadoop (Main Hadoop project)
+ - hadoop-project (Parent POM for all Hadoop Maven modules. )
+ (All plugins & dependencies versions are defined here.)
+ - hadoop-project-dist (Parent POM for modules that generate distributions.)
+ - hadoop-annotations (Generates the Hadoop doclet used to generated the Javadocs)
+ - hadoop-assemblies (Maven assemblies used by the different modules)
+ - hadoop-common-project (Hadoop Common)
+ - hadoop-hdfs-project (Hadoop HDFS)
+ - hadoop-mapreduce-project (Hadoop MapReduce)
+ - hadoop-tools (Hadoop tools like Streaming, Distcp, etc.)
+ - hadoop-dist (Hadoop distribution assembler)
----------------------------------------------------------------------------------
Where to run Maven from?
@@ -52,7 +56,7 @@ Maven build goals:
* Use -Dsnappy.prefix=(/usr/local) & -Dbundle.snappy=(false) to compile
Snappy JNI bindings and to bundle Snappy SO files
* Use -Pdocs to generate & bundle the documentation in the distribution (using -Pdist)
- * Use -Psrc to bundle the source in the distribution (using -Pdist)
+ * Use -Psrc to create a project source TAR.GZ
* Use -Dtar to create a TAR with the distribution (using -Pdist)
Tests options:
@@ -64,3 +68,22 @@ Maven build goals:
* -Dtest.exclude.pattern=**/<TESTCLASSNAME1>.java,**/<TESTCLASSNAME2>.java
----------------------------------------------------------------------------------
+Building distributions:
+
+Create binary distribution without native code and without documentation:
+
+ $ mvn package -Pdist -DskipTests -Dtar
+
+Create binary distribution with native code and with documentation:
+
+ $ mvn package -Pdist,native,docs -DskipTests -Dtar
+
+Create source distribution:
+
+ $ mvn package -Psrc -DskipTests
+
+Create source and binary distributions with native code and documentation:
+
+ $ mvn package -Pdist,native,docs,src -DskipTests -Dtar
+
+----------------------------------------------------------------------------------
Modified: hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-dist.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-dist.xml?rev=1183151&r1=1183150&r2=1183151&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-dist.xml (original)
+++ hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-dist.xml Thu Oct 13 22:38:03 2011
@@ -107,10 +107,6 @@
<directory>${project.build.directory}/site</directory>
<outputDirectory>/share/doc/hadoop/${hadoop.component}</outputDirectory>
</fileSet>
- <fileSet>
- <directory>${project.build.directory}/src</directory>
- <outputDirectory>/share/hadoop/${hadoop.component}/src</outputDirectory>
- </fileSet>
</fileSets>
<dependencySets>
<dependencySet>
Modified: hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-mapreduce-dist.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-mapreduce-dist.xml?rev=1183151&r1=1183150&r2=1183151&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-mapreduce-dist.xml (original)
+++ hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-mapreduce-dist.xml Thu Oct 13 22:38:03 2011
@@ -36,40 +36,6 @@
<include>**/*</include>
</includes>
</fileSet>
- <fileSet>
- <outputDirectory>sources</outputDirectory>
- <excludes>
- <exclude>**/*.jar</exclude>
- <exclude>**/target/**</exclude>
- <!-- scripts to include later for setting fileMode -->
- <exclude>**/bin/*</exclude>
- <exclude>**/scripts/*</exclude>
- <!-- images that we don't need (and cause problems for our tools) -->
- <exclude>**/dt-*/images/**</exclude>
- <!-- until the code that does this is fixed -->
- <exclude>**/file:/**</exclude>
- <exclude>**/SecurityAuth.audit*</exclude>
- </excludes>
- <includes>
- <include>pom.xml</include>
- <include>build*.xml</include>
- <include>ivy.xml</include>
- <include>ivy/**</include>
- <include>INSTALL</include>
- <include>LICENSE.txt</include>
- <include>mr-client/**</include>
- <include>hadoop-yarn/**</include>
- <include>src/**</include>
- </includes>
- </fileSet>
- <fileSet>
- <outputDirectory>sources</outputDirectory>
- <includes>
- <include>**/bin/*</include>
- <include>**/scripts/*</include>
- </includes>
- <fileMode>0755</fileMode>
- </fileSet>
</fileSets>
<moduleSets>
<moduleSet>
Modified: hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-src.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-src.xml?rev=1183151&r1=1183150&r2=1183151&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-src.xml (original)
+++ hadoop/common/trunk/hadoop-assemblies/src/main/resources/assemblies/hadoop-src.xml Thu Oct 13 22:38:03 2011
@@ -19,18 +19,29 @@
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>hadoop-src</id>
<formats>
- <format>dir</format>
+ <format>tar.gz</format>
</formats>
- <includeBaseDirectory>false</includeBaseDirectory>
+ <includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
- <directory>${project.basedir}</directory>
- <outputDirectory>src/</outputDirectory>
+ <directory>.</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<excludes>
+ <exclude>.git/**</exclude>
+ <exclude>**/.gitignore</exclude>
+ <exclude>**/.svn</exclude>
+ <exclude>**/*.iws</exclude>
+ <exclude>**/*.ipr</exclude>
+ <exclude>**/*.iml</exclude>
+ <exclude>**/.classpath</exclude>
+ <exclude>**/.project</exclude>
+ <exclude>**/.settings</exclude>
+ <exclude>**/target/**</exclude>
+ <!-- until the code that does this is fixed -->
<exclude>**/*.log</exclude>
<exclude>**/build/**</exclude>
- <exclude>**/target/**</exclude>
+ <exclude>**/file:/**</exclude>
+ <exclude>**/SecurityAuth.audit*</exclude>
</excludes>
</fileSet>
</fileSets>
Modified: hadoop/common/trunk/hadoop-project-dist/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-project-dist/pom.xml?rev=1183151&r1=1183150&r2=1183151&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-project-dist/pom.xml (original)
+++ hadoop/common/trunk/hadoop-project-dist/pom.xml Thu Oct 13 22:38:03 2011
@@ -318,45 +318,6 @@
</profile>
<profile>
- <id>src</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-assemblies</artifactId>
- <version>${hadoop.assemblies.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>pre-tar-src</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <appendAssemblyId>false</appendAssemblyId>
- <attach>false</attach>
- <finalName>${project.artifactId}-${project.version}</finalName>
- <descriptorRefs>
- <descriptorRef>hadoop-src</descriptorRef>
- </descriptorRefs>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
<id>dist</id>
<activation>
<activeByDefault>false</activeByDefault>
Modified: hadoop/common/trunk/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/pom.xml?rev=1183151&r1=1183150&r2=1183151&view=diff
==============================================================================
--- hadoop/common/trunk/pom.xml (original)
+++ hadoop/common/trunk/pom.xml Thu Oct 13 22:38:03 2011
@@ -67,6 +67,11 @@
<artifactId>apache-rat-plugin</artifactId>
<version>0.7</version>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
+ </plugin>
</plugins>
</pluginManagement>
@@ -128,4 +133,61 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>src</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>src-dist</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <attach>false</attach>
+ <finalName>hadoop-dist-${project.version}-src</finalName>
+ <outputDirectory>hadoop-dist/target</outputDirectory>
+ <!-- Not using descriptorRef and hadoop-assembly dependency -->
+ <!-- to avoid making hadoop-main to depend on a module -->
+ <descriptors>
+ <descriptor>hadoop-assemblies/src/main/resources/assemblies/hadoop-src.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>src-dist-msg</id>
+ <phase>package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <echo/>
+ <echo>Hadoop source tar available at: ${basedir}/hadoop-dist/target/hadoop-dist-${project.version}-src.tar.gz</echo>
+ <echo/>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
</project>