users@jaxb.java.net

Re: maven-jaxb-schemagen-plugin additional hand-written schema import

From: davy123 <david.vidrih_at_marand.si>
Date: Wed, 18 Feb 2009 00:56:33 -0800 (PST)

As somebody asked me by mail if I solved my problem, I'm responding here:

I solved the problem, but not in very good way. I used maven-ant-plugin
replace ant command to replace some existing import string with the same
string plus missing import. Example:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <configuration>
                <tasks>
                    <replace
dir="${project.build.directory}/generated-schema">
                        <include name="*.xsd"/>
                       
<replacetoken><![CDATA[SOMETHING_FROM_YOUR_XSD]]></replacetoken>
                        <replacevalue><![CDATA[SOMETHING_FROM_YOUR_XSD
MISSING_IMPORT]]></replacevalue>
                    </replace>
            </configuration>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Hope this helps, David.




davy123 wrote:
>
> I'm using the maven-jaxb-schemagen-plugin to generate schema from java
> sources.
>
> The schema is generated correctly, except that it does not add one
> 'manual' import. I have a special hand-written XSD that defines some
> simple types, like simple string restrictions, that are the used in java
> code from which the other schema files are generated. And this manual
> schema file import is not added into generated XSDs by plugin.
>
> I have added the <schema> tag for this file and it's namespace in the
> plugin configuration but it does not help. Does anyone know the solution
> for this problem, using this plugin?
>

-- 
View this message in context: http://www.nabble.com/maven-jaxb-schemagen-plugin-additional-hand-written-schema-import-tp18921720p22074696.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.