wood burning stoves*
The moose likes JForum and the fly likes Re-arrange the Jforum repository for 3? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Re-arrange the Jforum repository for 3?" Watch "Re-arrange the Jforum repository for 3?" New topic
Author

Re-arrange the Jforum repository for 3?

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Ok, I'm treading into a religious war zone... project layout. Everyone has a favorite style and many are fanatics about it... but...

In reflecting on the recent forgotten files problems with the 2.1.7 release, it struck me that som re-arrangement of the source code would help keep this from happening in the future.

Here's my favorite for webapps (but I'm not a fanatic about it...).



The advantage is that 99% of what you want in a webapp distro is located in the webroot directory without any extra files mixed in. There is no "list of specific includes/excludes" that you have to maintain to produce a war or simple distro zip.

For testing, just redirect your context doc root the the webroot directory.

FWIW, the existing build file can easily support this layout. Plus I've got some "stock" ant build files that handle creating distributions that would merge in easily with this.

(sound of flame retardent suit being zipped up...)

Comments, etc.

[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Looks very good for me. Question: where do you suggest we put the upgrade scripts and other tools? (like search indexer, phpbb migration etc)

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Tests, Tools, and www are always a "toss up" in my mind. In many ways, they are subprojects and not true "src" material. Probably leaving them at the top level would be fine.

In the case of tools, it would advertise their existence better than being in the src directory.

In the case of tests, I could see this eventually becoming a true subproject with it's own build/run script. E.g., something that created a test db, loaded it with test data, and then runs all the tests. Plus allows developers / testers to provide local info (like DB server info, etc).

And www is the same as these two.

Of course, if we wanted to make it easy for Maven addicts to play along (I'm NOT advocating converting to Maven...) We could use the Maven standard layout that looks like:



See http://www.javaworld.com/javaworld/jw-12-2005/jw-1205-maven.html for details.

In this case, tools and tests would live under src and the www (jforum.net site) would live in src/site. There is a slight attraction to this layout, but it buries things deeper.

As I said, I'm not a fanatic about layout...
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Although you do not want to advocate maven in your post, do you second the opinion of many others that it should be used?

About the www directory, it should be at the root directory because java.net's project page looks for it (well, it only looks for index.html, but all resources used by that page are also expected to be into www). So it's natural to put the website under www/website.



Output dirs are as follow:

- /src/main => /target/webapp/WEB-INF/classes
- /src/tests => /target/tests
- /src/tools => /target/tools
- /src/webapp => /target/webapp

The /src/lib is an auxiliar dir, where stuff like maven, ant, junit and etc are put into. If we are going wit the "Plugins" ideia, the core plugins could be put at /src/plugins directory, as /target/webapp/WEB-INF/classes as output dir.

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Re: Maven use..

I've used Maven as a Apache Torque committer since that's the development environment. Even done some 1.0 plug-in modifications (and looked at some 2.0 plug-in mods).

Maven has some neat features and functions, but my first choice is still Ant.. Mostly due to the extra flexibility you get with it and the centralized documentation.

IMHO, Maven's big problem is that if you start to do anything "non-standard" you end up adding a fairly hefty subproject to your project with a bunch of extra coding in a hodge podge of Jelly "dialects" that are documented all over the place. Personally, I don't think it should take more than a hour or two to get any new special thing added to your build system... (of course all the Maven-ites will start clamoring that you shouldn't HAVE "non-standard" things or how easy it is to call Ant from Maven..).

However, they do have some good ideas on generic standardization, like directory structures... and if we use the Maven standard, Maven-ites can easily add in their maven xml's and project properties files and build jForum that way. So the Ant-people and Maven-ites can play together.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I really don't like the directory structure Maven suggests. It is anything but logical.
Also, if the "only" thing maven would add to the project is an "easier" build, then I vote to keep it away and go with Ant.

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I updated the JForum 3 CVS HEAD and added a section to our JForum 3 documentation named JForum 3 Directory Structure

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Rafael Steil wrote:I updated the JForum 3 CVS HEAD and added a section to our...


"Getting the source code" says JForum 3 is not in HEAD. Is HEAD JForum3 or 2.1.7 now?

"/src/configfiles" - I don't like "files" in the dir name, it is implicit. Why not say: "/src/otherconfig" or something to signify the "3rd party" aspect.
[originally posted on jforum.net by MyJForum]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
HEAD is 2.1.7.

What name do you suggest for the config dir? "otherconfig" seems trick :P

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
How about the Tomcat style: "conf" ?
[originally posted on jforum.net by andowson]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Why not just /config ???

Simple....OK it's not all configs there...but what's the problem with this?
[originally posted on jforum.net by Guilherme Moreira]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Rafael Steil wrote:What name do you suggest for the config dir? "otherconfig" seems trick :P


What does trick mean? Perhaps you mean "tricky"? It can be just "config" if it never gets confused with the other config directory in WEB-INF.

Maybe you can setup a 3rd party directory for src files (and call it custom instead of other):

JForum/src/custom/config

But, why have the "configfiles" anyways? If I wanted to add a source file I would use (example):

JForum/src/com/mycompany/stuff/file.java
JForum/src/com/mycompany/stuff/configfile

P.S. - http://www.jforum.net/doc/JForum3DirectoryStructure has some spelling errors:

/webapp/WEB-INF/classess

etc.

[originally posted on jforum.net by MyJForum]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
MyJForum wrote:
What does trick mean? Perhaps you mean "tricky"? It can be just "config" if it never gets confused with the other config directory in WEB-INF.


yes, I meant "tricky". I don't like just "config" because the ambiguity. But custom/config seems nice.

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I do beg all your pardon...

/upgrade

What's the use of it? Upgrade scripts from 2.1 branch?

I vote for Ant - No Maven. IMHO, KiSS. The problems Maven addresses are neither in short sight or far sight of JForum's development scope. Perhaps when we'd release JForum 10 with features like Voice Natural Recognition and Bayesian Self-Typed Text, that it will require a multitude of build.xml, we'll have problems enough for Maven.

D�rico Filho
[originally posted on jforum.net by dericofilho]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Yes, any kind of upgrade scripts.

We'll go with Ant.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Re-arrange the Jforum repository for 3?