You are here: Wiki>Documentation Web>MavenHome>MavenOgcXmlbeans (04 Apr 2012, HenningBredel)Edit Attach

Status

ALERT! This site is outdated (the oxf2.0 common-xml module provides the schema jars already as built dependencies)

Use maven to compile the ogc xmlbeans schemas

Before you start...

  1. make shure that you have a recent copy of the ogcschema directory somewhere in your path
  2. get the full 52north svn tree as described in MavenHome or at least the xmlbeans directory
  3. 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 ogcschema.png

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
Topic revision: r2 - 04 Apr 2012, HenningBredel
Legal Notice | Privacy Statement


This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Wiki? Send feedback