Maven

Middleware integration testing with JUnit, Maven and VMware, part 1 (of 3)

Vincent Partington

For Deployit, XebiaLabs' automated deployment product for Java EE applications, we are always building and modifying integrations with middleware systems such as IBM WebSphere, Oracle WebLogic and the JBoss application server. These integrations are small enough so that they can be rearranged to get many different deployment scenarios. A typical step, as we call these integrations, would be "Create WebSphere datasource" or "Restart WebLogic Server". So how do the test that code?

We've had some success using FitNesse and VMware to do integration tests on our deployment scenarios. But there were a few problems with this apporach:

  • We could only test complete deployment scenarios in this way. If we wanted to test just a single step, we had to make a deployment scenario that used that step just to be able to test it.
  • Because FitNesse does not provide any feedback while a test is running and the steps, let alone the deployment scenarios, can sometimes take a while to execute, there was little feedback on the progress.
  • While it is possible to debug a FitNesse Fixture using Eclipse the process is not very convenient when debugging a technical component such as this step.
  • To verify that a deployment scenario has executed succesfully we had to extend our FitNesse Fixture often. And while debugging code under test in FitNesse is complicated enough, debugging a Fixture is even harder!

Clearly we needed a different approach if we wanted to develop new steps easily.
 Read more

Maven appassembler Plugin: Dealing with Long Classpaths on Windows

ShriKant Vashishtha

When it comes to generating command-line scripts for Java applications, Maven "appassembler" plugin comes handy. Its "assemble" goal does all the maven magic, i.e. searching the dependencies used for creating the Java application, adding them into the classpath of resultant script and finally copying all relevant jars to a single place. It was all working very nicely until I stumbled across the problem of long classpaths in the Windows OS.

Irrespective of whether you use DOS prompt or cygwin, Windows limits the length of environment variables. Though there are various options to overcome this problem using Java 6 wildcard classpath, mapping the path to some drive etc, they all look like workarounds to me as problem can recur again anytime.
 Read more

Organizing Archetypes

Wilfred Springer

Maven archetypes are an excellent way of allowing people to create instances of a particular type of project without having them to know or worry about all of the peculiarities and details. (And the latest incarnations of the Maven Archtetype Plugin are actually way better than I realized: somewhere down the line, they introduced the ability to use Velocity templates for parameterizing the output. Nice!)
 Read more

Tweaking JAXB to generate better code

Maarten Winkels

JAXB can be a real time saver when working on a project that uses XSD to describe interfaces implemented in Java. Sometimes, however, the generated code is not up to standard. I ran into a problem that seems very common and found a very elegant solution to it on the web.
 Read more

JAX-WS, CXF and SAAJ on Oracle Weblogic 10.3

Ravan Naidoo

Recently I had to get JAX-WS based webservices running on Weblogic 10.3. However instead of using the default Weblogic 10.3 stack (Metro), the Apache CXF stack had to be used. Why? We required SOAP over JMS capabilities and that is possible with CXF without much effort.
 Read more

Configuring a Seam EJB project for development with Maven and JBoss Tools

Maarten Winkels

Say you want to build a web application and you want to use Seam for integrating standard technologies like JSF and EJB. Furthermore, you want to use the power of Maven to build your project for different environments, on different systems (like you continuous build system) and use its' rich reporting features to get an overview of the code quality of your project. And of course you want to use a good IDE, like Eclipse with JBoss tools to aid you in development. How does one go about setting up all these things?
 Read more

Maven Dashboard integration with bamboo server

Himanshu Gupta

With the help of maven dashboard plugin, the dashboard is integrated with the project and the reports can be generated on local machine. One step further would be to configure the reports on the bamboo build server itself so that the reports can be viewed by everyone.
For this to happen, following changes need to be done in the configuration of bamboo plan:

  • In Bamboo plan create the Maven goal "dashboard" using  'clean install site dashboard:dashboard' command and make the build JDK version to 1.5. The change in goal will make sure that at the specified time the build would run automatically and goal called “dashboard” would be executed. This will create the reports on the Bamboo server. Though the reports have been created, you can't see them yet.
  • To see the reports, we'll use the artifact feature of Bamboo plan. Create a label say 'dashboard' in Bamboo plan (artifacts section) and in copy-pattern section specify '**/dashboard/**'. With this pattern, build execution will preserve the files on server and will save them with the build number. One can go and see the results of the build and also the dashboard results now by clicking on artifacts link in "Build Results Summary" page. Now the build is integrated with dashboard and one can click on link came in email results (sent from Bamboo) to view the report. However you (should be logged in already) can always use "<Bamboo server base url>/download/<project name>/artifacts/latest/Dashboard/index.html" to view the reports.

Watch out when filtering resources with Maven

Boudewijn van Klingeren

At my current project we are using Maven 1.1 for creating build artifacts. Although a little bit outdated these days, it still works well. As Maven 2 this version also has the option of filtering resources (e.g. XML or properties files) to substitute certain keywords with values specified in properties files and/or the command line. We are using it for a number of reasons and it works perfectly… if properly used, off course.

 Read more

Readable url’s in Wicket - An introduction to wicketstuff-annotation

Jeroen van Wilgenburg

Have you ever tried to pronounce a url generated by Wicket? It’s quite a tedious job and often end users want to have understandable url’s (even when that url has no meaning).

It’s is quite easy to get normal url’s in Wicket. In this article I’ll show you several solutions, the first two with plain Wicket and the final solution is with wicketstuff-annotations.

 Read more

Beware of transitive dependencies... For they can be old and leaky

Jeroen van Erp

In many JEE apps today, you almost cannot forgo XML. Whether it is in configuration, data structures or service interfaces, you will certainly use a number of XML files. In a recent project we had to deal with a number of external services which used an XML interface. Little did we know that we introduced a potential time-bomb in our application... Read more