One source tree used my many modules

I want to maintain 1 source tree in source control, but I have a need for multiple modules. I have some EJB's, some common VO's and Exceptions and multiple Struts Web Apps that front end them.

Is there a way to have one directory with the source tree and others that root the various modules with the necessary WEB-INF and META-INF directories?

I have tried to make a java module with all source and various other ejb and web modules that depend on it to make the modules, but each module must include ALL of the classes from the master source module or NONE. There seems to be no granularity. I wnat to be able to pick and choose what goes in to the deployments.

One of the best features of JBuilder is if you want to build an archive like a jar or war you tell it the root of the classes; that is, the required entry point classes and it figures out for you what other classes also need to be brought in based on the needs of those classes. You can customize exactly what goes into each module from all the various dependancies and libraries.

Is there a way to do any of this?

While I would love to see the auto determination in the product now or in the future what I need to know is how I can get the modules loaded without each web and ejb module containing ALL classes from the common source tree.

4 comments
Comment actions Permalink

You might want to try package prefix. Not sure if that is what you are
looking for. There is a thread on it in j.i.eap.

Norris Shelton
Sun Certified Java Programmer




Rick Shaw wrote:

>I want to maintain 1 source tree in source control, but I have a need for multiple modules. I have some EJB's, some common VO's and Exceptions and multiple Struts Web Apps that front end them.
>
>Is there a way to have one directory with the source tree and others that root the various modules with the necessary WEB-INF and META-INF directories?
>
>I have tried to make a java module with all source and various other ejb and web modules that depend on it to make the modules, but each module must include ALL of the classes from the master source module or NONE. There seems to be no granularity. I wnat to be able to pick and choose what goes in to the deployments.
>
>One of the best features of JBuilder is if you want to build an archive like a jar or war you tell it the root of the classes; that is, the required entry point classes and it figures out for you what other classes also need to be brought in based on the needs of those classes. You can customize exactly what goes into each module from all the various dependancies and libraries.
>
>Is there a way to do any of this?
>
>While I would love to see the auto determination in the product now or in the future what I need to know is how I can get the modules loaded without each web and ejb module containing ALL classes from the common source tree.

>

0
Comment actions Permalink

Thanks for your response. I looked at your reference and tried a few setting but what I found was that that feature prefixes the provided value to all your packages in order for you not to have to modify them by hand I guess. It does not selectively include them in the module.

What is needed in this panel is for you to use a common content root and exclude the various parts of the source root to leave just the parts you want in the module.

BUT! but the product prevents a module from using the same content root in 2 different modules even it the resulting source trees do not overlap?? Close but no cigar...

Is anyone using multiple EJB and Web modules?

Is the only way to make it work to have each module maintain its own source tree and cobble it together in source control tool??

0
Comment actions Permalink

Rick Shaw wrote:

Is anyone using multiple EJB and Web modules?


Yes - I am. A Websphere project, even. :-/

Is the only way to make it work to have each module maintain its own
source tree and cobble it together in source control tool??


I think so...
My setup is different, but I think I get more or less the same result
you're looking for. My source tree is organised like this in CVS: Names
changed to protect the innocent ;)

-]]>+-+-src +-lib +-WEB-INF +-- (etc...) +-- +-- +-- +--]]>
--<EJBModule1>--src
+-lib
+-META-INF
+--]]>
(etc...)

Now, in the IDEA projectfile I cobble together the set of modules that
this project specifically uses, including dependencies: WebModule1, the
Utility-, Business-, Domain-, and one of the EJBModules. The other ones
are not checked out in this project tree.

The UtilityModules contain common stuff (VO's, & generic utility
classes) that the other modules depend on. WebModule1 depends on
Business and Utility1, Business depends on Domain, EJB, and Utility2,
Domain depends on Utility2.

A different IDEA project files uses the same seutp, but WebModule2 and
EJBModule2 instead.

Basically, the 'unit of deployment' == ProjectModule
Took some time to setup, but this works quite well.

Hope this helps...

CU,
Edwin

0
Comment actions Permalink

Thanks for your reply, this was very helpful.

What I settled on was a combination of your suggestion and parts of another.

I use a tree similar to yours in the source control and mirrored in the project folder; but I have only one src folder at the project level, otherwize the same.

Then in the paths window I make the content folders be BOTH the module folder as in your example and the specific package in the one source folder, so that it lists the exact parent package as the source folder (in blue) like:

Source Folders:
.(com.mycompany.myproj.mymodule)



This allows access to the common source package for the module and the specfic module dependant Content Root.

One thing to note is that each module can only include the packages from the common source that have NOT been included in another module, so if you have packages that need to be shared then they need to be declared in a shared simple java module, and then used as a dependancy by the other modules. But the same method of navigating to the exact package in question as the content root works a treat.

This approach seems to provide the full power of the "Module" concept that is put forward by IDEA but still allows use of a common source tree for easy code maintance in a source control tool.

0

Please sign in to leave a comment.