Review Board 1.7.22


SQOOP-930 Sqoop2: Devguide: Building and setting up developer environment

Review Request #9722 - Created March 3, 2013 and submitted

Jarek Cecho
SQOOP-930
Reviewers
Sqoop
sqoop-sqoop2
Building Sqoop from source code guide.

 

Diff revision 2

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

1 2 3
1 2 3

  1. docs/src/site/sphinx/BuildingSqoop2.rst: Loading...
  2. docs/src/site/sphinx/index.rst: Loading...
docs/src/site/sphinx/BuildingSqoop2.rst
New File

    
   
1
.. Licensed to the Apache Software Foundation (ASF) under one or more

    
   
2
   contributor license agreements.  See the NOTICE file distributed with

    
   
3
   this work for additional information regarding copyright ownership.

    
   
4
   The ASF licenses this file to You under the Apache License, Version 2.0

    
   
5
   (the "License"); you may not use this file except in compliance with

    
   
6
   the License.  You may obtain a copy of the License at

    
   
7

   

    
   
8
       http://www.apache.org/licenses/LICENSE-2.0

    
   
9

   

    
   
10
   Unless required by applicable law or agreed to in writing, software

    
   
11
   distributed under the License is distributed on an "AS IS" BASIS,

    
   
12
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    
   
13
   See the License for the specific language governing permissions and

    
   
14
   limitations under the License.

    
   
15

   

    
   
16

   

    
   
17
================================

    
   
18
Building Sqoop2 from source code

    
   
19
================================

    
   
20

   

    
   
21
This guide will show you how to build Sqoop2 from source code. Sqoop is using `maven <http://maven.apache.org/>`_ as build system. You you will need to use at least version 3.0 as older versions will not work correctly. All other dependencies will be downloaded by maven automatically. With exception of special JDBC drivers that are needed only for advanced integration tests.

    
   
22

   

    
   
23
Downloading source code

    
   
24
-----------------------

    
   
25

   

    
   
26
Sqoop project is using git as a revision control system hosted at Apache Software Foundation. You can clone entire repository using following command:

    
   
27

   

    
   
28
::

    
   
29

   

    
   
30
  git clone https://git-wip-us.apache.org/repos/asf/sqoop.git sqoop2

    
   
31

   

    
   
32
Sqoop2 is currently developed in special branch ``sqoop2`` that you need to check out after clone:

    
   
33

   

    
   
34
::

    
   
35

   

    
   
36
  cd sqoop2

    
   
37
  git checkout sqoop2

    
   
38

   

    
   
39
Building project

    
   
40
----------------

    
   
41

   

    
   
42
You can use usual maven targets like ``compile`` or ``package`` to build the project. Sqoop supports two major Hadoop revisions at the moment - 1.x and 2.x. As compiled code for one Hadoop major version can't be used on another, you must compile Sqoop against appropriate Hadoop version. You can change the target Hadoop version by specifying ``-Dhadoop.profile=$hadoopVersion`` on the maven command line. Possible values of ``$hadoopVersions`` are 100 and 200 for Hadoop version 1.x and 2.x respectively. Sqoop will compile against Hadoop 2 by default. Following example will compile Sqoop against Hadoop 1.x:

    
   
43

   

    
   
44
::

    
   
45

   

    
   
46
  mvn compile -Dhadoop.profile=100

    
   
47

   

    
   
48
Maven target ``package`` can be used to create Sqoop packages similar to the ones that are officially available for download. Sqoop will build only source tarball by default. You need to specify ``-Pbinary`` to build binary distribution. You might need to explicitly specify Hadoop version if the default is not accurate.

    
   
49

   

    
   
50
::

    
   
51

   

    
   
52
  mvn package -Pbinary

    
   
53

   

    
   
54
Running tests

    
   
55
-------------

    
   
56

   

    
   
57
Sqoop supports two different sets of tests. First smaller and much faster set is called unit tests and will be executed on maven target ``test``. Second larger set of integration tests will be executed on maven target ``integration-test``. Please note that integration tests might require manual steps for installing various JDBC drivers into your local maven cache.

    
   
58

   

    
   
59
Example for running unit tests:

    
   
60

   

    
   
61
::

    
   
62

   

    
   
63
  mvn test

    
   
64

   

    
   
65
Example for running integration tests:

    
   
66

   

    
   
67
::

    
   
68

   

    
   
69
  mvn integration-test
docs/src/site/sphinx/index.rst
Revision b1331614a6952dbd4fe2d7e1f623a25e0e266959 New Change
 
  1. docs/src/site/sphinx/BuildingSqoop2.rst: Loading...
  2. docs/src/site/sphinx/index.rst: Loading...