Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Using JForum .jars in Eclipse

 
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On using binary/.jars,

Cons
  • Code updates will still need work. JForum and JForum2 have gone to some lengths to make this easy, but it is still unlikely that .jar replacement will be a seamless update.

  • Pros
  • Easy, yet configurable. JForum (and JForum2) are built like a small CMS. If templating and configuration are all that is needed, this is the way to go.

  • So, even if downloads will bundle as a .war for deployment, how can this structure be imported to an IDE like Eclipse?


    Steps

    Getting the code
    - JForum2
    Is available as a .war,
    https://code.google.com/p/jforum2/downloads/list

    If the .war is extracted, there is no source, but a jforum-x.x.x.jar will be found in,
    WEB-INF/lib. As far as I can see, there are no build facilities.

    - JForum
    Is available as a .zip,
    http://jforum.net/download.jsp

    If .zip is extracted, there is no source, the classes are precompiled into,
    WEB-INF/classes/net/jforum. There is a Maven .pom file in /META-INF/maven/net.jforum/jforum/pom.xml.


    Import into Eclipse
    - JForum2
    Is a .war. In Eclipse,
    File > import > Web > War File > Next ...
    Ignore import "WAR Import: Web libraries". These are all stock for JForum2, and should work as expected.

    - JForum
    None of the Eclipse "File > Import" options will work. The handy looking "Install" imports seem to be for importing code from existing projects. Likewise, in the "General" section, the options "Archive File" and "File System".

    However, the project can be imported using a stock Java approach by making a .war (which will work because the folders are configured to be a .war),

    cd into the folder then make a .war,
    jar -cvf jforum-x.x.x.war *

    In Eclipse,
    File > import > Web > War File > Next ...

    Browse for the .war, name the project (optional), then "Finish"

    Adding Maven
    If Maven control is desired (for adding additional functionality in an agreeable way), well, what you have depends on the version of JForum used. JForum2 has a .pom file, deep inside folders, META-INF/maven/net.jforum/jforum. JForum 2.1.9 has nothing.

    The JForum2 .pom file is not, as far as I know, reusable. It is a relic from when the JForum2 structure was built. For example, all the filepaths are wrong, referring to non-existent source folders (this wouldn't be the case for a source download, which would rely on the .pom). And JForum2 can not be imported as a Maven project, because the support folder structure is required.

    In either case, as far as I know, if the binary project would be helped by Maven, then another .pom is needed. Fortunately, Eclipse can fix this. In the left panel,

    Right click on the project then,
    Configure > Convert to Maven Project

    Unless any modifications are needed immediately, agree to the stock setup. The result will be a .pom file, sited in the top level of the project.

    To use this, Eclipse needs a run configuration,
    Run > Run As > Maven Build

    Then set,
    Goal = "package"
    And tick "Skip tests".

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

    This Maven build will only cover additions to JForum, not the original or a full build, but that should be enough.
     
    author & internet detective
    Posts: 41967
    911
    Eclipse IDE VI Editor Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    JForum has nothing.


    I think you are missing a version # here.
     
    robert crowther
    Ranch Hand
    Posts: 41
    10
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Yes, I should have done. The reference is to JForum, as available at the time of writing, from the original site - 2.1.9. Other versions differ, and it's clear that JForum2 has adapted slightly different internal structure and publishing for the code resource.
     
    Jeanne Boyarsky
    author & internet detective
    Posts: 41967
    911
    Eclipse IDE VI Editor Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    robert crowther wrote:Yes, I should have done. The reference is to JForum, as available at the time of writing, from the original site - 2.1.9. Other versions differ, and it's clear that JForum2 has adapted slightly different internal structure and publishing for the code resource.


    Ah ok. I've edited that into your post since it was confusing without.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic