maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Schuster <jo...@Navsys.com>
Subject XJC/XSD dependancies
Date Mon, 29 Nov 2010 21:35:36 GMT

I have a couple projects in that use XJC via the org.jvnet.jaxb2.maven2 plugin.

The problem I'm running into is when the XSD of one project depends on the XSD of another.

I can't seem to find a good 'maven-esq' way to deal with this. Right now I'm unpacking the
xsds from the dependency jars (via the maven-dependency-plugin) and referencing them using
a relative path:

Ex:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.1</version>
            <executions>
                        <execution>
                                    <id>unpack-dependancies</id>
                                    <phase>process-resources</phase>
                                    <goals>
                                                <goal>unpack</goal>
                                    </goals>
                                    <configuration>
                                                <artifactItems>
                                                            <artifactItem>
                                                                        <groupId>com.company</groupId>
                                                                        <artifactId>parent.project</artifactId>
                                                                        <version>0.0.1-SNAPSHOT</version>
                                                                        <type>jar</type>
                                                                        <overWrite>false</overWrite>
                                                                        <outputDirectory>${project.build.directory}/dependencies/parent.project</outputDirectory>
                                                                        <includes>**/*.xsd,**/*.xjb</includes>
                                                            </artifactItem>

...

In child.xsd

<import schemaLocation="../../../../target/dependencies/parent.project/schema/parent.xsd"
...

Seems there should be a way to reference a file within a maven dependency without having to
unpack it first.

Thoughts?


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message