AppFuse and all it's libraries
I received a question about AppFuse that I've been pondering every since. The question basically boils down to two things:
- How do you manage Eclipse's .classpath file in conjunction with lib.properties (the file that manages it for Ant)?
- When using AppFuse for multiple projects, do you put a "lib" folder in each project or use a central repository?
Quick Answers: I replace files in the appfuse/lib directory and update lib.properties. Then I update my project properties in Eclipse to reference the new jars. A pain, yes - but only a 2 minute process. I run all my tests before I bother changing the Eclipse classpath. As for multiple projects - the easiest thing to do is to move $yourProject/lib to a folder called "libs" in the same directory as $yourProject and change the ${lib.dir} property in properties.xml to point to the new folder.
Begins Rambling... I'm currently using AppFuse on 3 different projects. 1 is AppFuse itself, the 2nd is Struts Resume, and the third is for a client I created a webapp for in August. Right now, when I synch up Struts Resume with AppFuse, I copy paste from appfuse/lib to struts-resume/lib and update the lib.properties appropriately. I can't just copy lib.properties to struts-resume/lib because struts-resume uses libraries that appfuse doesn't. Yes, this is admittedly a pain in the arse. It's almost as bad as changing all the method signatures when moving the Hibernate Session from all method signatures into the constructors (can your IDE do that?!). I don't want to make people download appfuse to build struts-resume though, so I doubt I'll change this process.
The whole "massive lib folder" has been bouncing around in my head for quite some time. I'd like to use Maven or Greebo to download the dependencies for AppFuse, but at the same time, it's nice being able to download the whole thing at once and be up and running. I don't want to go the Maven route because I don't really want/need a website for AppFuse and it sounds tough to get it working with XDoclet (though WebShop looks like it might be a good template). KISS
The project.xml in AppFuse is my feeble 20-minute attempt to get it Mavenized (it's currently not used). I tried Greebo this morning, and it really does nothing for me. Especially since I've setup separate compile/test classpaths (read from lib.properties). It'd be a real pain with Greebo to separate out the classpath's for testing and building - it seems to only support one long classpath. Also, who wants to make their whole best-practices open-source app dependent on a 0.1 open-source app?
As for having my IDE (wether it be Eclipse or IDEA) reading the classpath from Ant - that would be the sweetest feature of the year! Currently in Eclipse and IDEA, I have to give an absolute path to j2ee.jar since I don't want to distribute it (it's 11 MB). When I switch b/w OS X and WinXP, I always have to change this classpath. I'm sure there's an easier way with setting variables in the IDE, I just haven't figured it out yet.
The other thing that is annoying is that IDEA doesn't seem to read my $ANT_HOME environment variable. Does it have it's own $ANT_HOME? It's annoying for me b/c I check for JUnit classes in the classpath in my "init" task, and IDEA doesn't find them. Don't worry Eclipse bashers - it doesn't work in Eclipse either.
This is fine with me b/c I prefer the command line, but those "I use my IDE for everything" folks might not like it because they can't run AppFuse's build.xml file from w/in their IDE.
Posted by Steven Citron-Pousty on October 24, 2003 at 02:27 AM MDT #
Posted by Richard Mixon on October 24, 2003 at 04:12 AM MDT #
Posted by Matt Raible on October 24, 2003 at 04:33 AM MDT #
Posted by Erik Hatcher on October 24, 2003 at 02:09 PM MDT #
I am using ${env.ANT_HOME} - I believe the problem is because I'm checking for junit's TestCase class in my "init" - I always put junit.jar in $ANT_HOME/lib when running from the command line (I'm not explicitly defining $ANT_HOME/lib/*.jar in my classpath). Where do I need to put junit.jar so that IDEA will see it in it's classpath?
As for j2ee.jar, I modeled my process after yours - but Ant is not my problem here. The problem is that in Eclipse (and IDEA), I have to add j2ee.jar to my IDE's classpath. It can't read Ant's properties, so I have to point to the exact file - which is always different when I switch machines (and definitely different for other developers using AppFuse).
Posted by Matt Raible on October 24, 2003 at 02:51 PM MDT #
Posted by Graham on October 25, 2003 at 06:41 AM MDT #
Posted by Prashant Rane on October 27, 2003 at 01:51 AM MST #