How to use Meven-Ide to build open-jbi-components (ojc)

This tutorial shows:

How to launch NetBeans for ojc

On windows, create runide.bat:

    @echo off
    set NETBEANS_HOME="somedir/netbeans"
    set JV_SRCROOT=somedrive:\some path\open-jbi-components
    set JV_GFBASE=somedrive:\some path where you installed glassfish
    %NETBEANS_HOME%\bin\netbeans -J-Dmaven.repo.local=%MAVEN_REPOSITORY% %*
    

On unix bash/ksh, create alias:

    export NETBEANS_HOME="somedir/netbeans"
    export JV_SRCROOT="somedir/open-jbi-components"
    export JV_GFBASE="some path where you installed glassfish"
    alias runide='"$NETBEANS_HOME"/bin/netbeans -J-Dmaven.repo.local="$MAVEN_REPOSITORY"'
    

On unix csh/tcsh, create alias:

    setenv NETBEANS_HOME "somedir/netbeans"
    setenv JV_SRCROOT    "somedir/open-jbi-components"
    setenv JV_GFBASE     "some path where you installed glassfish"
    alias runide '"$NETBEANS_HOME"/bin/netbeans -J-Dmaven.repo.local="$MAVEN_REPOSITORY"'
    

Note: you may need to make the unix start-up scripts executable if you installed from a zip or jar:

        chmod +x "$NETBEANS_HOME"/bin/*
    

How to install the Meven-Ide plugin

The features in this tutorial are only available for the Netbeans 6.0 Release. These instructions were tested with the Milestone 8 build of 3/28/07. You can read more about NetBeans 6.0 on the Netbeans 6.0 Wiki.

Warning: If you have installed JDK 6.0 as your default JDK, you need to edit the property netbeans_jdkhome in the file netbeans/etc/netbeans.conf. Set this to the value of your JDK 5.0 home. Otherwise, Netbeans will compile with JDK 6.0, which is not supported at the time of this writing.

You must install the Meven-Ide plugin from within NetBeans using the Update Center Wizard. Do not install the version 2.3 Meven-Ide plugin from the Meven-Ide web site.

From the tools->Update Center menu item, select the Maven Folder, hit the Add button (not Add All!), and then the Next button to continue the wizard.

Observe that you are installing the correct Meven-Ide version.

Click on the Finish button to complete the install.

How to run your first build using Meven-Ide

First, open the open-jbi-components top project. At this time, do not open dependent projects (un-check Open Required Projects).

Next, press the top clean button (the broom icon) to clean the project and import the glassfish dependencies. If this step fails, do not proceed until you have fixed the problem.

After running the top-level clean, hit the build button (the wrench icon) to compile the project.

If both the clean and build complete successfully, then you are in business. If not, check ~/.m2/settings on unix, or %USERPROFILE%\.m2\settings.xml on windows, to ensure that you have set up the correct proxies, mirrors, and private maven repositories. See the build instructions to determine the correct settings.

How to open a component sub-project

For illustrative purposes, we will open the filebcimpl project. This project contains the implementation source code for the ojc File Binding Component.

How to run unit tests

Since we already built the filebc above, we can now run the filebcimpl junit tests.

How to generate the unit test report, with cross-referenced source

After running the unit tests, we can now create the filebcimpl maven site report, by running the custom allreports goal. This also creates the javadoc with cross-referenced source code along with the filebcimpl junit results summary.

How to navigate to the source code for a failing test

We have a couple of filebc junit failures. From the failure summary, we can navigate directly to the filebcimpl test source code.

What's Next?

Hopefully, you now have an idea of how to navigate the project from within NetBeans, using the Meven-Ide. For more information on NetBeans, see netbeans.org. For more information on Meven-Ide, see Meven-Ide home.