Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JiBX 1.2.2
-
Fix Version/s: None
-
Component/s: eclipse-plugin
-
Labels:None
-
Environment:Linux
Eclipse Helios
-
Testcase included:yes
-
Number of attachments :
Description
The project structure is:
projectA:
| module1 |
| module2 module1 - database classes module2 - services (depends on projectA, maven speaking). |
Test case:
- jibx plugin configured in Module2
- person-binding.xml in src/main/resources/jibx of Module1
- Class Person in Module1
- Plugin configured like:
<modules>
<module>org.projects:module1</module>
</modules>
<directory>src/main/resources/jibx</directory>
<includes>
<include>*-binding.xml</include>
- Run the jibx-bind goal in Module2
Expected result:
Jibx would pick the -binding file in Module1, because the configuration has a reference to it
Actual result:
[INFO] Not running JiBX binding compiler (restricted multi-module mode) - no binding files
I attach a sample case. It consists of the Eclipse projects referenced here.
To check the behavior:
- Put the projects in a workspace
- Run the jibx:bind goal in Eclipse on Module2.
Activity
Don Corley
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Don Corley [ doncorley ] |
Don Corley
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Miguel,
Yes, you are correct. Running the jibx:bind goal on Module2 will give you an error.
Here is why:
module2 needs access to the module1 PROJECT (not the module1 DISTRIBUTION) to access the binding file. If you build the module2 project by itself, it only knows where the module1.jar DISTRIBUTION file is in the maven repository. Remember that the binding.xml file does not even have to be in the distribution (.jar) file for jibx to work, and in fact you put it in a different location in your jar.
A multi-module build needs access to the actual PROJECT.
This should not be a problem for tightly integrated sub-projects such as yours. Just build from the main project:
cd projectA
mvn install
(module2 builds fine, since projectA contains module1 and module2)
If you MUST build module2 by itself, you will have to create a direct reference to the binding file in the other project:
{basedir}$
/../module1/target/classes/jibx/person-binding.xml
I hope this answers your question. This is one of those confusing maven cases.
Don