users@jaxb.java.net

maven-jaxb-plugin and xjc plugins

From: Vivian Steller <vivian.steller_at_uni-ulm.de>
Date: Tue, 5 Jun 2007 02:10:52 +0200

Hello,
I've coded my first XJC plugin but have the problem that the maven-
jaxb-plugin seems not to recognize the plugin.

Below the error message when running mvn jaxb:generate:

[INFO] [jaxb:generate]
includeSchemas: 1 : todo.xsd
[INFO] schemaDirectory: /...
[INFO] includeSchemas: [todo.xsd]
[INFO] excludeSchemas: null
[INFO] includeBindings: [*.xjb]
[INFO] excludeBindings: null
[INFO] generatePackage: net.eecoo.jaxfaces.example.todo
[INFO] generateDirectory: /...
[INFO] readOnly: false
[INFO] extension: true
[INFO] catalog: null
[INFO] removeOldOutput: false
[INFO] strict: false
[INFO] verbose: true
[INFO] Schema dependency: /.../todo.xsd
[INFO] pom dependency: /.../pom.xml
[INFO] XJC compile using schema: ...todo.xsd
[INFO] build id of XJC is 2.0.1-06/08/2006 12:05 AM(kohsuke)-fcs
[INFO] Checking timestamp of ...
[INFO] the last modified time of the inputs is 1181001201000
[INFO] the last modified time of the outputs is 1180704894000
[INFO] Compiling file:/.../todo.xsd
[ERROR] [ERROR] Unsupported binding namespace "jxfb"
[ERROR] line 2 of file:/.../todo.xsd
[ERROR]
[INFO] failure in the XJC task. Use the Ant -verbose switch for more
details
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] unable to parse the schema. Error messages should have been
provided
[INFO]
------------------------------------------------------------------------
[INFO] Trace
unable to parse the schema. Error messages should have been provided
...

The source todo.xsd schema starts with:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://ns.eecoo.net/jaxfaces/samples/todo"
xmlns:tns="http://ns.eecoo.net/jaxfaces/samples/todo"
elementFormDefault="qualified" xmlns:jaxb="http://java.sun.com/xml/ns/
jaxb" jaxb:version="2.0" xmlns:jxfb="http://ns.eecoo.net/jaxb/plugin/
shale-bean" jaxb:extensionBindingPrefixes="jxfb">
        <annotation>
                <appinfo>
                        <jxfb:name>beanName</jxfb:name>
                        <jxfb:scope>session</jxfb:scope>
                </appinfo>
        </annotation>
        <element name="TodoItem">
                <complexType>
                        <sequence>
...


My pom.xml file looks as follows:
..
       <plugin>
         <groupId>com.sun.tools.xjc.maven2</groupId>
         <artifactId>maven-jaxb-plugin</artifactId>
         <configuration>
           <schemaDirectory>src/main/webapp/samples/todo/xml</
schemaDirectory>
           <generatePackage>net.eecoo.jaxfaces.example.todo</
generatePackage>
           <generateDirectory>src/main/java</generateDirectory>
           <includeSchemas>
             <includeSchema>todo.xsd</includeSchema>
           </includeSchemas>
           <includeBindings>
             <includeBinding>*.xjb</includeBinding>
           </includeBindings>
           <strict>false</strict>
           <extension>true</extension>
           <verbose>true</verbose>
           <args>-XShaleBean</args>
         </configuration>
       </plugin>
..

I think the maven-jaxb-plugin does not find the plugin jar in the
classpath?
Thus, I tried it with the following snippet in the <build> section to
add the jar file to maven's classpath... but that didn't work:

     <extensions>
       <extension>
         <groupId>net.eecoo.jaxfaces.jaxb</groupId>
               <artifactId>shale-bean-plugin</artifactId>
        <version>0.1</version>
       </extension>
     </extensions>

Any hints on what I'm doing wrong? How to get jar files in the maven-
jaxb-plugins classpath (any examples?)?
I could post some snippets of the plugin-source code as well if
required?

Thanks very much for any answers.

Best regards,
-Vivian