我有一个 pom.xml,用于从模式生成源并绑定和编译。
<!-- <plugin>
<groupId>org.jibx</groupId>
<artifactId>maven-jibx-plugin</artifactId>
<version>1.2.1.1</version>
<configuration>
<directory>src/main/resources/schema</directory>
</configuration>
<executions>
<execution>
<goals>
<goal>schema-codegen</goal>
</goals>
</execution>
</executions>
</plugin> -->
<plugin>
<groupId>org.jibx</groupId>
<artifactId>maven-jibx-plugin</artifactId>
<version>1.2.1.1</version>
<configuration>
<targetDirectory></targetDirectory>
<directory>src/main/resources/jibx</directory>
<includes>
<includes>*binding.xml</includes>
</includes>
<excludes>
<exclude>template-binding.xml</exclude>
</excludes>
<verbose>false</verbose>
</configuration>
<executions>
<execution>
<goals>
<goal>bind</goal>
</goals>
</execution>
<execution>
<id>compile-binding</id>
</execution>
</executions>
</plugin>
因此,当我尝试生成 .java 和 binding.xml 时,我取消注释第一部分并注释底部。这会生成 .java 和 binding.xml。现在,我将 binding.xml 复制到src/main/resources/jibx
并将 java 类复制到com.models.response package
. 然后我通过取消注释这些行并注释顶部来运行绑定和编译绑定目标。我可以JiBX_bindingFactory.class
在“target.com.models.response”包中看到“JiBX_bindingResponse_access.class”。
问题是当我运行一个测试类并尝试将响应输入流解组为“Response.class”时,我收到了Exception in thread "main" org.jibx.runtime.JiBXException: JiBx Exception: Unable to access binding information for class com.models.response.Response
Make sure the binding has been compiled
错误。
请注意:我在 Eclipse 中执行所有这些操作,默认输出文件夹显示“/build”。我也尝试将 Jibx 类复制粘贴到“build”文件夹中。仍然面临同样的问题。
请帮忙!!!!!
谢谢