permaculture playing cards*
The moose likes Ant, Maven and Other Build Tools and the fly likes Best practices for setting up modules with interdependencies in CVS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Best practices for setting up modules with interdependencies in CVS" Watch "Best practices for setting up modules with interdependencies in CVS" New topic
Author

Best practices for setting up modules with interdependencies in CVS

Ram Charan
Greenhorn

Joined: Apr 07, 2004
Posts: 12
We have an application with a huge codebase with 7-10 modules in it. Some of these modules are J2EE apps, others are J2SE process and others are common & framework modules. As of today, all the code is in a single CVS module with make files to build and package (Solaris packaging). We are looking for ways to modularize this code base and split it into individual modules with dependencies reflecting the architectural relationships. For EX: Module 1 requires Module 3 and 4 etc. Can you guys provide some tips on how to do this? Are there any best practices?

Thanks,
Asia


thanks
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30146
    
150

Ram,
I recommend making each J2EE module (jar, ejb jar, framework module, etc) into a separate CVS project. This allows you to version each separately. You can manage dependencies through IDE files if you are all using the same IDE. For example, Eclipse provides the .classpath file. Either way, you will want to update your build script (ant, maven, make) to build the app from modules into an ear.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
roger wong
Ranch Hand

Joined: Oct 21, 2009
Posts: 31
Jeanne Boyarsky wrote:Ram,
I recommend making each J2EE module (jar, ejb jar, framework module, etc) into a separate CVS project. This allows you to version each separately. You can manage dependencies through IDE files if you are all using the same IDE. For example, Eclipse provides the .classpath file. Either way, you will want to update your build script (ant, maven, make) to build the app from modules into an ear.


HI,

Does cvs support that modules have their versions?

Or is their a workround to do so use modules rather than cvs projects?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

The unquestioned king of managing dependencies is Maven. Dependency management is one of the things it was explicitly designed to handle, and it not only handles dependencies between your own resources, but public resources as well - for example the Jakarta projects. Ivy is a facility that allows Ant to work with dependencies, but it's not a core part of Ant, the way it is in Maven.

Using IDEs for dependency management is something I do NOT recommend. I've been burned VERY badly at multiple times and in multiple shops by setups where critical build activities could only be done via IDE - or worse, a specific version of an IDE and/or configured EXACTLY as programmer "Joe" had his IDE configured.

My policy on IDEs is that they're great places to work, but when it comes time to do a production build, I want it buildable from the command line, far from any IDEs or even GUIs.

Maven, by the way, tends to encourage breaking down projects and sub-projects by module. With relatively little effort, you can pull a component, do a maven build-and-install operation and publish the updated component to your shop's Maven repository.


Customer surveys are for companies who didn't pay proper attention to begin with.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30146
    
150

roger wong wrote:
Jeanne Boyarsky wrote:Ram,
I recommend making each J2EE module (jar, ejb jar, framework module, etc) into a separate CVS project. This allows you to version each separately. You can manage dependencies through IDE files if you are all using the same IDE. For example, Eclipse provides the .classpath file. Either way, you will want to update your build script (ant, maven, make) to build the app from modules into an ear.


HI,

Does cvs support that modules have their versions?

Or is their a workround to do so use modules rather than cvs projects?

You tag the CVS projects. An application requires certain tagged versions. CVS doesn't have this concept of submodules within a project. Instead, you have projects within a repository. Which is what you have in Eclipse as well. Projects in a workspace.
roger wong
Ranch Hand

Joined: Oct 21, 2009
Posts: 31
Jeanne Boyarsky wrote:
roger wong wrote:
Jeanne Boyarsky wrote:Ram,
I recommend making each J2EE module (jar, ejb jar, framework module, etc) into a separate CVS project. This allows you to version each separately. You can manage dependencies through IDE files if you are all using the same IDE. For example, Eclipse provides the .classpath file. Either way, you will want to update your build script (ant, maven, make) to build the app from modules into an ear.


HI,

Does cvs support that modules have their versions?

Or is their a workround to do so use modules rather than cvs projects?

You tag the CVS projects. An application requires certain tagged versions. CVS doesn't have this concept of submodules within a project. Instead, you have projects within a repository. Which is what you have in Eclipse as well. Projects in a workspace.


Clear. Many Thanks!
 
Consider Paul's rocket mass heater.
 
subject: Best practices for setting up modules with interdependencies in CVS
 
Similar Threads
Need your suggestions to develop workflow based (web)application.
Version Control Using JSP
Retrive code from CVS
Enable/Disable Modules Strategy
bringing modularity in the java project