Use maven to compile the ogc xmlbeans schemas
Before you start...
- make shure that you have a recent copy of the ogcschema directory somewhere in your path
- get the full 52north svn tree as described in MavenHome or at least the xmlbeans directory
- edit the
pom.xml file and set the property schema.directory to the location of the ogcschema:
<properties>
<beans.prefix>xbeans-</beans.prefix>
<schema.directory>/home/jtheuer/daten/work/52n/_ogcschemas/</schema.directory>
</properties>
Compile a schema.
This is a snapshot of the ogcschema directory. The structure is
artifact /
version, for example
ows/1.1.0
Each schema artifact (
ows) has a counterpart in the xmlbeans directory. Edit the corresponding
pom.xml file (e.g.
ows/pom.xml):
<?xml version="1.0"?><project>
<parent>
<artifactId>xbeans-bindings</artifactId>
<groupId>org.n52.xmlbeans</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.n52.xmlbeans</groupId>
<artifactId>sweCommon</artifactId>
<version>1.0.1</version>
<name>ows-common</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<sourceSchemas>
<sourceSchema>swe.xsd</sourceSchema>
</sourceSchemas>
</configuration>
</plugin>
</plugins>
</build>
</project>
artifactId and
version must exactly match the directory names (e.g.
ows 1.1.0). Finally set the
sourceSchema to that one which includes all necessary schema. That's all! Now, you can create the schemas by running
mvn install in the the directory where the pom.xml is stored.
includeing dependencies
Add a dependencies-section right after the plugins to add depended jar files (other already created schema):
<dependencies>
<dependency>
<groupId>org.n52.xmlbeans</groupId>
<artifactId>ows</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
--
JanTorbenHeuer - 03 Mar 2008