Using wsimport on Ant vs. Maven: Don’t bring a knife to a gunfight

I love Maven, I like the way that it tries to define an infrastructure for building modularized applications. I love how it assumes testing is a standard part of the build process. My projects went from needing arial maps to finding config files to a nice standard layout that any many developers can understand. As a bonus, Maven also does semi-automatic dependency management for you. It’s a gift and a curse. The Ant build environment is very good for the “Constant Gardener” type of programmer that love to customize their build process to death. There an ant task for pretty much everything you want to compile, package and deploy in Ant. Maven, a newcomer, is still catching up. When I got my wsdl from Salesforce the other day, all the JAX-WS examples came with ant scripts. Somewhat broken ant scripts, but hackable enough to get working. I kinda wanted to still conform to the maven directory structure of my other projects, so I began fishing for wsimport in the maven2 world. Lo and behold, there was one. The Street was happy, I could keep it real and still “stay maven”. First time I ran the example from here, it simply failed.

Note to CodeHaus:
I often find xml errors in your pom.xml examples.
It’s  <build> </build>  not <build><build>

The build failed because it could not find the jaxws-maven-plugin. This kind of error still surprises me. I can understand if a mainline < dependency/> fails but a plugin? I was kind of assuming that plugins were kept to a higher standard, at least in terms of availability. Who’s running this circus? Now that Web Services in Java is actually getting easy enough for the average blue collar programmer to work with, it’s sad that one still has to fish around for a JAX-WS based maven plugin. Did I already mention that the Ant plugin imported and generated my client classes? In other words, s*** just worked. Hours later, after pouring over mail lists, checking mvnrepository.com, going to java.net where the plugin was last seen, I finally had the plugin. It still didn’t work. Didn’t work on my wsdl or the Amazon WS example on their own site. So I’m ending up doing what I should have done in the first place, stop trying to use a screwdriver on a job where a hammer is a better option.
Refreshing my memory on the jar task as we speak.
Peace
GJ

Leave a Reply