[jboss-jira] [JBoss JIRA] (DROOLS-357) Multiple static initialization makes debugging Maven issues impossible
Lukáš Petrovický (JIRA)
jira-events at lists.jboss.org
Fri Nov 29 06:45:06 EST 2013
Lukáš Petrovický created DROOLS-357:
---------------------------------------
Summary: Multiple static initialization makes debugging Maven issues impossible
Key: DROOLS-357
URL: https://issues.jboss.org/browse/DROOLS-357
Project: Drools
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Affects Versions: 6.0.0.Final
Reporter: Lukáš Petrovický
Assignee: Mario Fusco
When running kie-ci tests against productized binaries, most of the tests in that module fail with this particular exception (or similar):
java.lang.NoClassDefFoundError: Could not initialize class org.kie.scanner.MavenRepository
at org.kie.scanner.KieModuleMavenTest.testKieModulePojoDependencies(KieModuleMavenTest.java:119)
Turns out, this exception is (through multiple levels of static initialization) actually caused here:
https://github.com/droolsjbpm/drools/blob/master/kie-ci/src/main/java/org/kie/scanner/embedder/MavenProjectLoader.java#L10
Maven resolution fails, because it cannot find some dependencies in the project being loaded. As a result, the class is never initialized, fast forward two other classes, and you get the above exception. I kindly ask that this behavior be changed in such a way that the original exception bubbles up through the stack - otherwise, the user has no chance to figure out what's going on.
The issue is a bit tricky to reproduce, as it's directly related to artifacts not being resolvable - but it should, if my understanding of the error is correct, be enough to have a parser error in the POM that's being loaded.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list