Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JForum and the fly likes The canonical source-in-Eclipse setup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "The canonical source-in-Eclipse setup" Watch "The canonical source-in-Eclipse setup" New topic
Author

The canonical source-in-Eclipse setup

robert crowther
Ranch Hand

Joined: Oct 19, 2013
Posts: 41
    
  10
At roughly the same time (a few days earlier) than I posted a hack method of using JForum with Eclipse on CodeRanch, the maintainer of JForum2 posted his own guide on the JForum2 site.

Some work has been done on the site (either by Google or the maintainer), which has for a while made it hard to source these links. The install directions are in a JForum2 site attached to the side of whatever is currently running as the main site (*not* on the wiki). This link currently leads to the board itself, and the posts are sticky at the top,
http://jforum.andowson.com/forums/show/3.page

You need the "JForum2 Developer Quick-Start Guide",
http://jforum.andowson.com/posts/list/84.page

This is fairly awe-inspiring piece of work, screenshots into a .docx. You may prefer to follow that, or the below, or swap between them if there are any unclear points,

Cons,
  • Hassle in setup. Requires gear installed on the host computer, in Eclipse, some outside commandlines, and more.

  • Pros
  • Cannonical method of getting JForum running ...so repeatable, and buildable in most circumstances.

  • This method should (I've not tried...) be able to check out any revision, but then the hack method (see below) may be as useful or better.This method is likely best for those wanting to contribute to source, or have formal requirements for coding process.

    For those wanting to hack, have a look at the hack method too. The hack method flattens the folder layout, separating out the webapp/ and src/ folders. This may be your preference, or not...
    http://www.coderanch.com/t/623839/jforum/Import-Google-JForum-source-Eclipse

    Steps

    Install a JRE
    The JForum2 instructions have several steps for importing a JRE. However, JForum is known to run on modern JREs, including OpenJDK, and most installs of Eclipse will include either a JRE and/or full JDK, so those instructions are skipped here. If you have problems, or simply need Java installed, refer to the JForum2 instructions.

    Install Maven/Java in the environment
    Maven/Java is needed on the host computer. Up-to-date packaging will likely be ok (I understand JForum, even Jforum2, has not much need of the cutting edge).

    Get an ojdbc-14 .jar
    This setup requires the database driver. This is presumably not published in Maven repositories, so needs individual downloading,
    http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-10201-088211.html
    Aggravatingly, not only is this .jar not in repositories, but it is protected by "Sign up!" notices. It might be sourced elsewhere (I did)?

    As Maven will be looking for this code, this needs to go in the Maven repository. Use the following commandline,
    > mvn install:install-file -Dfile=ojdbc14.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar

    If Eclipse doesn't have one, install a subversion plugin
    There are two,
  • Subclipse http://marketplace.eclipse.org/content/subclipse#.UtaXY9-83FY
  • Subversive http://www.eclipse.org/subversive/

  • SubEclipse comes from the subversion coders and is reputedly stable, Subversive is more advanced but reputedly less stable. That's all I can tell you. I tried SubEclipse,
    Help > Marketplace

    Search for "subeclipse" or "maven", Press the little 'install' button.

    (For SvnEclipse) Add native support for svn and Java
    Subversion must be installed on the host environment, not just internally in Eclipse. Also, SubEclipse uses native libraries via an adaptor. If you use packaging, you may be in luck. For example, apt-get distros have,
    libsvnclientadapter

    You can just hunt for JavaHL, that should find required packaging.

    If Eclipse doesn't have one, install a Maven plugin

    Most Eclipse version - Eclipse Java EE IDE - comes with one. Check under,
    Help > About

    If not, follow the instructions above and get,
    m2e
    m2e-wtp

    from,
    Help > Marketplace.

    Import source via SVN and the Eclipse plugin
    File > Import > Checkout Projects from SVN

    Leave the next panel with the radio checked as,
    "Create a new repository location"

    On the following panel, set the URL for download. The URL use depends on your needs for JForum?...
    https://jforum2.googlecode.com/svn/trunk

    The panel following that should show automatically the folder tree of the subversion download,

    Select the root folder and click "Finish"

    Now the source code tree should be imported into Eclipse.

    Make Maven build from .pom locally
    In Eclipse, on the left panel, should be the newly created project,
    jforum2

    Right click the 'jforum2' entry, then,
    Preferences > JavaEE Integration > Enable Project Specific Preferences


    Set a runtime launch for Maven
    Do,
    Run > Run As > Maven Build

    Then set,
    Goal = "package"

    And untick "Skip tests",

    Now, that run configuration can be applied and run, either immediately or by selecting from the menus under "Run".

    Phew(!)



    [eclipse_jforum_svn_checkout.png]


    [eclipse_jforum_maven_runconfig.png]

     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: The canonical source-in-Eclipse setup