Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JiBX 1.2.3
-
Component/s: maven plugin
-
Labels:None
-
Number of attachments :1
Description
Spring OXM has integration for JiBX and thus there are a lot of test cases regarding it. I am currently trying to port the Ant based build to Maven and fail as the compiler seems to assume the classes to be bound-compiled on the src/main/java path.
If I move the classes from the package in the src/test/java path into src/main/java the compilation works fine. Returned into src/test/java I get a:
[INFO] [jibx:bind {execution: compile-jibx-beans}]
[INFO] Running JiBX binding compiler (single-module mode) on 1 binding file(s)
Error: Cannot find information for class org.springframework.oxm.jibx.Flights; on mapping element at (line 3, col 74, in binding.xml)
Error: Cannot find information for class org.springframework.oxm.jibx.FlightType; on mapping element at (line 9, col 76, in binding.xml)
Regards, Ollie.
-
Hide
- jibx-ota-test-bind.zip
- 09/May/10 12:21 PM
- 9 kB
- Don Corley
-
- jibx-ota-test-bind/.classpath 0.4 kB
- jibx-ota-test-bind/.project 0.5 kB
- jibx-ota-test-bind/.../org.eclipse.jdt.core.prefs 0.2 kB
- jibx-ota-test-bind/.../org.maven.ide.eclipse.prefs 0.3 kB
- jibx-ota-test-bind/pom.xml 3 kB
- jibx-ota-test-bind/src/.../jibx/AppTest.java 4 kB
- jibx-ota-test-bind/src/.../FlightType.java 0.8 kB
- jibx-ota-test-bind/src/.../jibx/Flights.java 1 kB
- jibx-ota-test-bind/src/.../oxm/flight.xsd 0.7 kB
- jibx-ota-test-bind/src/.../jibx/binding.xml 0.6 kB
- jibx-ota-test-bind/src/.../oxm/order.xsd 0.7 kB
Activity
There is a ticket in the Spring JIRA describing the use case: http://jira.springframework.org/browse/SPR-6882. So it should be sufficient to add the XML provided int the ticket to the current pom.xml of the OXM module of Spring to verify a possible bugfix. We probably won't apply the patch before a 3.1.M1 so it might take a while. Let me know if there's more you need to know.
Ollie,
This is my current issue, so I should have it fixed soon. Thanks for all the information.
I have looked through the cvs repository and I can't seem to find this module. There is a spring-oxm directory at http://springframework.cvs.sourceforge.net/viewvc/springframework/spring-projects/spring-oxm/ , but it is configured for ant.
Could you point me to this maven project.
Thanks,
Don
Hi Don,
the URL to the repository is https://src.springframework.org/svn/spring-framework. You should find a org.springframework.oxm folder in the trunk there. We're still building with Ant and Ivy. If you add the XML snippet from the linked issue of the Spring JIRA you should be able to build the module with Maven. Note, that other module poms are not error free yet so building them probably won't work. Nevertheless building the OXM module should work against the nightly builds in our snapshot repository.
Regards,
Ollie
Ollie,
I wasn't able to get that spring module to compile... I guess I don't have all the repository entries correct.
But, I was able to extract your jibx test case and recreate your error.
I'll get this fixed.
Don
Ollie,
The binding module now correctly runs in the test lifecycle.
To use the new code you need to:
Download the new plugin from cvs. Just follow the instructions at:
https://sourceforge.net/projects/jibx/develop
The module you want is:
cvs -z3 -d:pserver:anonymous@jibx.cvs.sourceforge.net:/cvsroot/jibx co -P maven-jibx-plugin
Then type:
cd maven-jibx-plugin
mvn install
We should be releasing the new 1.2.3 version soon.
Please make the following changes to your pom file(s):
1. Change the jibx version to 1.2.3 (1.2.2 for now)
- Remember to change the jibx runtime dependency versions
2. Change your goal from bind to test-bind
3. Change your phase from test-compile to process-test-classes (this is much safer)
I've attached my test case (which is just a modified version of your test case) if you need to start from something that works.
Thanks,
Don
P.S. I'm putting together some test cases. Would it be okay for me to use your schema and binding files. I would only be using the following small files: binding.xml, flight.xsd, Flights.java and FlightType.java files.
Don,
I've tried your approach - changing the CVS plugin version to 1.2.3-SNAPSHOT before installing, but I'm getting the error:
[INFO] Attempted to access the artifact junit:junit:jar:4.7:test; which has not yet been resolved
when I run the jibx:test-bind -P !jibxProfile,jibx-test goal
(the active profile is![]()
<profile>
<id>jibx-test</id>
<build>
<plugins>
<plugin>
<groupId>org.jibx</groupId>
<artifactId>maven-jibx-plugin</artifactId>
<version>1.2.3-SNAPSHOT</version>
<!-- <version>1.2.2</version>-->
<configuration>
<modules>
<module>information:pv-information-persistance</module>
<module>.reporting:pv-reporting-persistance</module>
</modules>
<directory>src/main/resources/jibx</directory>
<includes>
<include>*-bindingTest.xml</include>
<include>*-binding.xml</include>
</includes>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<phase>process-test-classes</phase>
<goals>
<goal>test-bind</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
The junit:jar is another dependency I have in the pom (if I remove it, it'll complain on the next dependency I have there).
Miguel,
I'm have problems recreating this error.
If there is any way you could attach a simplified sample that exhibits the same behavior, I'm sure I can fix this bug.
The error message is making me think that I'm not resolving transitive dependencies correctly for a test case.
Thanks,
Don
Don:
I am trying this again. I did the following:
1) downloaded the CVS of maven-plugin, like instructed
2) mvn installed it
3) downloaded test case
4) tried mvn jibx:test-bind.
I get an mvn error, though:
mvn jibx:test-bind
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building jibx-ota-test-bind (Bind test - from spring oxm project)
[INFO] task-segment: [jibx:test-bind]
[INFO] ------------------------------------------------------------------------
[INFO] [jibx:test-bind
]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Attempted to access the artifact org.jibx:jibx-run:jar:1.2.2:compile; which has not yet been resolved
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Fri Sep 24 09:48:11 WEST 2010
[INFO] Final Memory: 15M/292M
[INFO] ------------------------------------------------------------------------
Is there something missing from the test-case configuration?
Miguel,
This is a strange error. I'm not sure if the runtime version is correct (in my code).
If there is any way you could attach a simplified sample that exhibits the same behavior, including the POM file, I'm sure I can fix this bug.
Thanks,
Don
Ollie,
I think I have enough information to fix this bug, but it would be helpful if I had the specific code that you are working with from the spring project.
Can you post this code or point me to it's location in a source repository.
Thanks,
Don