Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>David,</p> <p>Good! While including the binding.xml file is not required, it is good practice. The new jibx-maven-plugin can use this file later when creating a new binding that is based on the original schema. There are plenty of examples in the JiBX source repository.</p> <p>Since JiBX is OSGi enabled, it is also good practice to add an OSGi manifest when creating your jar file. This also simplifies including the binding.xml file. Even if you don't use OSGi, your jar will work fine. Here is what your project file should look like:</p> <pre><code>&lt;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"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;org.dataone.ns.service&lt;/groupId&gt; &lt;artifactId&gt;org.dataone.ns.service.types.v1&lt;/artifactId&gt; &lt;version&gt;0.0.1&lt;/version&gt; &lt;packaging&gt;bundle&lt;/packaging&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.jibx&lt;/groupId&gt; &lt;artifactId&gt;jibx-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.2.3&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;generate-java-code-from-schema&lt;/id&gt; &lt;goals&gt; &lt;goal&gt;schema-codegen&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;schemaLocation&gt;src/main/jibx&lt;/schemaLocation&gt; &lt;includeSchemas&gt; &lt;includeSchema&gt;dataoneTypes.xsd&lt;/includeSchema&gt; &lt;/includeSchemas&gt; &lt;options&gt; &lt;package&gt;org.dataone.ns.service.types.v1&lt;/package&gt; &lt;/options&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;compile-binding&lt;/id&gt; &lt;goals&gt; &lt;goal&gt;bind&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;schemaBindingDirectory&gt;target/generated-sources&lt;/schemaBindingDirectory&gt; &lt;includes&gt; &lt;include&gt;binding.xml&lt;/include&gt; &lt;/includes&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt; &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;configuration&gt; &lt;instructions&gt; &lt;Include-Resource&gt;META-INF/binding.xml=${basedir}/target/generated-sources/binding.xml&lt;/Include-Resource&gt; &lt;Export-Package&gt;org.dataone.ns.service.types.v1.*;version=${project.version}&lt;/Export-Package&gt; &lt;/instructions&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.jibx&lt;/groupId&gt; &lt;artifactId&gt;jibx-run&lt;/artifactId&gt; &lt;version&gt;1.2.3&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.jibx&lt;/groupId&gt; &lt;artifactId&gt;jibx-extras&lt;/artifactId&gt; &lt;version&gt;1.2.3&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; </code></pre> <p>Take a look at your jar file. Your classes, the binding.xml file, and OSGi manifest entries are there!</p> <p>Don Corley jibx-maven-plugin author</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload