JiBX -

maven-jibx-plugin

##### Main Project

- JiBX

##### Overview

- Introduction
- Goals
- Usage

##### Configuration

- Execution Modes

##### Examples

- Basic Binding Compilation
- Advanced Binding Compilation
- Generate Java Sources from Schemas
- Generate Modular Code from Schemas
- Test Case Usage
- XML Document comparison

## Generate WSDL from Java classes.

### WSDL from Java classes

Here is a sample plugin section:

          <plugin>
              <groupId>org.jibx</groupId>
              <artifactId>maven-jibx-plugin</artifactId>
              <version>1.2.3-SNAPSHOT</version>
              <executions>
                  <execution>
                      <id>jibx-2-wsdl</id>
                      <phase>process-classes</phase>
                      <goals>
                          <goal>jibx2wsdl</goal>
                      </goals>
                  </execution>
              </executions>
              <configuration>
                <interfaceClassNames>
                  <interfaceClassName>com.sosnoski.ws.library.jibx2wsdl.BookServer1</interfaceClassName>
                </interfaceClassNames>
              </configuration>
          </plugin>

If you want to include your generated wsdl files in your distribution (jar) file, the easiest way is to change the output directory in your configuration section:

              <configuration>
                <interfaceClassNames>
                  <interfaceClassName>com.sosnoski.ws.library.jibx2wsdl.BookServer1</interfaceClassName>
                </interfaceClassNames>
                <outputDirectory>/home/don/workspace-jibx/jibx/jibx-plugins/maven-jibx-plugin/target/classes/META-INF/schema</outputDirectory>
              </configuration>

Here the complete pom file used in the jibx test suite:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>

      <parent>
        <artifactId>jibx-ota-test</artifactId>
        <groupId>org.jibx.ota.test</groupId>
        <version>1.2.3</version>
      </parent>

      <artifactId>jibx-ota-test-jibx2wsdl</artifactId>
      <name>jibx-ota-test-jibx2wsdl</name>

      <packaging>jar</packaging>

      <build>
        <plugins>
          <plugin>
              <groupId>org.jibx</groupId>
              <artifactId>maven-jibx-plugin</artifactId>
              <version>1.2.3-SNAPSHOT</version>
              <executions>
                  <execution>
                      <id>jibx-2-wsdl</id>
                      <phase>process-classes</phase>
                      <goals>
                          <goal>jibx2wsdl</goal>
                      </goals>
                  </execution>
              </executions>
              <configuration>
                <interfaceClassNames>
                  <interfaceClassName>com.sosnoski.ws.library.jibx2wsdl.BookServer1</interfaceClassName>
                </interfaceClassNames>
                <outputDirectory>/home/don/workspace-jibx/jibx/jibx-plugins/maven-jibx-plugin/target/classes/META-INF/schema</outputDirectory>
              </configuration>
          </plugin>
        </plugins>
      </build>

      <dependencies>
          <dependency>
              <groupId>org.jibx</groupId>
              <artifactId>jibx-run</artifactId>
              <version>1.2.3-SNAPSHOT</version>
          </dependency>
          <dependency>
              <groupId>org.jibx</groupId>
              <artifactId>jibx-tools</artifactId>
              <version>1.2.3-SNAPSHOT</version>
              <scope>compile</scope>
          </dependency>
          <dependency>
              <groupId>org.jibx</groupId>
              <artifactId>jibx-bind</artifactId>
              <version>1.2.3-SNAPSHOT</version>
              <scope>compile</scope>
          </dependency>
          <dependency>
              <groupId>org.jibx</groupId>
              <artifactId>jibx-extras</artifactId>
              <version>1.2.3-SNAPSHOT</version>
              <scope>compile</scope>
          </dependency>
          <dependency>
              <groupId>org.jibx</groupId>
              <artifactId>jibx-schema</artifactId>
              <version>1.2.3-SNAPSHOT</version>
              <scope>compile</scope>
          </dependency>

        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </project>