Open JBI Components Setup



    If you are using Mac OSX please see this blog for extra setup help http://blogs.sun.com/sambas/entry/mac_osx_how_to_set

  1. Use CVS to check out the Open JBI Components source code

    For general how-to instructions for using CVS on java.net, click here: Source code - CVS. Run the cvs checkout commands in the directory where you want to work on the open-jbi-components source. Navigate to your chosen directory and run the following commands (you may want to use your personal java.net login name instead of guest):

        cvs -d :pserver:guest@cvs.dev.java.net:/cvs login
          type your password if you are using your java.net account. guest account has no password.
        cvs -d :pserver:guest@cvs.dev.java.net:/cvs co open-jbi-components
    
    To only build one of the top-level projects, you do not need the driver-tests project, which is quite large. For example, to build ojc-core, you only need:
        cvs -d :pserver:guest@cvs.dev.java.net:/cvs co -l open-jbi-components
        cvs -d :pserver:guest@cvs.dev.java.net:/cvs co
           open-jbi-components/global-common open-jbi-components/packaging open-jbi-components/ojc-core
    
    The open-jbi-components directory, created by the cvs checkout, will be the root of your open-jbi-components working directory, and we will subsequently refer to this location as JV_SRCROOT.

    Note: If you just want to view the Open JBI components source code locally you can do so now. Otherwise, continue with this procedure.



  2. Configure the build environment:

    The maven scripts require two environmental variables:

      • JV_GFBASE - the directory where you installed Glassfish.
      • JV_SRCROOT - your open-jbi-components cvs working directory.

    For unix and linux shells, these variables can be set in the shell start up files. On Windows they can be set in a bat script or in the control panel.

    In unix or linux shell environments, we recommend creating two shell aliases called smvn and smvntest. Throughout this document we will refer to these aliases as the way to compile and run unit tests. For example, if you are using the tcsh shell, smvn and smvntest can be defined:

        alias smvn 'mvn -Dmaven.test.skip=true -Dmaven.repo.local=$JV_SRCROOT/m2/repository'
        alias smvntest 'mvn -Dmaven.test.skip=false -Dmaven.repo.local=$JV_SRCROOT/m2/repository'
    

    On Windows, create two .bat files:

        smvn.bat:
            @echo off
            set JV_SRCROOT=somedrive:\some path\open-jbi-components
            set JV_GFBASE=somedrive:\some path where you installed glassfish
            mvn -Dmaven.test.skip=true -Dmaven.repo.local=%JV_SRCROOT%\m2\repository %*
    
        smvntest.bat:
            @echo off
            set JV_SRCROOT=somedrive:\some path\open-jbi-components
            set JV_GFBASE=somedrive:\some path where you installed glassfish
            mvn -Dmaven.test.skip=false -Dmaven.repo.local=%JV_SRCROOT%\m2\repository %*
    
    Note: don't forget %* - this allows you to pass arguments to the script.

    The smvn and smvntest are used to simply pass in the location of your maven build repository, which we expect to reside in JV_SRCROOT/m2/repository.



  3. Downloading and installing the Oracle jdbc dependency

    The Oracle JDBC Driver is required to build and run unit tests. After agreeing to Oracle's terms and downloading the jar, install it in your maven build repository as follows:

    mvn -Dmaven.repo.local=$JV_SRCROOT/m2/repository install:install-file \
        -DgroupId=oracle.jdbc -DartifactId=ojdbc14 -Dversion=10.1.0.5 \
        -Dpackaging=jar -DgeneratePom=true -Dfile=path/to/ojdbc14.jar
    
    On Windows, the command is:
    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file
        -DgroupId=oracle.jdbc -DartifactId=ojdbc14 -Dversion=10.1.0.5
        -Dpackaging=jar -DgeneratePom=true -Dfile=path\to\ojdbc14.jar
    
    Note: the above command must appear on a single line.

    Alternatively, just add the oracle driver to your team's private maven repository, as outlined below in the section entitled Installing the dependencies into a local maven2 repository, using these values:

        $file = "ojdbc14.jar"
        $groupId = "oracle.jdbc"
        $artifactId = "ojdbc14"
        $version = "10.1.0.5"
    


  4. Downloading and installing the MQSeriesBC and the SAPBC dependencies

    Building the MQSeriesBC and SAPBC components require that you download and install dependencies that are not under an open-source license.

    You can choose not to build these components by commenting them out as is described in the open-jbi-components/ojc-core/pom.xml file, and as shown below:

    <!--
    # the following projects have non-open-source license dependencies.
    # you must purchase a license or agree to license terms and install
    # the dependencies in local or remote  maven repository by hand,
    # or comment out these projects.
    -->
    <!--
    <module>mqbc</module>
    <module>msmqbc</module>
    <module>sapbc</module>
    -->
    

    Once these lines are commented out, you can skip to the next step and run the build.

    If you decide to build these components you will need to:

    • download the jar files that are the dependencies
    • install the dependencies into a local maven2 repository
    • update your settings.xml file to alert maven to the location of the internal repository.

    These steps are described in more detail below

    Downloading the jar files that are the dependencies:
    The MQSeriesBC compilation requires 2 versions of the com.ibm.mq.jar file. 5.306 and 6.0.0.0. These file should be obtained from a licensed install of MQ client. The SAPBC has three dependencies: sapidoc.jar, sapidocjco.jar and sapjco.jar. These can be obtained by purchasing a license from SAP.

    Installing the dependencies into a local maven2 repository:

    The basic command that you need to run to deploy each of these files is:
    % mvn -Dmaven.repo.local=$local deploy:deploy-file -Durl=file://$remote\
        -Dpackaging=jar -DgeneratePom=true -Dfile=$file\
        -DgroupId=$groupId -DartifactId=$artifactId -Dversion=$version
    

    When running this command, always set the following two variables the same way:

    $local is the location of maven2 artifacts you have downloaded locally (for example: /tmp/myjars).
    $remote is the location of the maven2 repository that you are deploying this file to (for example: /bld/maven2repos).

    When installing com.ibm.mq.jar use these settings for the other variables:

        $file = "com.ibm.mq.jar"
        $groupId = "com.ibm"
        $artifactId = "mq"
        $version = "5.306"
    
        $file = "com.ibm.mq.jar"
        $groupId = "com.ibm"
        $artifactId = "mq"
        $version = "6.0.0.0"
    
    When installing sapidoc.jar use these settings for the other variables:
        $file = "sapidoc.jar"
        $groupId = "com.sap"
        $artifactId = "sapidoc"
        $version = "1.0.3"
    
    When installing sapidocjco.jar use these settings for the other variables:
        $file = "sapidocjco.jar"
        $groupId = "com.sap"
        $artifactId = "sapidocjco"
        $version = "1.0.6"
    
    When installing sapjco.jar use these settings for the other variables:
        $file = "sapjco.jar"
        $groupId = "com.sap"
        $artifactId = "sapjco"
        $version = "2.1.7"
    
    When you are done installing these components, your repository should look like this, not including the maven meta files:
        $remote/com/ibm/mq/5.306/mq-5.306.jar
        $remote/com/sap/sapidoc/1.0.3/sapidoc-1.0.3.jar
        $remote/com/sap/sapidocjco/1.0.6/sapidocjco-1.0.6.jar
        $remote/com/sap/sapjco/2.1.7/sapjco-2.1.7.jar
    

    Update your settings.xml file

    You need to update your $HOME/.m2/settings.xml (%USERPROFILE%\.m2\settings.xml on Windows) so that it contains a profile that points to your internal maven2 repository.

    Here is a example of what settings.xml could look like:

    <settings>
      <profiles>
        <profile>
          <id>private-profile</id>
          <activation>
            <activeByDefault>true</activeByDefault>
          </activation>
          <repositories>
            <repository>
              <id>private-repository</id>
              <name>private artifacts</name>
              <url>$remote</url>
              <releases> <enabled>true</enabled> </releases>
              <snapshots> <enabled>false</enabled> </snapshots>
            </repository>
            <repository>
              <id>java-net-legacy-repository</id>
              <name>java.net Maven 1.x repository</name>
              <url>https://maven-repository.dev.java.net/nonav/repository</url>
              <layout>legacy</layout>
              <releases> <enabled>true</enabled> </releases>
              <snapshots> <enabled>true</enabled> </snapshots>
            </repository>
          </repositories>
        </profile>
      </profiles>
    </settings>
    
    Once this is all configured, you are ready to proceed to the next step.

    See MQSeriesBC wiki for more information on the MQSeries binding, and SAPBC wiki for more information on the SAP binding component.



  5. Downloading and installing the j-Interop dependencies

    Building the DCOM BC component requires that you download and install j-Interop binaries. This is currently a manual step as the j-Interop jar files are not published on any public maven repository. This additional step will cease to exist once the j-Interop jars become available.

    The DCOM BC is not built by default. You can choose to build this component by uncommenting the following line in the open-jbi-components/ojc-core/pom.xml file:

    <!--
    <module>dcombc</module>
    -->
    

    The j-Interop binary can be downloaded from the j-Interop website: j-interop.sourceforge.net. You will need to download version 1.17. The j-Interop binary is distributed in zip format and once you download and unzip the distribution, you will need to install all the artifacts available in the <j-Interop install>/lib directory

    You will have to run the following commands:

    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file 
        -DgroupId=org.jinterop -DartifactId=j-interop -Dversion=1.17 
        -Dpackaging=jar -DgeneratePom=true -Dfile=path\to\j-interop.jar
    
    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file 
        -DgroupId=org.jinterop -DartifactId=iwombat -Dversion=1.17 
        -Dpackaging=jar -DgeneratePom=true -Dfile=path\to\iwombat.jar
    
    
    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file 
        -DgroupId=org.jinterop -DartifactId=jarapac -Dversion=1.17 
        -Dpackaging=jar -DgeneratePom=true -Dfile=path\to\jarapac.jar
    
    
    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file 
        -DgroupId=org.jinterop -DartifactId=jcifs-1.2.9 -Dversion=1.17 
        -Dpackaging=jar -DgeneratePom=true -Dfile=path\to\jcifs-1.2.9.jar
    
    
    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file 
        -DgroupId=org.jinterop -DartifactId=jcifs-ntlm-auth -Dversion=1.17 
        -Dpackaging=jar -DgeneratePom=true -Dfile=path\to\jcifs-ntlm-auth.jar
    
    
    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file 
        -DgroupId=org.jinterop -DartifactId=ncacn_ip_tcp -Dversion=1.17 
        -Dpackaging=jar -DgeneratePom=true -Dfile=path\to\ncacn_ip_tcp.jar
    
    
    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file 
        -DgroupId=org.jinterop -DartifactId=ncacn_np -Dversion=1.17 
        -Dpackaging=jar -DgeneratePom=true -Dfile=path\to\ncacn_np.jar
    
    
    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file 
        -DgroupId=org.jinterop -DartifactId=ntlm-security -Dversion=1.17 
        -Dpackaging=jar -DgeneratePom=true -Dfile=path\to\ntlm-security.jar
    
    
    mvn -Dmaven.repo.local=%JV_SRCROOT%\m2\repository install:install-file 
        -DgroupId=org.jinterop -DartifactId=progIdVsClsidDB -Dversion=1.17 
        -Dpackaging=properties -DgeneratePom=true -Dfile=path\to\progIdVsClsidDB.properties
    
            



  6. Run the build

    Note: to drive your build from NetBeans, see the Meven-Ide Tutorial.

    % cd $JV_SRCROOT (%JV_SRCROOT% on windows)
    % smvn clean
    % smvn (equivalent to "smvn install")
    
    Then run the tests:
    % smvntest
    

    IMPORTANT: you must run "smvn clean" before smvn install. The clean step cleans all projects, and then builds the compileconf project, which is responsible for configuring the glassfish compilation path.

    If you are behind a firewall, maven requires that you setup a ~/m2/settings.xml file. For more information, click HERE to access the build setup FAQ