Hi,
Here is a simple problem, but gives your Java Brain very interesting mistry to solve
I was working on a production issue and observed a strange behaviour.
When I rebuit the ear file with the same source code, the following 6 jars missing from the war file
On investigation I find these jars are the transitive dependency jars for hibernate-3.2.7.ga.jar
antlr-2.7.6.jar
asm-1.5.3.jar
asm-attrs-1.5.3.jar
cglib-2.1_3.jar
dom4j-1.6.1.jar
From the very next version of Hibernate these jars arent defined as dependencies
I was hoping that the other jars (like spring jars...) were having a conflicting dependency and so while
maven packaging it is excluding the ear file.
But very interestingly I was able to replicate the same ear with transitive jars included when I rebuild in a machine with a certain spec (Lets say success machine) [I will keep the surprise for now and let you know the spec in a minute]
In order to nail down the problem I created a simple helloHBM project which has no java files in it and just the hibernate-3.2.7.ga.jar defined as the only dependency.
when I build the ear in other machines, I dont get the transitive jars.
But when I build in success machines ( tried in 2 success machines ) i could see the app built with the transitive jars
Success machine is windows machine (any version) with 32 bit Java Version 1.6 and Maven build version is 3.0.3
I tried my level best to remove all the parameters and could nail down to the above two variables ( Java version and Maven version) but beyond that I wasnt able to reason out why it behaved differently
Can some one try this challanging strange behaviour?
I have simplified it to a simple helloHBM java program without any reference to my project and is very generic and basic in nature. The pom file is very simple too. But gives me sleepless nights until i uncover the mystry
You may Copy the pom.xml and web.xml contents to the below structure and run the command :
mvn clean package -X
Directory Structure :
HelloHBM -> pom.xml
HelloHBM -> src -> main -> webapp -> WEB-INF -> web.xml
pom.xml
-------------------------------------------------------------------------------------------------
web.xml
and check if you get the following 6 files as part of your war
[DEBUG] adding entry WEB-INF/lib/antlr-2.7.6.jar
[DEBUG] adding entry WEB-INF/lib/asm-1.5.3.jar
[DEBUG] adding entry WEB-INF/lib/asm-attrs-1.5.3.jar
[DEBUG] adding entry WEB-INF/lib/cglib-2.1_3.jar
[DEBUG] adding entry WEB-INF/lib/dom4j-1.6.1.jar
Success Criteria for this puzzle is to build the war file with the above 6 jars and to figure out why it is missing in few cases.
Trust me.. This will be a good Brainstormer
Enjoy your Challenge
Thanks in Advance for any suggestions
Regards,
Ghilli