2

I'm trying to generate schema files from java classes with maven using the jaxb2-maven-plugin under java 6. Generally it works fine.

But additionally I'am using the jaxb-facets fork in order to support the full schema features. Generally jaxb-facets need to override the standard jaxb implementation in order to work. But this seems to be the problem. When using the jaxb2-maven-plugin, the plugin always downloads the original jaxb implementation. I tried using the endorsed strategy, but there seems to be no difference.

I'am banging my head for hours :-(((

This is the relevant part of my pom file:

  <!-- The jaxb-facets depedencies: Note that jaxb-facets should be at the top of all dependencies              (at least before any dependencies to JAXB libraries) -->         
   <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.2.7-facets-1.0.3</version>
    </dependency>

    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-xjc</artifactId>
        <version>2.2.6</version>
    </dependency> ...

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <version>1.5</version>
        <configuration>
         <argline>-Djava.endorsed.dirs="${project.build.directory}/endorsed"</argline>
        </configuration>
        <executions>
                 <execution>
                  <goals>
                        <goal>schemagen</goal>
                </goals>
                <phase>generate-resources</phase>
                <configuration>
                        <includes>
                           <include>de/dvka/avaro/model/schema/*.java</include>
                        </includes>
                         <outputDirectory>src/main/java/de/dvka/avaro/model/schema</outputDirectory>
                    </configuration>
                </execution>

        </executions>
    </plugin>

I skipped the endorsed part here, because it is to long

0 Answers0