hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject Hbase/MavenPrimer reverted to revision 5 on Hadoop Wiki
Date Mon, 17 May 2010 18:08:02 GMT
Dear wiki user,

You have subscribed to a wiki page "Hadoop Wiki" for change notification.

The page Hbase/MavenPrimer has been reverted to revision 5 by jgray.
The comment on this change is: Stack and jgray conflicts, reverting and will reapply.
http://wiki.apache.org/hadoop/Hbase/MavenPrimer?action=diff&rev1=7&rev2=8

--------------------------------------------------

  == Table of Contents ==
+ 
   1. [[#whatdoineed|What do I need?]]
   1. [[#ide|What about IDE support?]]
   1. [[#jar|How do I just build the jars without going through a full unit test cycle?]]
@@ -10, +11 @@

   1. [[#oneunittest|How do I run one unit test only?]]
   1. [[#starthbase|How do I do an in-situ bin/start-hbase.sh?]]
   1. [[#equiv|How do I do the equivalent of an "ant clean", or "ant jar", etc., using maven?]]
-  1. [[#jar|How do I try out a jar that is not installed in a maven repository (e.g. a new
zookeeper jar)?]]
- 
  
  <<Anchor(whatdoineed)>>
  
  == What do I need? ==
+ 
+ You need Maven 2.0.9 or greater, I would recommend Maven 2.2 though.  Downloads here:
  
  http://maven.apache.org/download.html
  
@@ -25, +26 @@

  
  export MAVEN_OPTS="-Xmx512m"
  
- as there are a few things within the build that require more than the standard JVM memory
allows.
+ as there are a few things within the build that require more than the standard JVM memory
allows.  
+ 
+ <<Anchor(ide)>>
  
  == What about IDE support? ==
+ 
  IntelliJ: Built-in awesomeness.  It just works.
  
- Eclipse: Definitely recommend the M2Eclipse plugin here: http://m2eclipse.sonatype.org/.
Or, you can have eclipse generate the {{{.classpath}}} and {{{.project}}} for you.  This works
pretty well.  First do {{{$ mvn install}}} or {{{$ mvn -DskipTests install}}}.  Then do {{{$mvn
eclipse:eclipse}}}.  This writes the eclipse files for core and each of the contribs.  In
eclipse, you'd open new project based off existing sources.  You will have to symlink hbase/core
under your eclipse workspace to get around eclipse complaint that projects need to be just
inside the elipse workspace.
+ Eclipse: Definitely recommend the M2Eclipse plugin here: http://m2eclipse.sonatype.org/.
Or, you can have eclipse generate the {{{.classpath}}} and {{{.project}}} for you.  This works
pretty well.  First do {{{$ mvn install}}}.  Then do {{{$mvn eclipse:eclipse}}}.  This writes
the eclipse files for core and each of the contribs.  In eclipse, you'd open new project based
off existing sources.  You will have to symlink hbase/core under your eclipse workspace to
get around eclipse complaint that projects need to be just inside the elipse workspace.
  
  <<Anchor(jar)>>
+ == How do I just build the jars without going through a full unit test cycle? ==
  
- == How do I just build the jars without going through a full unit test cycle? ==
+ From the top-level directory:
+ 
  mvn -DskipTests package
  
  you'll find the jars under the 'target' sub-directory of each sub-module, so 'hbase/core/target/hbase-core-0.20.1.jar'
is effectively the original 'hbase.jar' produced previously.
  
  <<Anchor(full)>>
- 
  == How do I do a full Distribution style build, including running all the tests? ==
  
+ From the top-level directory:
+ 
+ mvn install assembly:assembly
+ 
- In the top-level 'hbase/target' directory you will find a set of tar balls and zip files.
 the '-bin' contains something akin to the original HBase release tar ball.  The -'project'
and -'src' are there to provide an archive of the entire Maven project as it stood during
release, and a slimmer, source-only bundle respectively.
+ In the top-level 'hbase/target' directory you will find a set of tar balls and zip files.
 the '-bin' contains something akin to the original HBase release tar ball.  The -'project'
and -'src' are there to provide an archive of the entire Maven project as it stood during
release, and a slimmer, source-only bundle respectively.  
  
  <<Anchor(core)>>
+ == I don't want to build all the other modules, I'm just interested in the base Hbase 'core'
stuff, is there something simpler? ==
  
- == I don't want to build all the other modules, I'm just interested in the base Hbase 'core'
stuff, is there something simpler? ==
  sure, just:
  
+ cd core
- cd core mvn -DskipTests package
+ mvn -DskipTests package
+ 
+ look in the target sub-directory.
+ 
  <<Anchor(javadoc)>>
  
  == How do I build javadoc only? ==
+ 
+ {{{mvn javadoc:javadoc}}}
+ 
+ <<Anchor(oneunittest)>>
+ 
  == How do I run one unit test only? ==
  
- ---- /!\ '''Edit conflict - other version:''' ----
+ {{{mvn mvn test -Dtest=<CLASSNAME>}}}
+ 
+ <<Anchor(starthbase)>>
+ 
+ == How do I do an in-situ bin/start-hbase.sh? ==
+ 
+ To get around {{{java.lang.ClassNotFoundException}}} when you run {{{${HBASE_HOME}/bin/start-hbase.sh}}}
in-situ -- i.e. you are trying to run hbase in-place from where you did your checkout -- 
do the following:
+ 
+ {{{
+ $ mvn install # Pass -DskipTests if you'd avoid running tests. Install is needed to get
hbase jars into mvn local repo under ~/.m2
+ $ HBASE_CLASSPATH=`mvn -q dependency:build-classpath -Dmdep.outputFile="/tmp/cp.txt"; cat
"/tmp/cp.txt"` ./bin/start-hbase.sh
+ }}}
+ 
  <<Anchor(equiv)>>
  
  == How do I do the equivalent of an "ant clean", or "ant jar", etc., using maven? ==
+ 
- ||ant clean ||mvn clean # Run mvn -q clean to have it run quietly ||
+ ||ant clean||mvn clean # Run mvn -q clean to have it run quietly||
- ||ant compile ||mvn compile ||
+ ||ant compile||mvn compile||
- ||ant jar ||mvn -DskipTests install # Mvn by default runs tests before it makes jar as opposed
to ant which does jar first.  Both go down into contrib dirs and build jars down in there
too.  Mvn will actually install the jars into your local mvn repo.  This is probably what
you want if you want to go on to run hbase ||
+ ||ant jar||mvn -DskipTests install # Mvn by default runs tests before it makes jar as opposed
to ant which does jar first.  Both go down into contrib dirs and build jars down in there
too.  Mvn will actually install the jars into your local mvn repo.  This is probably what
you want if you want to go on to run hbase||
  ||ant test||mvn test||
  ||ant test -Dtestcase=TestClient||mvn test -Dtest=TestClient||
  
  For more on the [[http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html|mvn
lifecycles...]]
  
- <<Anchor(jar)>>
- == How do I try out a jar that is not installed in a maven repository (e.g. a new zookeeper
jar)? ==
- Here is how you'd have it use a zookeeper jar that was added to the {{{${HBASE_HOME}/lib}}}
directory.
- 
- Edit the core/pom.xml since its hbase core that depends on zk:
- 
- {{{
- Index: core/pom.xml
- ===================================================================
- --- core/pom.xml        (revision 943580)
- +++ core/pom.xml        (working copy)
- @@ -223,6 +223,9 @@
-      <dependency>
-        <groupId>org.apache.hadoop</groupId>
-        <artifactId>zookeeper</artifactId>
- +      <scope>system</scope>
- +      <!--Go up to the lib dir at ${HBASE_HOME} to find zk jar-->
- +      <systemPath>${basedir}/../lib/zookeeper-3.3.1.jar</systemPath>
-      </dependency>
-  
-      <dependency>
- @@ -277,4 +280,4 @@
-        <artifactId>hadoop-test</artifactId>
-      </dependency>
-    </dependencies>
- -</project>
- \ No newline at end of file
- +</project>
- }}}
- 

Mime
View raw message