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.

My tips o' the day

I found an easy way to update a MySQL database with new columns this morning. The traditional way is to create an ALTER_TABLE script and run it. However, I had added more than 30 columns, and creating this script sounded like a pain in the ass. Keep in mind that I use Hibernate to create my database from scratch - tables, and all. If you're familiar with appfuse, you might be able to use this stuff.

  • Dump the existing (production) database using "mysqldump -c database > database.sql". Edit this file, replacing CREATE TABLE with CREATE TABLE IF NOT EXISTS. The "-c" option includes column names in the insert statement.
  • Create an empty database (appfuse: ant db-init) and export (mysqldump database > create-tables.sql) it.
  • Drop all the tables in the production database (backup first!), mysql < create-tables.sql followed by mysql < database.sql.

Of course, other suggestions are welcome - I'd love to see a mysql diff tool that generates the ALTER script for me!

My other tip is how to start/stop Windows services from the command line - don't know why I haven't used this sooner.

net start "$serviceName"

Where $serviceName is something like "Apache Tomcat 4.1" - use "net start" to see all currently started services.

Posted in General at Sep 09 2003, 02:07:31 PM MDT 2 Comments

Maven vs. Ant

I presented my views on why we should use Maven over Ant today in a meeting. My basic reasons are simple: 1) the ability to download jars (and have a central repository for all projects) and 2) to have a standard directory structure and build/test/deploy mechanism. It's going over like a fart in a crowded room so far. The major pushback is because supposedly you can convert JBuilder's .jqx files to Ant build files. Has anyone does this? How does it work? They mentioned that if there is a converter for .jqx -> maven build files, then they'd be happy to try it.

If we do use Ant (high probability), now begins the arduous task of standardizing across projects, as well as creating a "lib" module in CVS to store all the jars for the different projects. Good thing I'm on vacation next week! ;-)

Posted in Java at Aug 22 2003, 04:13:54 PM MDT 9 Comments

PHP vs. Java - which is better?

I have a former client that has a customer. This customer asked them - "so when are you migrating from Java to PHP?" So evidently this person has the impression that the next wave of web applications will be written in PHP. My former client has asked me to provide an answer for their customer. If I translate it, I think they mean to ask "what is different between Java and PHP and why should we use Java over PHP." Here are my opinions - please add yours as you see fit. I must admit I don't know a whole lot about PHP, except that it's widely popular among the Linux/Apache/MySQL crowd and that it's similar to ASP in it's lack of a MVC architecture (yes, I know about the PHP MVC project).

  • I think Java is more of an industry standard, whereas PHP seems to be popular among hackers and hobbyists.
  • Java provides better separation of layers - key for testability. PHP has all the code embedded in the page, so you have to run it through a browser to test if database connections work (for instance).
  • Java is more scalable.
  • More folks know Java and it's easier to qualify someone's Java skills. How do you test someone knows PHP? Is there a certification?
  • More for-profit organizations use it.

If you're a Java or a PHP-lover, I'd love to hear your opionions (facts are always better). I'm going to point my client to this post, so keep it clean.

Posted in Java at Aug 22 2003, 03:52:33 PM MDT 98 Comments

Maven Questions: Webapp best practices and local repositories

I can't seem to subscribe to the Maven User Mailing List for the life of me, so I'll ask my questions here, and hopefully get some answers. The first question is regarding local repositories. Ideally, I'd like to put this on a network drive, so all developers can get to it by mapping a drive or something. When I try to use a network drive, I get the following error (WinXP, Maven CVS pull from yesterday):

Artifact '\\server\share\repository\velocity\jars\velocity-1.4-dev.jar' 
    not found to add to classpath 
java.lang.ClassNotFoundException: velocity 
        at java.net.URLClassLoader$1.run(URLClassLoader.java:199) 

The reason I'd like to use a network share (over an FTP server or HTTP server) is because then we can easily add the .jar files to the classpath in Eclipse or JBuilder. If Maven downloads the files to each user's local hard driver - then we can use an FTP server. Another option is to use the default (~/.maven/repository), but then each developer has to copy javamail and our custom jars onto their hard drive.

My second question is regarding webapp best practices with Maven. The Maven Tomcat Plugin seems nice, but it mangles my server.xml file. I'd like a solution similar to the way I've done it with Ant. I use a context.xml file and place this in $CATALINA_HOME/webapps and then I "deploy" the expanded war into Tomcat. Tomcat detects when any files change under WEB-INF/ and reloads the app. Works great. A better solution would be to point the docBase to target/webappName. So I guess what I'm saying is - should I just create a context.xml file and make my own custom "setup-tomcat" task (which does an ant:copy)? Then use war:webapp to refresh the app's files from source? How are you experts doing it?

Posted in Java at Aug 22 2003, 11:51:35 AM MDT 3 Comments

Maven and Automation of Build/Test/Deploy process

I've convinced the folks at my new project to use Maven for organizing, building and testing our projects. It's my recommendation because they have many (5+) webapps that all have the same dependencies. Maven was the obvious choice to eliminate duplication and standardize directory structures, etc. So my question is - how do I automate our build/test/deploy process? I currently use Anthill with Ant, and wish I could use it with Maven. Last time I checked, I couldn't. I've heard I could use CruiseControl. If that's true (and recommended over Anthill) - anyone got a HowTo?

Posted in Java at Aug 21 2003, 02:33:18 PM MDT 5 Comments

The First Day at the New Gig

I can already tell this is going to be a wicked place to work. It has the feel of a .com company - shorts are allowed, people are smart, technology is bleeding edge. They're using JBuilder 9 and Visual Source Safe, so there's some new tools to learn. My machine isn't nearly as fast as I'd hoped (1.6 GHz, 768 MB), but it'll certainly do. I did get dual monitors, which I have a hard time living without - so I can't complain at all. There were four of us that are starting this week or next - 2 graphics designers and 2 Java developers. We are tasked with building 42 custom websites in the next 6 months. Sweet - I love a good challenge!

Posted in General at Aug 18 2003, 10:06:03 PM MDT 4 Comments

Loving Java all over again

This past week has been hectic. I'be been pumping out what seemed to be a relatively small and simple application for a client. What was a simple 3-table 3-page application is now 14 tables and even more pages. But it's going awesome. It's the most productive I've ever been on a project - thanks to AppFuse, which is further backed up by the powerful Ant, XDoclet, JUnit, Struts and Hibernate.

The reason I've fell in love with Java all over again is I've re-discovered the power of reflection and inheritance. 8 of the 14 tables are child tables of a main "project table." As I noticed I was doing a lot of copy/paste in my DAOs, Services and Actions - I decided to reflection for all these child tables and now I have 3 methods on my DAOs (get/save/deleteProjectChild). Same goes for my Services and my Actions all share the same delete/edit/save methods in a BaseAction.

The only reason I even have child Actions is for URL beauty and to xdoclet-generate the action-mappings. Backed up by tons of JUnit, StrutsTestCase and WebTest test cases - it's been a breeze to refactor and enhance. I'm in love all over again.

Posted in Java at Aug 16 2003, 11:23:04 AM MDT 1 Comment

What a 3 GHz Processor will do for you

I finally got around to installing Java, Ant and Tomcat today, so here's some compilation numbers for you (from the new laptop):

  • Running "ant clean package-web" on AppFuse: 12 seconds (vs. 2GHz/512MB Desktop: 18 seconds)
  • Running "ant rebuild" on Roller: 24 seconds (vs. 2GHz/512MB Desktop: 36 seconds)

Now those are numbers I like to see! Does that mean that you get a 33% performance increase for every GHz of CPU you add to your machine? The annoying thing I'm experiencing today is that the fan comes on about a minute after it shuts off, and then it stays on. Not a big deal if I've got headphones on, but in cube land (where you can hear each other typing) it's kinda loud. I'm also growing to loath the mouse (same as PowerBook, but two buttons - yeah!) - just b/c it's a laptop mouse (solution: KVM)

In other news, tomorrow is my last day at Comcast. It's been great working here - awesome folks to work with, cool company, very cool project. I'm leaving a week early b/c I got a small contract to write a webapp for a company in Florida. It should only take me a week or so, and I'll be doing it out of Raible Designs' HQ, so it'll be nice to see the fam a bit more. After that - who knows? I have a few irons in the fire (as Russ would say), but nothing is final yet.

Posted in General at Aug 07 2003, 02:41:06 PM MDT 6 Comments

RE: A couple of quick Eclipse tips

From James Strachan:

* there are various XML editing plugins available (X-men, xmlbuddy). Though for simple stuff, just enable the Ant plugin for all XML documents. The Ant plugin has a simple colour coded XML editor.

To enable it, open the Preferences window (Window -> Preferences) then go to Workbench -> File Associations. Then for *.xml add the Ant plugin association.

Nice! I've been wondering about that. Very cool - thanks James.

Posted in Java at Jul 31 2003, 08:53:40 AM MDT 2 Comments

Monday Morning Mayhem

My Inbox was attacked over the weekend with all kinds of good links and fun stuff to post. So here it is:

  • LogWeb was released. A fully functional web interface for the runtime configuration of log4j within servlet containers and j2ee application servers. I won't use it, as I've never been inclined to change my logging configuration at run-time. And if I do need to change it, reloading my app isn't a big deal with Tomcat. Although, it might be nice to view your apps' configuration with this tool.
  • Mozilla and XUL for Cross-Platform User Interfaces, a Tutorial. Quick, easy and works with Mozilla Firebird. I did the examples.
  • StrutsDoc 0.3 was released. StrutsDoc is an Ant task that generates JavaDoc-like documentation from a Struts configuration file. StrutsDoc currently only supports the 1.1 version of Struts. [StrutsDoc Example] This might be helpful for documentation (a.k.a. impressing management) and bringing new developers up to speed.
  • Rowell has approved the use of his theme in Roller. I'll make sure and add a "designed by Rowell Sotto" to the bottom of the theme. Theme names are welcome. Currently, it's named "sotto."
  • Tomcat 5.0.5 Alpha was released. I'll comment here later today.

The best part of the day (so far)? My bike ride to work went from 1 1/2 hours (one-way) to 45 minutes - I just gained an hour and a half in every weekday!

Posted in Java at Jul 28 2003, 08:46:33 AM MDT 1 Comment