I have the following configuration for maven-jaxb2-plugin
:
<!-- https://mvnrepository.com/artifact/org.jvnet.jaxb2.maven2/maven-jaxb2-plugin -->
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.13.2</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<strict>false</strict>
<schemaLanguage>WSDL</schemaLanguage>
<generatePackage>com.mycompany.project.domain.wsdl</generatePackage>
<schemas>
<schema>
<url>url or file</url>
</schema>
</schemas>
</configuration>
</plugin>
and it is failing with:
[ERROR] Error while parsing schema(s).Location [ file:/home/hasancansaral/workspace/company/domain/src/main/xsd/delivery.wsdl{2,366}].
org.xml.sax.SAXParseException; systemId: file:/home/hasancansaral/workspace/company/domain/src/main/xsd/delivery.wsdl; lineNumber: 2; columnNumber: 366; JAXB version attribute must be present
It doesn't make a difference if I run the plugin through IntelliJ IDEA or do a simple mvn clean jax2b:generate
. However, the action is successful with the schema that can be found here, so I am suspecting of my wsdl schema being actually malformed, which I cannot make public for the moment, but can provide via messages (I know that it is not much help to public as is, but if the problem is in the schema I will post the related problematic part of it here).
Note: SOAP UI validates the schema as well.
Note2:
Same error is present with both jax2b-maven-plugin
and maven-jax2b-plugin
.
jaxb:class
customizations. Therefore XJC expectsjaxb:version
on schema. I'll take a look on the weekend. – Longclothxmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="2.1"
to the root element as in the answer and it resolved my issue. That was the only thing I did. – Frontpage.xjb
file. It's root element is as follows:<jaxb:bindings version="2.1" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
– Frontpage