Either the PMGS_WS element is a shared element and should be placed in a shared XSD (using includes).
Or it has different meanings and then I would declare it twice with 2 different target namespaces (one for each XML Schema). Gérald 2009/11/16 Cristiano Gavião <[email protected]>: > Hi Gerald, thanks for your reply. > > My problems is that I have two XSDs (it comes from a supplier that has dumb > people :-) ) and both have same element names... > So I've tried to generate them on different packages as is writed on faq > page: http://mojo.codehaus.org/jaxb2-maven-plugin/faq.html > > I've already done what do you suggest me, but instead of using external xjc > file, I 've done the inline binding modification on the xsd. Its work > running one by one, but its not work running both on same execution. > (duplicate error) > > Here is my xsd files, I think its all right: > > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > <xsd:schema xmlns:jxb="http://java.sun.com/xml/ns/jaxb" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" jxb:version="1.0"> > <xsd:annotation> > <xsd:appinfo> > <jxb:schemaBindings> > <jxb:package > > name="com.pmenos.cosmos.contaspagarreceber.entidade.contratoarrecadacao"> > </jxb:package> > <jxb:nameXmlTransform> > <jxb:elementName suffix="Element" /> > </jxb:nameXmlTransform> > </jxb:schemaBindings> > </xsd:appinfo> > </xsd:annotation> > > <xsd:element name="PMGS_WS"> > <xsd:complexType> > <xsd:annotation> > <xsd:appinfo> > <jxb:class name="ImportacaoContratoArrecadacaoType" /> > </xsd:appinfo> > </xsd:annotation> > <xsd:sequence maxOccurs="unbounded" minOccurs="0"> > <xsd:element name="Table1"> > <xsd:complexType> > <xsd:annotation> > <xsd:appinfo> > <jxb:class name="ContratoArrecadacaoType" /> > </xsd:appinfo> > </xsd:annotation> > <xsd:sequence> > <xsd:element minOccurs="0" name="COD_CONTRATO" > type="xsd:string" /> > <xsd:element minOccurs="0" name="COD_PARCEIRO" > type="xsd:string" /> > <xsd:element minOccurs="0" name="FORMA_COB_TAXA" > type="xsd:string" /> > <xsd:element minOccurs="0" name="CLI_NOME" > type="xsd:string" /> > <xsd:element minOccurs="0" name="CNPJ_CPF" > type="xsd:string" /> > <xsd:element minOccurs="0" name="BANCO" > type="xsd:string" /> > <xsd:element minOccurs="0" name="AGENCIA" > type="xsd:string" /> > <xsd:element minOccurs="0" name="CONTA_CORRENTE" > type="xsd:string" /> > <xsd:element minOccurs="0" name="CONTA_TITULAR" > type="xsd:string" /> > <xsd:element minOccurs="0" > name="TIPO_DE_REPASSE" > type="xsd:string" /> > <xsd:element minOccurs="0" name="Se_CNPJ_CPF" > type="xsd:string" /> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > </xsd:schema> > > <xsd:schema xmlns:jxb="http://java.sun.com/xml/ns/jaxb" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" jxb:version="1.0"> > <xsd:annotation> > <xsd:appinfo> > <jxb:schemaBindings> > <jxb:package > > name="com.pmenos.cosmos.contaspagarreceber.entidade.movimentoarrecadacao"> > </jxb:package> > <jxb:nameXmlTransform> > <jxb:elementName suffix="Element" /> > </jxb:nameXmlTransform> > </jxb:schemaBindings> > </xsd:appinfo> > </xsd:annotation> > > <xsd:element name="PMGS_WS"> > <xsd:complexType> > <xsd:annotation> > <xsd:appinfo> > <jxb:class name="ImportacaoMovimentoArrecadacaoType" /> > </xsd:appinfo> > </xsd:annotation> > > <xsd:sequence minOccurs="0" maxOccurs="unbounded"> > <xsd:element name="Table1"> > <xsd:complexType> > <xsd:annotation> > <xsd:appinfo> > <jxb:class name="MovimentoArrecadacaoType" > /> > </xsd:appinfo> > </xsd:annotation> > <xsd:sequence> > <xsd:element name="DataReceb" type="xsd:string" > minOccurs="0" /> > <xsd:element name="CodCtr" type="xsd:string" > minOccurs="0" /> > <xsd:element name="DataRepas" type="xsd:string" > minOccurs="0" /> > <xsd:element name="ValReceb" type="xsd:string" > minOccurs="0" /> > <xsd:element name="ValLiquido" type="xsd:string" > minOccurs="0" /> > <xsd:element name="TipoRep" type="xsd:string" > minOccurs="0" /> > <xsd:element name="CredComis" type="xsd:string" > minOccurs="0" /> > <xsd:element name="ComisPMS" type="xsd:string" > minOccurs="0" /> > <xsd:element name="ComisEPM" type="xsd:string" > minOccurs="0" /> > <xsd:element name="ValDesc" type="xsd:string" > minOccurs="0" /> > <xsd:element name="ValCheq" type="xsd:string" > minOccurs="0" /> > <xsd:element name="TotalValorCartao" > type="xsd:string" > minOccurs="0" /> > <xsd:element name="Quantidade" type="xsd:string" > minOccurs="0" /> > <xsd:element name="Parceiro" type="xsd:string" > minOccurs="0" /> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > </xsd:schema> > > > Gérald Quintana escreveu: > > Why do you 2 executions? Can't you process all XSD in the same execution? > If the only reason the packagename configuration, then I advise you to > move it to an .xjb file: > > Create a movimento_arrecadacao.xjb file in src/main/resources/xjb folder > <jxb:bindings version="1.0" > xmlns:jxb="http://java.sun.com/xml/ns/jaxb" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" > jxb:extensionBindingPrefixes="xjc"> > <jxb:bindings schemaLocation="../xsd/movimento_arrecadacao.xsd" > node="/xs:schema"> > <jxb:schemaBindings> > <jxb:package name="com.example.movimentoarrecadacao"/> > </jxb:schemaBindings> > </jxb:bindings> > </jxb:bindings> > > And the same for contrato_arrecadacao.xsd --> contrato_arrecadacao.xjb > <jxb:bindings version="1.0" > xmlns:jxb="http://java.sun.com/xml/ns/jaxb" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" > jxb:extensionBindingPrefixes="xjc"> > <jxb:bindings schemaLocation="../xsd/contrato_arrecadacao.xsd" > node="/xs:schema"> > <jxb:schemaBindings> > <jxb:package name="com.example.contratoarrecadacao"/> > </jxb:schemaBindings> > </jxb:bindings> > </jxb:bindings> > > Gérald > > > 2009/11/16 Cristiano Gavião <[email protected]>: > > > Hi, > > I'm trying to use jaxb2-maven-plugin with two executions but it's not > working: > > [ERROR] no schemas has been found > > It seems that configuration is not being reading inside execution node but > only outside of executions node. > > Please, could someone tell me, am I doing something wrong? > > This is my pom: > > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>jaxb2-maven-plugin</artifactId> > <version>1.3</version> > <executions> > <execution> > <id>ContratoArrecadacao</id> > <goals> > <goal>xjc</goal> > </goals> > <configuration> > <verbose>true</verbose> > > <staleFile>${project.build.directory}/generated-sources/jaxb/contratoarrecadacao/.staleFlag</staleFile> > > <schemaFiles>contrato_arrecadacao.xsd</schemaFiles> > > <schemaDirectory>${basedir}/src/main/resources/xsd/</schemaDirectory> > > <packagename>com.example.contratoarrecadacao</packagename> > </configuration> > </execution> > <execution> > <id>MovimentoArrecadacao</id> > <goals> > <goal>xjc</goal> > </goals> > <configuration> > <verbose>true</verbose> > <forceRegenerate>true</forceRegenerate> > <clearOutputDir>false</clearOutputDir> > > <staleFile>${project.build.directory}/generated-sources/jaxb/movimentoarrecadacao/.staleFlag</staleFile> > > <schemaDirectory>${basedir}/src/main/resources/xsd/</schemaDirectory> > > <schemaFiles>movimento_arrecadacao.xsd</schemaFiles> > > <packagename>com.example.movimentoarrecadacao</packagename> > </configuration> > </execution> > </executions> > </plugin> > > -- > _______________________________________ > Cristiano Gavião - Analista de Sistemas > DRY Software > Fone: (85) 9912-5251 > > --------------------------------------------------------------------- To > unsubscribe from this list, please visit: > http://xircles.codehaus.org/manage_email > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > > > --------------------------------------------------------------------- To > unsubscribe from this list, please visit: > http://xircles.codehaus.org/manage_email
