by
Harold Fortuin, Ph.D., Principal Software Engineer
Fortuitous Consulting Services, Inc.
Download this tool and its example JavaEE WAR from this site
For some time now, any moderately complex JavaEE project is put together for build and deployment using Java-based tools such as Ant and Maven. And typically these projects include a number of configuration files, not just those needed by the build tool.
These are demanded by commonly used frameworks such as Hibernate for data access, the various Spring libraries,
JavaEE servlets and Java Server Pages (JSPs).
And each of these frameworks in turn has its own configuration files which include fully qualified names of Java classes specific to your project.
Typical JavaEE build processes include the following steps:
Of course, the step of launching the application server can take plenty of time - easily involving many minutes. Therefore, developers, testers, and
DevOps personnel need to catch errors in the build and/or deployment as early as possible -
to avoid multiple relaunches.
Unfortunately, I have noted a missing step in the build processes at various clients over the years - one that has led to such
multiple application server reboots. The issue?...
NO test or process is executed to ensure that Java class files referenced in configuration files are ACTUALLY PRESENT, either in the build directories
or containing build archives! Anyone who has ever made a spelling error or misnamed a file can confirm how easily this can happen!
Fortunately, this oversight is not that hard to address. My Java tool Validate Configuration Against Build can integrate easily with existing build tools
like Ant and Maven, and will provide a useful start to others wishing to validate their own build configurations. This 1.0 implemention
tests for the presence of class files in build directories referenced from XML files, and can be configured by QA, DevOps, or engineering personnel. It is configured to validate these relationships for the example..
The presentation is available from NEJUG here and source code, executable Java jar, example WeatherDataApp, and its configuration files
plus validateConfigurationAgainstJsps are freely available from
Github