File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply 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: 23621

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]
Certs: SCEA Part 1, Part 2 & 3 & Core Spring 3, OCAJP
roger wong
Greenhorn

Joined: Oct 21, 2009
Posts: 29
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: 12512

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.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 23621

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
Greenhorn

Joined: Oct 21, 2009
Posts: 29
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!
 
 
subject: Best practices for setting up modules with interdependencies in CVS
 
Threads others viewed
Version Control Using JSP
bringing modularity in the java project
Enable/Disable Modules Strategy
Retrive code from CVS
Need your suggestions to develop workflow based (web)application.
developer file tools