667481 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 12 Messages: 12 Messages: 12 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

New Build Tool: J2EE + Ant = JAM

Posted by: Richard Easterling on May 20, 2004 DIGG
JAM is a modular Ant toolkit for developing and testing Java/J2EE applications. JAM supports EJB and Servlet/JSP development using XDoclet, JUnit, Cactus, Maven, Castor and MDA/UML code generation on various J2EE servers including JBoss.

JAM highlights include the following:
  • Uses Ant 1.6 import feature to modularize Ant tasks.
  • Uses Ant 1.6 target override feature to standardize target names (setup, gen, compile, dist, clean, deploy, test, repo).
  • Supports multi-module projects.
  • Targets EJB, Servlet/JSP, and standard Java development.
  • Promotes logical Ant property organization at the module, project and user levels.
  • J2EE application servers are interchangeable.
  • Uses Maven POM files to automate classpath and deployment drudgery.
  • Uses Maven repository to manage libraries, versioning and installation.
  • Supports transparent unit testing using JUnit.
  • Supports automated EJB testing using Apache Cactus.
  • Leverages XDoclet for EJB and WebApp deployment.
  • Supports Apache Struts development.
  • Supports MDA/UML code generation via dual source directories.
  • Supports Castor XML data binding.
  • Supports JBoss 3.x, Resin 2.x and other J2EE application servers.
  • Supports automated integration testing via the testcycle target.
JAM is the result of two years of development and refactoring work by the Outsource Café and is published under the GNU GPL open-source license. Developers who use JAM are impressed with its ease of use and depth. Welcome to the community of JAMers.

Links:
(NOTE: there is a name collision here with BEA's JAM tool that deals with annotations and javadoc. It is also interesting that BEA had another product called JAM (Java Adapter for Mainframe). We are running out of TLAs!)

Threaded replies

·  New Build Tool: J2EE + Ant = JAM by Richard Easterling on Thu May 20 18:42:39 EDT 2004
  ·  Name Collision by Mark Phippard on Fri May 21 09:48:36 EDT 2004
  ·  New Build Tool: J2EE + Ant = JAM by Richard Easterling on Fri May 21 11:30:56 EDT 2004
  ·  New Build Tool: J2EE + Ant = JAM by Race Condition on Fri May 21 14:37:25 EDT 2004
  ·  New Build Tool: J2EE + Ant = JAM by J Tigger on Fri May 21 16:30:05 EDT 2004
    ·  Maven vs JAM by Richard Easterling on Fri May 21 20:31:09 EDT 2004
      ·  Multisource Maven directories by Archimedes Trajano on Sun May 23 06:26:01 EDT 2004
        ·  Cactus support by Richard Easterling on Mon May 24 15:45:47 EDT 2004
  ·  JAM has taught me a thing or two about Ant by Andy Barnett on Mon May 24 15:25:00 EDT 2004
  ·  Incremental Release? by av nus on Mon May 24 16:33:22 EDT 2004
    ·  Incremental Release? by Richard Easterling on Mon May 24 18:20:31 EDT 2004
  ·  javagen on OS X by Loren Siebert on Tue Jul 13 18:11:02 EDT 2004
    ·  javagen on OS X - Patch by Richard Easterling on Sat Jul 24 15:28:02 EDT 2004
  Message #123051 Post reply Post reply Post reply Go to top Go to top Go to top

Name Collision

Posted by: Mark Phippard on May 21, 2004 in response to Message #122979
Seems like the more confusing name collision is with the already existing build tool called JAM.

http://www.perforce.com/jam/jam.html

  Message #123065 Post reply Post reply Post reply Go to top Go to top Go to top

New Build Tool: J2EE + Ant = JAM

Posted by: Richard Easterling on May 21, 2004 in response to Message #122979
Sorry for the confusion but you can always use the full name JavaGen Ant Modules when the issue arises. Interestingly all our other name candidates (J2EE Ant Modules, Java Ant Modules, and Java+Ant+Maven) lead to the same JAM temptation, but we are officially blaming our logo artist for making use acronym sinners ;-)

  Message #123087 Post reply Post reply Post reply Go to top Go to top Go to top

New Build Tool: J2EE + Ant = JAM

Posted by: Race Condition on May 21, 2004 in response to Message #122979
Cool, more acronyms!

  Message #123097 Post reply Post reply Post reply Go to top Go to top Go to top

New Build Tool: J2EE + Ant = JAM

Posted by: J Tigger on May 21, 2004 in response to Message #122979
I've got a question for JavaGen Ant Modules folks. What particular problem is being addressed by JAM that is not well-solved with Maven+Ant?

  Message #123114 Post reply Post reply Post reply Go to top Go to top Go to top

Maven vs JAM

Posted by: Richard Easterling on May 21, 2004 in response to Message #123097
We had originally hoped to use Maven, but we quickly realized that we’d have to rewrite many of the plugins, especially the XDoclet plugin to support requirements like dual source directories. Our Maven builds proved fragile, J2EE functionality was lacking and the documentation sparse. The other issue was lack of developer adoption and we felt that forcing already overwhelmed developers to learn yet another technology would cost us customers.

However, having experienced the elegance of the POM and repository ideas, we decided to use these features by writing a Maven-to-Ant bridge in the form of a Maven plugin. The bridge allows JAM to provide many of Maven’s high-level services such as classpath handling, distribution packaging and version management, but from a pure Ant environment. These features along with the new Ant 1.6 import and target override functionality inspired us to refractor our Ant libraries and the results are a very cool, flexible build framework.

We actually see JAM as step towards Maven, not as a competing framework. But until Maven matures, Ant is still the reliable industry workhorse… and we hope JAM makes it a little easier to use.

  Message #123171 Post reply Post reply Post reply Go to top Go to top Go to top

Multisource Maven directories

Posted by: Archimedes Trajano on May 23, 2004 in response to Message #123114
Hi,

I'm trying out maven and I didn't have to rewrite the plugins to support multiple source directories. Though I had trouble when getting the testing with cactus working when i first started.

Its not trivial to find though I agree, but once you find it (its just a few properties that need to be changed). The maven-genapp plugin provides samples that uses XDoclet + cactus.

  Message #123269 Post reply Post reply Post reply Go to top Go to top Go to top

JAM has taught me a thing or two about Ant

Posted by: Andy Barnett on May 24, 2004 in response to Message #122979
I am working with a monolithic Java web application with 200k+ lines of code in 500+ Java files. I use Ant to build it and I use Maven for all the generated site documentation.

It's been on my ToDo list for quite some time to modularize the build of the web application to help better define the dependencies in the code. For example, I want a core module, a utils module, a jsp module, a javacc module, a couple xmlbeans modules and separate custom modules to contain the code for each of our customer-specific code pieces.

The only thing that has stopped me separating the code into modules has been that I'd either have to manually re-code the Ant script to handle the modules, or I'd have to use Maven's multiproject support (and still have to convert some of my Ant script for use in Maven), and frankly, both approaches have scared me enough to not tackle the problem until now. When I investigated JAM, it looked like a quicker and safer solution to this issue than the other approaches.

With the help of JAM I was able to quickly and easily modularize the utils piece, and I also have JAM compiling my entire core module. I really like that I can maintain my modules' dependencies using Maven's POM and use the JavaGen plug-in to easily create a classpath.xml file for JAM's Ant modules.

On the downside, my web application is deployed to iPlanet and Tomcat, and at present JAM does not provide a JAM appserver modules for those. I must admit that I'm impressed enough with JAM at the moment that I'm considering writing my own Tomcat appserver module, but I don't know if I have the luxury to do that at this time. Also, there are no JAM modules ready-made to handle my JavaCC and XmlBeans needs.

Nevertheless, if nothing else, JAM has started to show me how to fully utilize the new capabilities of Ant 6.1 to create a modular and flexible build system for my multi-module application.

  Message #123270 Post reply Post reply Post reply Go to top Go to top Go to top

Cactus support

Posted by: Richard Easterling on May 24, 2004 in response to Message #123171
The maven-genapp plugin provides samples that uses XDoclet + cactus.
Thanks for the maven-genapp plugin pointer, I hadn’t noticed all the examples before.

As for as Maven Cactus goes, we had problems with the Ant tasks, not the Maven plugin. The Cactus Ant scripts are very powerful but we needed more flexibility. For example, we needed to be able to start the server or connect to an existing running server, or either run the full integration cycle (start-compile-deploy-test-undeploy-stop) or perform each step manually. Breaking out the Cactus functionality into Ant individual targets gave us this flexibility. Finally, JAM supports other test frameworks that don’t have all the cool Cactus server handling, so we had to do it in Ant anyway.

  Message #123274 Post reply Post reply Post reply Go to top Go to top Go to top

Incremental Release?

Posted by: av nus on May 24, 2004 in response to Message #122979
Can I do an incremental release using this JAM tool?

i.e Only updated files ( mostly JSP/property/Jar files ) needs to be created for distribution to different environments ( dev/test/production )

Thanks
Murthy

  Message #123280 Post reply Post reply Post reply Go to top Go to top Go to top

Incremental Release?

Posted by: Richard Easterling on May 24, 2004 in response to Message #123274
The short answer is not yet. However, JAM was built as a foundation for doing this sort of thing, so it’s in the works.

By the way, this is actually easy if you’re working with a networked file system, you just use the copy task and it only copies newer files. Updating files to a remote server is another matter, you have to use SCP (SSH copy) and I don’t know how you check individual file timestamps on the server. Anybody know?

JAM does supports incremental build and testing at the module level, you can look at the EJB module in the Petstore demo (http://www.javagen.com/petstoredemo.jsp) to see how its done.

  Message #129805 Post reply Post reply Post reply Go to top Go to top Go to top

javagen on OS X

Posted by: Loren Siebert on July 13, 2004 in response to Message #122979
Should the build.xml template work on OS X? I'm having problems getting the Javagen build.xml file to work under OS X 10.3.3, because of the Ant task <property>.

In the standard build.xml, Javagen makes use of an environment variable called JAM_HOME. From the User's Guide:
--->
Must be defined in each build file before the import statements so Ant can find the JAM modules. To avoid hard-coding, the JAM location define JAM_HOME as an environmental variable pointing to the directory you installed JAM in. Then include the following two lines above your import statements:
  <property environment="env"/>
  <property name="jam.home" location="${env.JAM_HOME}"/>
<---

Altough this works fine on WinXP, "env" doesn't seem to be doing the right thing for me on 10.3.3, so "jam.home" doesn't get set properly. Reading up on the <property> task for Ant, I see this note about the environment attribute for the property element:

--->
...the prefix to use when retrieving environment variables. Thus if you specify environment="myenv" you will be able to access OS-specific environment variables via property names "myenv.PATH" or "myenv.TERM"....This functionality is currently only implemented on select platforms. Feel free to send patches to increase the number of platforms this functionality is supported on ;).
<---

I can't tell what the "select platforms" are, so I'm wondering if Javagen has been used on Mac yet. It's been very useful to me on XP for the last month, so thanks!

  Message #131513 Post reply Post reply Post reply Go to top Go to top Go to top

javagen on OS X - Patch

Posted by: Richard Easterling on July 24, 2004 in response to Message #129805
There are only a few references to the 'env' property, which can be overridden to easily solve this problem. Just hard-code the following property declarations early on in your build file (changing the values to match your setup):

<property name="jam.home" location="/dev-tools/jam"/>
<property name="maven.home" location="/dev-tools/maven-1.0"/>
<property name="jboss.dist" location="/dev-tools/jboss-3.2.3"/>

Hope this helps...

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Auto-Scaling Your Existing Web Application

In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources. (May 19, Tech Talk)

Free Book PDF Download: Mastering EJB Third Edition

Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map