maven-jaxb2-plugin

getting error only one globalBindings customization is allowed in a whole compilation while using maven-jaxb2-plugin

∥☆過路亽.° 提交于 2021-02-08 03:33:48
问题 I am using maven-jaxb2-plugin. Here is my plugin configuration <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <executions> <execution> <id>xjc-serviceoperations</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <generateDirectory>${basedir}/src/main/java/</generateDirectory> <schemaDirectory>src/main/resources/schemas/lmsapi/serviceoperations</schemaDirectory> <removeOldOutput>false</removeOldOutput> <

Unmarshalling Error: unexpected element (uri:url, local:“objectname”). Expected elements are <{}objectname>

筅森魡賤 提交于 2020-01-13 09:25:09
问题 I'm using jaxb2-marshaller to generate classes to communicate with a webservice. Java-classes are generated with use of some wsdl files. Everything is okay now, but when I'm trying to use some of the generated classes, i got this unmarshalling error, altough I use the generated ObjectFactory classes. Some of the stack: org.springframework.ws.soap.client.SoapFaultClientException: Unmarshalling Error: unexpected element (uri:"http://xxxxxxxxx", local:"customer"). Expected elements are <{

maven-jaxb2-plugin not compiling xsd on linux machine but works on windows?

依然范特西╮ 提交于 2020-01-06 15:18:41
问题 Here is code snippet from pom.xml <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.8.3</version> </plugin> Here is the exception [INFO] --- maven-jaxb2-plugin:0.8.3:generate (default) @ customer-project --- [ERROR] Error while parsing schema(s).Location [ file:....Customer.xsd{12,97}]. org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'customer:CustomerApplication' to a(n) 'element declaration' component. at com.sun

Jaxb: How to specify a default class for an XSD element

我的未来我决定 提交于 2019-12-25 07:59:52
问题 When generating Java classes from a XSD, how can I specify that for some specific node, a specific and already existent Java class should be used instead of trying to generate one? Thank you very much. 回答1: You can use episode file to reference the existing classes. .episode files are just jaxb bindings file and has mappings between elements and java classes. a) if those existing classes are also generated from (another) xsd. use below option to first create .episode file. xjc -episode a

Cannot resolve the name to a(n) 'element declaration' component

时光总嘲笑我的痴心妄想 提交于 2019-12-25 04:49:14
问题 while compiling maven-jaxb2-plugin I get below error [INFO] --- maven-jaxb2-plugin:0.8.3:generate (default) @ customer-project --- [ERROR] Error while parsing schema(s).Location [ file:....Customer.xsd{12,97}]. org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'ttadcustomer:CustomerApplicationDetail' to a(n) 'element declaration' component. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org

How do I tell the maven-jaxb2-plugin to run xjc on all .xsd files in a maven dependency?

倖福魔咒の 提交于 2019-12-25 04:28:09
问题 I'm using the maven-jaxb2-plugin and my .xsd files are in a maven dependency. The documentation shows that you specify a .xsd in a maven dependency like this <schema> <!-- Specifies a schema from the Maven artifact. --> <dependencyResource> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin-tests-po</artifactId> <!-- Version of the artifact. May be omitted. The plugin will then try to find the version using the dependencyManagement and dependencies of the project. -->

Unrecognized parameter -XsomePlugin error when using JAXB/XJC plugins

亡梦爱人 提交于 2019-12-24 15:14:08
问题 I am compiling an XML Schema using JAXB/XJC and I want to use some XJC plugin to augment generated code. I include plugin into the XJC classpath and activate it using -XsomePlugin . However I am getting an error like: Caused by: com.sun.tools.xjc.BadCommandLineException: unrecognized parameter -XsomePlugin at com.sun.tools.xjc.Options.parseArguments(Options.java:859) at com.sun.tools.xjc.XJCBase._doXJC(XJCBase.java:804) ... 21 more So apparently the plugin is not picked up by XJC or is not

Skip the Generated on… in Java files using jaxb2 maven plugin

▼魔方 西西 提交于 2019-12-23 07:57:22
问题 I'd like to get the maven-jaxb2-plugin to do not write the 'disclaimer': This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.2-hudson-jaxb-ri-2.2-63- See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> Any modifications to this file will be lost upon recompilation of the source schema. Generated on: 2011.08.01 at 09:20:43 AM CEST At least the timestamp. Thank you. Udo. 回答1: Use -no-header if you use command line

Generate java classes from a wsdl url with basic authentication

爱⌒轻易说出口 提交于 2019-12-22 08:08:44
问题 I am trying to generate the java classes from a WSLD file, that uses basic authentication. Although there are many plugins out there, I have to use the following one: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin With wsimport or wsdl2java i have found the way to configure the basic authentication parameters. Using the maven-jaxb2-plugin i had no luck. My configuration follows: <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.13.2</version>

JAXB Bindings to schemas in a JAR

久未见 提交于 2019-12-21 04:52:16
问题 I'm using the maven jaxb2 plugin to generate Java classes, built from schemas in a jar. However, I'm not sure how to correctly locate to these schemas from a bindings file. If Iextract the schemas from the jar and drop them in the same directory as the bindings, all is well. However, this isn't a practical long term solution. pom.xml: <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.8.1</version> <executions> <execution> <goals> <goal