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.