Maven plugin: generated JiBX_mappingFactory class doesn't contain bindings
defined in sub-project(s)
----------------------------------------------------------------------------------------------------
Key: JIBX-191
URL: http://jira.codehaus.org/browse/JIBX-191
Project: JiBX
Issue Type: Bug
Components: maven plugin
Affects Versions: JiBX 1.1.5
Environment: all
Reporter: Jeff Deppen
Priority: Blocker
Assume there are 2 sub projects, named B and C, underneath a parent project
named A. If there is a binding file in both B and C. The mapping file in C
<includes> the mapping file in B. JiBX creates only one JiBX_mappingFactory
and places it into the B project.
There a few problems with this, the worst (show stopper) is that the
JiBX_mappingFactory in project B is updated AFTER maven has JARed the contents
of B. As a result, the installed/deployed JiBX_mappingFactory in B is NOT
current and "knows" nothing about the classes in C.
The solution is actually quite simple. There are 2 steps, they are a
configuration setting and a jibx code change, as outlined below:
1. add a "package" attribute to the binding file in C (this will cause JiBX to
create a 2nd JiBX_mappingFactory)
2. change Utility.findMappedClass to search from the bottom up. This causes
JiBX factory creation logic to "skip" past the <included> binding file and look
only at bindings that are in the dependent maven project (in this case, project
"C").
All of this is to say - please change the loop in Utility.findClass
from:
for (int i = 0; i < childs.size(); i++) {
to:
for (int i = childs.size() - 1; i >=0; i--) {
This shouldn't break any existing functionality and have the needed
"side-effect" of making the maven plugin more useful.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs