Track and identify across your Apache #Maven multi project builds all components, their versions, and class path if needed

Get valuable information from your testing team, and add it to the GUI of your web applications

To solve the problem number 1, we will use Manifest files

On the #Java platform, a manifest file is a specific file contained within a JAR archive. It is used to define extension and package related data. It is a metadata file that contains name-value pairs organized in different sections. If a JAR file is intended to be used as an executable file, the manifest file specifies the main class of the application. The manifest file is named MANIFEST.MF. [Wikipedia]

If you do nothing special in #Maven., you will see across your jar files the following in all META-INF/MANIFEST.MF

Never ask anymore when it was build (buildDate) and where (Built-By helpful if you have distributed build server agent) with what (svnrevision)

Never try to guess what was in the class path.

Lets add a bit of “magic” in one of our pom.xml, I assume that you have crafted a pom hierarchy using pom inheritance, isn’t’ it? so this code may have it’s place in your organization wide super pom.

The first plugin “buildnumber-maven-plugin” is unfortunately required, as it is the only way to get the revision number of the each Maven module. This is a small plugin that will get for each module the SVN revision and publish it under a variable ${buildNumber}

Configure the “maven-jar-plugin” to create manifest entries. Note the 2 custom entries svnrevision, that use the system variable published by the maven plugin “buildnumber-maven-plugin” and builddate. These 2 variable will also be read later in java.

The next time you run a “mvn package” on your project, or multi module project, all jar and war will get their MANIFEST.MF filled up by Apache Maven.

To solve problem number 2,

When you are using guerilla testing techniques (describe rapid iterations of user testing with few users) You expect the testing team:

to deliver some quality bugs reports.

to receive as much information as possible to be able to crush bugs efficiently.

IN order to reach that objective, I propose you to display in the bottom part of your web application some interesting data that will hopefully be part of any decent screenshot attached to bug entries.

1.0.0-SNAPSHOT

2010.09.22 15:43:23

16789

2010.09.22 17:12:53

The sprint version or Maven version

timestamp when Maven did build that version

SVN revision number of the web artifact

timestamp when the page has leaved the server.

While this seems a lot of data (you can use a smaller font as long as you can read it in screenshots), you will see that they are quite useful…

The first one let you visually notice in which sprint the error has been reported, detect that it was not deployed, or tested on the wrong server… Selenium automatic screenshot reporting will also help you locate the version where the issue occur a lot faster.

The second one, the build timestamp let the testing team see when the application has been build, developer see that it has been successfully deployed,

The SVN revision number if the key to quickly set up an eclipse workspace with that faulty code

The last one, let developer find in the logs files the issue a lot more faster

To do this, all you have to do is to read the META-INF/MANIFEST.MF of your web project and write in your JSP/JSF application. Here is a Bean that is doing that

About The Author

I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT

Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.