20051229 Thursday December 29, 2005

Use Ant to auto-build your AppFuse project in Eclipse One of the issues that AppFuse has is it's not that IDE-friendly. When I first started creating AppFuse (December 2002), Eclipse had already been released. However, I only used it as a fancy text editor, and didn't structure AppFuse to be Eclipse-friendly. Most of the unfriendliness is caused by XDoclet, but there's a way to fix that. Rather than using the default "Java Builder" to auto-build your Eclipse project, you can use Ant. Below is a set of instructions that show how to configure Eclipse 3.1 to use Ant as the builder for an AppFuse project.

Step 1: Right-click on your project and go to Properties. Select the Builder menu on the left and click the "New" button.

Builders

Step 2: Select "Ant Build" in the Configuration Type dialog.

Builders

Step 3: In the Properties window, select the appropriate locations for Buildfile and Base Directory (in the Main tab). In the Targets tab, set everything to the default target. Finally, in the Classpath tag set Ant Home to where you have Ant installed.

Builders

Personally, I haven't used this setup to work on an AppFuse project yet, but it seems quite useful. Hat tip to Erik Weibust to showing me how to do this while at The Spring Experience. Posted in Java at Dec 29 2005, 12:26:20 PM MST 3 Comments

Comments:

Exactly what advantages does ant builder have over java builder? Thanks,

Posted by 219.88.139.74 on January 03, 2006 at 03:59 AM MST #

If you have a specialized way that your project needs to be built, the Ant builder can be useful. For instance, AppFuse relies on XDoclet, which generates code. The Java Builder is not XDoclet aware and therefore doesn't generate the code that some other classes import. If you use the Java Builder, you have to run "ant compile" first, refresh the project and then everything will compile with the Java builder. Kindof a pain - but the Java builder is much faster than the Ant builder.

Posted by Matt Raible on January 03, 2006 at 09:50 AM MST #

Howdy Matt, Thanks for the "props". The biggest plus in using the Ant Builder is that if you have spent any time working on and testing a build.xml file you can just use it as-is in your Eclipse project. There really isn't much tweaking as you've shown to get it working. Also, not there aren't many people left that haven't started using Eclipse, but if you have a good build file and know how to configure the Ant Builder you can get "working" much quicker. Erik

Posted by Erik Weibust on January 04, 2006 at 08:54 AM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a UI Architect specializing in open source web frameworks. Contact me for rates.
« July 2009
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today

Recent Entries

Tag Cloud