Matt RaibleMatt Raible is a writer with a passion for software. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.
You searched this site for "ant". 338 entries found.

You can also try this same search on Google.

AppFuse 2.0: JDK 5, Annotations and JSP 2.0

For the most part, I haven't used JDK 5 on any of my recent projects. You can compile and run AppFuse with JDK 5, but it doesn't use any JDK 5 features. After doing a code review at Bouvet last week and seeing how much cleaner their code is with Generics, Varargs and the Enhanced for Loop, I think it's time to dig in. I don't know how soon we'll start, but I think it's time to start creating a branch for AppFuse 2.0 - which will use these features. For AppFuse 2.0, I'd like to go whole hog, bleeding-edge and use all the stuff that's out there to make developer's lives easier. This includes JSP 2.0, Annotations (especially for Hibernate and Spring, as well as Tapestry) and all the JDK 5 features that seem useful.

Since most developers won't be able to deploy on a JDK 5-compliant server for quite some time, we'll continue to maintain the 1.x branch as JDK 1.4-compliant. I expect to release AppFuse 1.8.1 later this week (with mostly bug fixes + latest releases of Hibernate/Spring) and 1.9 in the next month or so. From there, we'll likely do 1.9.x releases with bug fixes and do all the major upgrades (i.e. Tapestry 4.0.x) in the new branch. Working with new features in JDK 5 should be a lot of fun.

I'm hopeful that we can get rid of XDoclet and we may even give Maven 2 a run for its money. Last week in Norway, I found that most Java developers were using Maven on their projects and I also discovered that many of the core Maven 2 developers are getting paid to work on it full time. There were even claims that Maven 2 is going to be twice as fast as Ant - which definitely intrigues me.

Later: I just realized the hardest part of this migration is going to be replacing AppGen. It currenly uses XDoclet templates for all the class templates - and we'll need a new solution based on annotations. Oh well, it's kind of ugly anyway, but it'll likely be difficult to figure out a new solution. Hopefully we can create some sort of tool that involves easy-to-customize templates and a GUI to drive it all.

Posted in Java at May 30 2005, 12:41:52 PM MDT 27 Comments

AppFuse Videos

I know I said I'd never do an AppFuse video, but after having many requests - I decided to go ahead and make a couple. The first one is a demo of creating a new project and then installing and browsing that project in your browser - to see all the out-of-the-box features.

The 2nd one basically all the stuff that's done in the tutorials - using Spring MVC for the web framework. I create a Person.java object and then use AppGen to generate all the code for it. In this one, I make a number of mistakes (but solve them all). I thought about going fully happy-path, but then decided it was important to show some gotchas that might occur.

I used the trial version of Camtasia Studio to create these videos. Thanks to Keith at KGB Internet for hosting the demo site for AppFuse. If you need Tomcat hosting, Keith offers an excellent service at a very good price.

Update: You can also download these videos for off-line use.

Update 2: I updated these videos for AppFuse 1.9.3.

Posted in Java at May 04 2005, 09:48:40 AM MDT 32 Comments

AppFuse Demos moved to demo.appfuse.org

I bought the appfuse.org domain name sometime last year. I haven't done anything with it for the most part and I've just pointed it to this site. It's amazing how many people actually use it - it's my 4th largest referrer! The demo site I have at Kattare (demo.raibledesigns.com) has a whole slew of demos installed on it, so I contacted Keith (at kgbinternet.com) to set me up a new domain for AppFuse-only demos. These can now be found at http://demo.appfuse.org or by clicking on of the URLs below. The site is currently running AppFuse 1.8 with JDK 5 and Tomcat 5.5.7.

The "Issues" link on this site won't work yet - I'm in the process of setting up JIRA at http://issues.appfuse.org. Hopefully we'll have it done sometime this week. Contegix has been gracious enough to offer free hosting of AppFuse's JIRA instance.

Update: AppFuse's JIRA is now up. Thanks again to Atlassian for a great product and to Contegix for hosting it. The quick installation and support from Contegix has been outstanding.

Posted in Java at May 03 2005, 09:54:30 AM MDT 10 Comments

[ANN] AppFuse 1.8 Released!

This release of AppFuse replaces Container Managed Authentication (CMA) with Acegi Security. Other major features include numerous bug fixes to AppGen and a refactoring of build.xml to use Ant 1.6 features. Eclipse and IDEA project files were also improved so you can easily run tests from within your IDE. A MyJavaPack all-in-one installer was also added so you can download everything you need for AppFuse at once. Eclipse and its plugins were not included in the initial release, but may be in a future release.

If you find any issues, let us know.

Update: You can now see Demos and Videos.

Posted in Java at Apr 29 2005, 08:51:08 AM MDT 11 Comments

[AppFuse] New Committers and 1.8 Status

This morning, Nathan and I invited Ben Gill and Sanjiv Jivan to join us as Developers on AppFuse. Both of these guys have been answering a lot of questions on the mailing list, submitting patches, and documenting things on the wiki. In my opinion, developers that write documentation and help other users are the most valuable. Ben and Sanjiv have agreed to join the project - welcome aboard guys!

In AppFuse 1.8 news, I'm almost there, but not quite. I did a whole slew of refactoring to the Ant build process so that macrodefs replaced many targets, and imports are now used where appropriate. I saw a drastic improvement in execution time after doing the macrodef conversion. The reason I didn't release last week is because I got caught up in refactoring some things to make it possible to run JUnit tests in both Eclipse and IDEA. The good news is I got it all working - the bad news is it screwed up a number of the extras/* install tests. If I can't fix everything in a couple more hours of work, I'll likely back out my changes and simply document the process. I anticipate I have (realistically) 8 hours of work left before a final release. I'm still hopeful I can have it done this week.

Posted in Java at Apr 26 2005, 04:31:33 PM MDT Add a Comment

The back-to-work blahs

Last week I had a really good time at the MySQL Conference. I hung out with some extremely smart folks and learned a lot about various things, such as the Dvorak Keyboard Layout, why James Duncan Davidson hates Ant and why we have Session and Entity Beans (two companies couldn't agree). I spent way too much time working on AppFuse and trying to get the 1.8 release out (it's close, hopefully this week). I also did a 1/2 day seminar on Spring, AppFuse and Comparing Web Frameworks for a company in San Francisco - which was fun.

All of this techno-fun was quickly forgotten when Julie flew in on Friday and we headed down to Cambria, CA for a fun weekend of wine-tasting. Now I'm back at work with many-a-deadline and 81 starred messages in my GMail account. Last week, I realized that doing the open-source and Spring Live stuff is easily a full-time job. The best solution I can think of at the moment is to View Starred Messages » Select All » Delete, followed by ignoring all the e-mails I receive for the rest of the week. I'll try not to do this, but it sure is tempting. ;-)

Someone asked me last week how I manage my time effectively and get everything done. The truth is I don't. I simply stay up late, sleep little, or steal weekends away from my family. Tonight, I expect to spend 4+ hours answering e-mail and doing edits for Spring Live. Hopefully I can catch up and get AppFuse 1.8 released before my parents show up on Thursday night.

Posted in General at Apr 25 2005, 02:19:00 PM MDT 4 Comments

Using Ivy in AppFuse

I'll admit, the thought of not checking in JARs to AppFuse's CVS is intriguing. With Ivy, I think I could pull off the current setup, plus a dynamic-downloading system. By current setup, I mean that the JARs are distributed in your "lib" directory and you can build your app w/o downloading any dependencies. I like this because I can develop AppFuse and not worry about my internet connection.

Dion doesn't get my love for checking in JARs. The main reason I do it is because it takes me a less time to download a new release and check it into CVS than it takes me to find that same release in Maven's Repo. Case in point: Hibernate 3.

I love the idea of Ivy, and mockhaug makes it sounds great, but I don't want to have to create a bunch of metadata whenever I want to use something like Hibernate 3. Then again, if Ivy is ever going to catch on, someone has to do it.

In conclusion, I'm still not convinced I should integrate Ivy into AppFuse - sounds like maintaining and uploading dependencies would be a lot more work than just checking in JARs. If there was a person responsible for creating Ivy metadata every time a new release came out, I might think different.

Posted in Java at Apr 13 2005, 02:19:21 PM MDT 6 Comments

Maven 2 Alpha - looking good!

I saw that the Maven 2 Alpha was released today and decided to give it a spin. The two features in Maven 2.0 that look compelling to me are 1) speed and 2) transitive dependencies. I've been using Maven 1.x on my current project since January and I still don't like it. Why? It's dog slow on my PowerBook (but tolerable on my Windows box) and you have to specify a shitload of dependencies when developing an app with Struts+Spring+Hibernate.

Maven 2 looks good, and it does seem to startup as fast as Ant (at least on Windows). Just typing "m2" completes in about a second, and so does typing "ant". Typing "maven" takes about 3 seconds (even though it reports it only took 1 second). I look forward to seeing Maven 2 evolve. I wonder if we should rewrite our POMs for Maven 2 (we current have 11 sub-projects)? We'd probably be a pretty good test-bed, but I don't think Maven 2 supports all the 1.x plugins - does it?

I doubt I'll use Maven 2 with Equinox or AppFuse this year - mostly b/c I don't expect it to be released until 2006. I do like the looks of Ivy and I've considered re-writing AppFuse's monstrous build.xml file using JAM. If I were to use Ivy, I think I'd still release with all JARs in a local "lib" directory. The nice thing about Ivy is it would give users the option of checking JARs into source control (currently, it's required).

Even after using Maven for several months, I still like local JARs better than downloading. It does make a lot of sense in a multi-project environment though.

As for JAM, I don't like it for two reasons: 1) it uses the non-transitive dependency listing like Maven 1.x and 2) it requires you install JAM and set a $JAM_HOME. I'd prefer to keep AppFuse to one build tool - Ant or Maven (or both).

I suggested a large refactoring of the build process (and collapsing of the source trees) for AppFuse 1.9, but it was rejected by users for the most part. Their opinion: the build process works great, we like it - work on other stuff that's more important (code generation, tools support, etc.). Another thing that's suprised me about AppFuse users is the relatively small number of folks that have requested support for appservers other than Tomcat. To date, I don't think I've had a single Resin or Orion request, but I've had plenty of WebLogic, WebSphere and Sun App Server requests. The most compelling reason to use JAM for building/deploying/testing AppFuse is for its server support, but if I don't need it, why add the complexity?

I guess some things just work, and there's no reason to fix them if they aren't broken. Maven 1.x is not one of those things IMO. It's good to see the improvements coming in Maven 2.

Posted in Java at Apr 08 2005, 01:52:10 PM MDT 4 Comments

Upgrading to Spring 1.2 RC1 and Hibernate 3.0

I spent an hour or so on Friday upgrading Equinox and AppFuse to use Spring 1.2 RC1 and Hibernate 3.0. The upgrade for AppFuse was relatively painless, but the upgrade for Equinox failed. Equinox uses HSQLDB version 1.7.1. The main reason I use the 1.7.1 version is to avoid the infamous "lock exception" that the new HSQL version throws in standalone mode. With version 1.7.1, it seems you could have more than one connection open to the file-based database w/ no problem. I really like this feature in 1.7.1 b/c it means you can run the app in Tomcat and browse the database at the same time.

So what's the problem? Why can't I just use Hibernate 3.0 with HSQL 1.7.1? The problem is I like using the following setting as part of my "sessionFactory" bean:

<prop key="hibernate.hbm2ddl.auto">update</prop>

This setting will update the schema when you change mapping files, but otherwise leave the data intact. Furthermore, it'll actually create the tables if they don't exist. Not so with Hibernate 3. With Hibernate 3, using "update" doesn't create the tables. Of course, upgrading to a newer version of HSQL fixes the problem, but then I get the lock problem. My eventual solution will probably be to hack Hibernate or HSQL, but for now I just won't upgrade Equinox. Another solution might be to look at some other embedded databases. Of course, I could also require users to install a database to run Equinox - but I like having the "no setup required" feature.

Regardless of the problems I experienced with HSQL and Hibernate 3, upgrading AppFuse was pretty painless. Here's the set of instructions I sent to the mailing list:

  1. Download Hibernate 3.0 and Spring 1.2 RC1.
  2. Create a lib/spring-1.2-rc1 and put the following files in it (NOTE: spring.jar now contains aopalliance.jar):
        acegi-security-0.8.1.jar
        commons-codec.jar
        ehcache-1.1.jar
        license.txt
        spring-mock.jar
        spring.jar
  3. Create a lib/hibernate-3.0 and put the following files in it:
        hibernate3.jar
        lgpl.jar
        lib/antlr-2.7.5H3.jar
            antlr.license.txt
            asm.jar
            c3p0-0.8.5.jar
            c3p0.license.txt
            cglib-2.1.jar
            dom4j-1.5.2.jar
            jta.jar
            jta.licence.txt
            oscache-2.1.jar
            swarmcache-1.0rc2.jar
  4. Change the versions for Hibernate and Spring in lib/lib.properties. Also, change the hibernate.jar property to reference hibernate3.jar instead of hibernate2.jar.
  5. In build.xml, change the "package-web" target to include all the Hibernate JARs instead of just specific ones:
    <lib dir="${hibernate.dir}/lib" includes="*.jar" excludes="jta.jar"/>
  6. Change web/common/taglibs.jsp to use uri="/oscache" for the oscache taglib.
  7. Search for "net.sf.hibernate" and replace it with "org.hibernate".
  8. Search for "orm.hibernate" and replace it with "orm.hibernate3" (for Spring).

The major difference for Hibernate is you no longer need odmg-3.0.jar, but you do need asm.jar and antlr-2.7.5H3.jar. Let me know if you find any issues with these instructions. You could also just download AppFuse from CVS.

NOTE: The CVS version of AppFuse has an XDoclet version that only supports generating Hibernate 2.x mapping files. I believe there is support for Hibernate 3 in XDoclet's CVS - but I haven't had a chance to upgrade yet.

Update: Here's more on the HSQL bug that's not really a bug (according to a comment on the post). Regardless of whether it's a bug or not, it'd be nice to have the 1.7.1 behavior as an option - it's a great feature for get-started-quick apps like Equinox.

Posted in Java at Apr 03 2005, 06:52:52 PM MDT 9 Comments

Trim Spaces in your JSP's HTML

One of the annoying things about JSPs is all of the dynamic (non-rendered) parts of the page still produce line breaks. This means that if you do a view-source, you'll likely see large blocks of whitespace.

The good news is you can get rid of this whitespace if you're using Tomcat 5.5.x. Just locate the "jsp" servlet in $CATALINA_HOME/conf/web.xml and add the following <init-param>:

    <init-param>
        <param-name>trimSpaces</param-name>
        <param-value>true</param-value>
    </init-param>

I tested it and it works great. This begs the question - why isn't this on by default? Source: Struts Mailing List.

Update: JSP 2.1 adds the ability to trim whitespaces.

Posted in Java at Mar 23 2005, 10:24:58 PM MST 39 Comments