You need to "get" the XSD that is 'in' the jar file and then reference that retrieval within the XML.
http://stackoverflow.com/questions/9280226/referencing-a-xsd-schema-within-jar-file Best Sartaj On Mon, Feb 10, 2014 at 1:28 PM, Zmuda, Matt <[email protected]> wrote: > Hi All, > > I am trying to generate some web service client code from a WSDL and > schemas that I have. > One issue I am encountering is that one schema file (xsd) I require is in > a separate jar that my client project has a dependency on. > I cannot figure out how to reference that file in my pom. I have been lead > down the path of looking into defining a catalog (and it seems that how it > was done in the and build we use to use) however I can't get this working. > > Below is what I have.. but not sure if I am on right track or not. Any > help is appreciated! > > The POM Sample > > <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" > http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/xsd/maven-4.0.0.xsd"> > <modelVersion>4.0.0</modelVersion> > <groupId>com.thegroup</groupId> > <artifactId>com.theclientcode</artifactId> > <version>0.0.1-SNAPSHOT</version> > > <dependencies> > <dependency> > <!-- This dependency > contains the schema my wsdl needs --> > <!-- How can I reference > it? --> > > <groupId>com.mygroup</groupId> > > <artifactId>myartifact</artifactId> > <version>1.0</version> > </dependency> > </dependencies> > <build> > <plugins> > <plugin> > > <groupId>org.codehaus.mojo</groupId> > > <artifactId>jaxws-maven-plugin</artifactId> > > <version>1.12</version> > > <executions> > > <execution> > > <goals> > > <goal>wsimport</goal> > > </goals> > > </execution> > > </executions> > > <configuration> > > <extension>true</extension> > > <!-- Is this what I should be using? What should be in it??? 0--> > > <catalog>${basedir}/src/main/resources/META-INF/catalog.xml</catalog> > > <wsdlDirectory>${basedir}/src/main/resources</wsdlDirectory> > > <sourceDestDir>${project.build.sourceDirectory}</sourceDestDir> > > <staleFile>${basedir}/src/jaxws/stale/.staleFlag</staleFile> > > <wsdlLocation>/META-INF/wsdl/TheWSDL.wsdl</wsdlLocation> > > <wsdlFiles> > > <wsdlFile>/META-INF/wsdl/TheWSDL.wsdl</wsdlFile> > > </wsdlFiles> > > <target>2.1</target> > > > </configuration> > > <dependencies> > > <dependency> > > <groupId>com.sun.xml.ws</groupId> > > <artifactId>jaxws-tools</artifactId> > > <version>2.2.0.2</version> > > </dependency> > > </dependencies> > </plugin> > </plugins> > </build> > </project> > > > The catalog.xml Sample: > > <xmlcatalog id="wsimportcatalog"> > <!-- What is this location relative to? --> > <entity publicid="file:/com/something/Fault.xsd" > location="/../schema/com/something/Fault.xsd"/> > </xmlcatalog> > > > Jaxb Bindings for the schema: > > <jxb:bindings version="1.0" > xmlns:jxb="http://java.sun.com/xml/ns/jaxb" > xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" > xmlns:xs="http://www.w3.org/2001/XMLSchema"> > > <jxb:bindings schemaLocation="/com/something/Fault.xsd" > node="/xs:schema"> > <jxb:schemaBindings> > <jxb:package name="com.something.xml"> > <jxb:javadoc><![CDATA[<body>Package level > documentation for generated package</body>]]></jxb:javadoc> > </jxb:package> > </jxb:schemaBindings> > </jxb:bindings> > > </jxb:bindings> > > > > NOTICE: Confidential message which may be privileged. Unauthorized > use/disclosure prohibited. If received in error, please go to > www.td.com/legal for instructions. > AVIS : Message confidentiel dont le contenu peut être privilégié. > Utilisation/divulgation interdites sans permission. Si reçu par erreur, > prière d'aller au www.td.com/francais/avis_juridique pour des > instructions. >
