#HBase2Maven plan # IMPORTANT: If you have a Nexus repository manager (or equivalent, say Artifactory), you will need to: # 1) Configure the following repositories to mirror, if you haven't already # asf-snapshots:Apache Public Snapshots:https://repository.apache.org/content/repositories/snapshots/ :snapshots=true,releases=true java.net:Java.Net:http://download.java.net/maven/2/ :snapshots=false,releases=true googlecode:Google Code:http://google-maven-repository.googlecode.com/svn/repository :snapshots=false,releases=true codehaus:Codehaus Public:http://repository.codehaus.org/ :snapshots=false,releases=true paulspecial:Special Repo used to hold Thrift and Zookeeper in the interim:http://people.apache.org/~psmith/hbase/repo :snapshots=false,releases=true Make sure you set the snapshots & release settings correctly! :) # OR # # 2a) Upload the zookeeper and thrift jars to a local Nexus(or equiv) internal release repository # OR # 2b) manually install them into your local repo: # mvn install:install-file -Dfile=/workspace/hbase-trunk/lib/zookeeper-3.2.2.jar -DgroupId=org.apache.hadoop.zookeeper -DartifactId=zookeeper -Dversion=3.2.2 -Dpackaging=jar # mvn install:install-file -Dfile=/workspace/hbase-trunk/lib/libthrift-0.2.0.jar -DgroupId=org.apache.thrift -DartifactId=thrift -Dversion=0.2.0 -Dpackaging=jar # This is because in the standard case, your settings.xml points your Maven install direct to Nexus, and bypasses the repository definitions in the poms. # # Deploying the Thrift and Zookeeper jars to an online public repository can be done here (note: if you have Nexus etc, you will still need to do the above) # mvn deploy:deploy-file -Dfile=/workspace/hbase-trunk/lib/zookeeper-3.2.2.jar -DgroupId=org.apache.hadoop.zookeeper -DartifactId=zookeeper -Dversion=3.2.2 -Dpackaging=jar -DrepositoryId=YOURSITEID -Durl=YOURURL # mvn deploy:deploy-file -Dfile=/workspace/hbase-trunk/lib/libthrift-0.2.0.jar -DgroupId=org.apache.thrift -DartifactId=thrift -Dversion=0.2.0 -Dpackaging=jar -DrepositoryId=YOURSITEID -Durl=YOURURL # NOTE: Replace 'YOURSITEID' with the id of the authentication snippet from your ~/.m2/settings.xml # Note: Replace the "YOURURL" to be the url location of the SCP destination you want, an example would be 'scp://people.apache.org/home/psmith/public_html/hbase/repo/' for a directory on your Apache hosted account (directories are automatically created) # Creating the patch for the pom's is done as follows, not sure why 'svn diff' does not do this naturally # find . -name 'pom.xml' -or -name 'saveVersion.sh' -or -name 'bin.xml' | xargs svn diff --diff-cmd=diff -x '-Naurp' > ~/Documents/Apache/Hadoop/Hbase/HBASE-2099.13.patch # Herein lies the changes necessary by you to modify the existing Hbase-trunk directory structure to conform to the Maven poms I have created svn mv src/contrib contrib svn mv --parents src/java core/src/main/java svn mv --parents conf/hbase-default.xml core/src/main/resources/hbase-default.xml svn mv --parents src/test/ core/src/test/java # Relocate the resource files out of the java directories and into their own resource directories # I'm sure this is a dumb way to do it it's just they way I sometimes think... find core/src/main/java/ -type f | fgrep -v '.java' | fgrep -v '.svn' |fgrep -v '.DS_Store' | awk '{print $0 " " $0}' | sed -e 's/src\/main\/java/src\/main\/resources/' | awk '{print "svn mv --parents "$2 " " $1}' | sh find core/src/test/java/ -type f | fgrep -v '.java' | fgrep -v '.svn' |fgrep -v '.DS_Store' | awk '{print $0 " " $0}' | sed -e 's/src\/test\/java/src\/test\/resources/' | awk '{print "svn mv --parents "$2 " " $1}' | sh # I don't think this is even used at all in the code base, but I think this makes more sense living here... svn mv --force core/src/test/resources/data/hbase-0.19-two-small-tables.zip core/src/test/resources/ svn mv src/saveVersion.sh core/src/ # no longer think this is correct svn mv src/webapps core/src/main/ svn mv src/webapps core/src/main/resources/ # Add new POMs, note this patch file MUST be in the format generated further above, without that -Naurp, new files do not get added properly. # NOTE: Please change the full path to the patch file location patch -p0 < ~/Documents/Apache/Hadoop/Hbase/HBASE-2099.13.patch # tidy up some svn stuff now by adding in all the new pom's that the patch file created svn status | fgrep '?' | fgrep -v 'target' | awk '{print $2}' | xargs svn add # NOTE: add 'target' as an ignore candidate svn propedit svn:ignore . #add 'target' as ignore directory svn propedit svn:ignore core #add 'target' as ignore directory svn propedit svn:ignore contrib/stargate #add 'target' as ignore directory svn propedit svn:ignore contrib/transactional #add 'target' as ignore directory # this is needed before commit, also makes patch creation easier # svn add contrib/pom.xml contrib/transactional/pom.xml contrib/stargate/pom.xml # need to configure Maven to use a bit more memory than the default export MAVEN_OPTS="-Xmx512m" # fire away! # We skip execution of tests because currently 2 tests still fail, and 1 file doesn't have a test (which is an error under surefire) # but we don't skip _generation_ of the test artifacts, because contrib tests utilise them mvn -DskipTests clean package assembly:assembly echo "Look inside hbase-trunk/target/ directory, there is a binary artifact to un-tar for your pleasure" #TODO # * Ensure all plugins have a defined version # in it (the latest)