Differences between revisions 4 and 5
Revision 4 as of 2006-11-15 13:51:47
Size: 10273
Comment: please check the spelling im not a native speaker TIA
Revision 5 as of 2009-09-20 23:46:38
Size: 10273
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[[TableOfContents]] <<TableOfContents>>

Introduction

in this page you will learn how to set up a running jetspeed2 system from the latest sources available. first im going to get the latest sources to a local directory where i want my j2 to be, than ill download and install Maven2 mvn, and my last step will be to build the jetspeed2 portal with different database as the one shipped.

please take note that this "howto" is intended for linux users.

Jetspeed2 aka. J2

I assume subversion tools are already installed on your system so here are the steps you will need to do :

  • checking out the sources :

tomcat@bigleo ~ $ cd ~
tomcat@bigleo ~ $ pwd
/home/tomcat

tomcat@bigleo ~ $ svn co http://svn.apache.org/repos/asf/portals/jetspeed-2/trunk J2 
...
A    J2/content-server/pom.xml
A    J2/content-server/README.txt
A    J2/content-server/.cvsignore
 U   J2
Checked out revision 475201.

now we have the latest sources we can go to the next step.

Maven2 aka. mvn

you need to download and install Maven this how i did it :

tomcat@bigleo ~ $ wget http://ftp.plusline.de/ftp.apache.org/maven/binaries/maven-2.0.4-bin.tar.gz
tomcat@bigleo ~ $ tar xzvf maven-2.0.4-bin.tar.gz

#setting the symlink to have a clean path for the $MAVEN_HOME

tomcat@bigleo ~ $ ln -s maven-2.0.4 maven
tomcat@bigleo ~ $ ls -l maven
lrwxrwxrwx 1 tomcat www 11 Nov 15 14:40 maven -> maven-2.0.4

tomcat@bigleo ~ $ cd maven/bin/
tomcat@bigleo ~/maven/bin $ ls
m2  m2.bat  m2.conf  mvn  mvn.bat

tomcat@bigleo ~/maven/bin $ rm *.bat
  • Edit your .bash_profile to be like :

# ~/.bash_profile 
# set Maven PATH so it includes user's private bin if it exists
if [ -d /home/tomcat/maven/bin ] ; then
    PATH=/home/tomcat/maven/bin:"${PATH}"
fi
  • activate and Test the changes:

tomcat@bigleo ~ $  . ~/.bash_profile
tomcat@bigleo ~ $ mvn -version
Maven version: 2.0.4

looks fine so far

The Procedure

  • Now what we need to do is to define some env variable,set some configuration for maven and adjust some build files for building. following is a quick summary of the current Jetspeed2 Maven2 build commands, (most of these commands can be executed at the root of the J2 source tree or at lower levels to perform partial builds/deployments)

  • run mvn in your home directory just in order mvn can creates its config directory .m2:

tomcat@bigleo ~ $ mvn
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] You must specify at least one goal. Try 'install'
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Wed Nov 15 19:23:30 CET 2006
[INFO] Final Memory: 1M/2M
[INFO] ------------------------------------------------------------------------

ignore the BUILD FAILURE since we only want the .m2 directory to be created.

  • get a sample setting from J2 where you checked the sources:

tomcat@bigleo ~/J2 $ cp settings.xml.sample ~/.m2/settings.xml

than edit your new copied settings.xml to reflect your environments:

<!-- $CATALINA_HOME -->
<org.apache.jetspeed.server.home>/home/tomcat/www</org.apache.jetspeed.server.home>
<!-- CATALINA Version -->
<org.apache.jetspeed.catalina.version.major>5.5</org.apache.jetspeed.catalina.version.major>
<!-- HOST -->
<org.apache.jetspeed.services.autodeployment.server>localhost</org.apache.jetspeed.services.autodeployment.server>
<!-- CATALINE HTTP PORT -->
<org.apache.jetspeed.services.autodeployment.port>8080</org.apache.jetspeed.services.autodeployment.port>
<!- a username for a user with a MANAGER ROLE if you dont have one go ahead and create one -->
<org.apache.jetspeed.services.autodeployment.user>j2deployer</org.apache.jetspeed.services.autodeployment.user>
<!- the password for a the username above -->
<org.apache.jetspeed.services.autodeployment.password>j2deployer</org.apache.jetspeed.services.autodeployment.password>

At this stage you should be able to build your jetspeed2 portal but remember that when you do so at here you will get a default system with the prepackages db engige hsqldb if this is what you want pick a command from the following and change your working directory to J2 and run it

Jetspeed2 Maven2 commands

commands

explanation

mvn

performs base build and installs J2 artifacts in the Maven2 repository, (install is the default Maven2 goal for this build)

mvn -P test

performs base build and includes execution of test cases, (includes test database setup)

mvn -P tomcat

performs base build and deploys to Tomcat app server, (includes prodution database setup). Other app servers will be supported in the future, (see below for details)

mvn clean

cleans all build target directories

other commands

explanation

examples

in many cases you will need/want/like to use a differnt db engine for that you will need to create a username and password that can access the database where you want J2 to be installed i created this database :

  • ~/m2/settings.xml (example for postgres):

<!-- for testing  -->

<org.apache.jetspeed.test.jdbc.drivers.path>/home/tomcat/www/common/lib/postgresql-8.1-407.jdbc3.jar</org.apache.jetspeed.test.jdbc.drivers.path>
<org.apache.jetspeed.test.database.default.name>j2test</org.apache.jetspeed.test.database.default.name>
<org.apache.jetspeed.test.database.url>jdbc:postgresql://192.168.0.164:5432/j2test</org.apache.jetspeed.test.database.url>
<org.apache.jetspeed.test.database.driver>org.postgresql.Driver</org.apache.jetspeed.test.database.driver>
<org.apache.jetspeed.test.database.user>dbuser1</org.apache.jetspeed.test.database.user>
<org.apache.jetspeed.test.database.password>dbuser1pass</org.apache.jetspeed.test.database.password>

<!-- the main Jetspeed2 database and user -->

<org.apache.jetspeed.test.jdbc.drivers.path>/home/tomcat/www/common/lib/postgresql-8.1-407.jdbc3.jar</org.apache.jetspeed.test.jdbc.drivers.path>
<org.apache.jetspeed.test.database.default.name>postgres</org.apache.jetspeed.test.database.default.name>
<org.apache.jetspeed.test.database.url>jdbc:postgresql://192.168.0.164:5432/j2</org.apache.jetspeed.test.database.url>
<org.apache.jetspeed.test.database.driver>org.postgresql.Driver</org.apache.jetspeed.test.database.driver>
<org.apache.jetspeed.test.database.user>dbuser</org.apache.jetspeed.test.database.user>
<org.apache.jetspeed.test.database.password>dbuserpass</org.apache.jetspeed.test.database.password>

<!-- This should be commented -->
<!--
        <activeProfile>jetspeed-db-embedded-hsql</activeProfile>
-->
<!-- and This should be uncommented : -->

<activeProfile>jetspeed-db-drivers-path</activeProfile>

now you can build your portal with postgres as a db engine, good luck!

PostgreSQL

<org.apache.jetspeed.test.jdbc.drivers.path>/home/tomcat/www/common/lib/postgresql-8.1-407.jdbc3.jar</org.apache.jetspeed.test.jdbc.drivers.path>
<org.apache.jetspeed.test.database.default.name>j2test</org.apache.jetspeed.test.database.default.name>
<org.apache.jetspeed.test.database.url>jdbc:postgresql://192.168.0.164:5432/j2test</org.apache.jetspeed.test.database.url>
<org.apache.jetspeed.test.database.driver>org.postgresql.Driver</org.apache.jetspeed.test.database.driver>
<org.apache.jetspeed.test.database.user>dbuser1</org.apache.jetspeed.test.database.user>
<org.apache.jetspeed.test.database.password>dbuser1pass</org.apache.jetspeed.test.database.password>

<!-- the main Jetspeed2 database and user -->

<org.apache.jetspeed.test.jdbc.drivers.path>/home/tomcat/www/common/lib/postgresql-8.1-407.jdbc3.jar</org.apache.jetspeed.test.jdbc.drivers.path>
<org.apache.jetspeed.test.database.default.name>postgres</org.apache.jetspeed.test.database.default.name>
<org.apache.jetspeed.test.database.url>jdbc:postgresql://192.168.0.164:5432/j2</org.apache.jetspeed.test.database.url>
<org.apache.jetspeed.test.database.driver>org.postgresql.Driver</org.apache.jetspeed.test.database.driver>
<org.apache.jetspeed.test.database.user>dbuser</org.apache.jetspeed.test.database.user>
<org.apache.jetspeed.test.database.password>dbuserpass</org.apache.jetspeed.test.database.password>

MySQL

<org.apache.jetspeed.test.jdbc.drivers.path>PATH TO DRIVER</org.apache.jetspeed.test.jdbc.drivers.path>
<org.apache.jetspeed.test.database.default.name>mysql</org.apache.jetspeed.test.database.default.name>
<org.apache.jetspeed.test.database.url>jdbc URL to database </org.apache.jetspeed.test.database.url>
<org.apache.jetspeed.test.database.driver>driver Name</org.apache.jetspeed.test.database.driver>
<org.apache.jetspeed.test.database.user>dbuser</org.apache.jetspeed.test.database.user>
<org.apache.jetspeed.test.database.password>dbuserpass</org.apache.jetspeed.test.database.password>

<!-- the main Jetspeed2 database and user -->

<org.apache.jetspeed.test.jdbc.drivers.path>PATH TO DRIVER</org.apache.jetspeed.test.jdbc.drivers.path>
<org.apache.jetspeed.test.database.default.name>mysql</org.apache.jetspeed.test.database.default.name>
<org.apache.jetspeed.test.database.url>jdbc URL to database </org.apache.jetspeed.test.database.url>
<org.apache.jetspeed.test.database.driver>driver Name</org.apache.jetspeed.test.database.driver>
<org.apache.jetspeed.test.database.user>dbuser</org.apache.jetspeed.test.database.user>
<org.apache.jetspeed.test.database.password>dbuserpass</org.apache.jetspeed.test.database.password>

for more examples see the settings.xml.sampledelivered with your J2 sources if you still have questions --> the mailing list is your friend or start your rusty irc client and connect to freenode #tomcat you'll finde me there yassine ill be glade to share

Jetspeed2/ThirdPartyDatabaseBuild (last edited 2009-09-20 23:46:38 by localhost)