force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Gerhards, Matthias

H al,

can I convince jaxb2-maven-plugin on java 6 to use any other jaxb version than 2.1 e.g. using the endorsed strategy? In my case I would like to replace jaxb 2.1 by a forked version called jaxb-facets that includes extended features for schema generation with schemagen. I’ve tried to manage that stuff now for two days and forehead is sour from all the head banging ;-)

 

Regards

Matthias Gerhards

Externer Mitarbeiter
GKV-Spitzenverband
Deutsche Verbindungsstelle
Krankenversicherung - Ausland (DVKA)
Postfach 20 04 64

D-53134 Bonn

Telefon +49 228 9530 -661
Telefax  +49 228 9530-9
E-Mail     matthias.gerhards[hidden email]
Internet   www.dvka.de

 

Reply | Threaded
Open this post in threaded view
|

Re: force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Anders Hammar
You could possibly do this by overriding the deps for the plugin. Se example here:

For this example to work you need to use the same groupId and artifactId as the orifinal deps. Only change version. IIRC you cannot exclude any existing deps.

/Anders


On Wed, Sep 18, 2013 at 10:10 AM, Gerhards, Matthias <[hidden email]> wrote:

H al,

can I convince jaxb2-maven-plugin on java 6 to use any other jaxb version than 2.1 e.g. using the endorsed strategy? In my case I would like to replace jaxb 2.1 by a forked version called jaxb-facets that includes extended features for schema generation with schemagen. I’ve tried to manage that stuff now for two days and forehead is sour from all the head banging ;-)

 

Regards

Matthias Gerhards

Externer Mitarbeiter
GKV-Spitzenverband
Deutsche Verbindungsstelle
Krankenversicherung - Ausland (DVKA)
Postfach 20 04 64

D-53134 Bonn

Telefon <a href="tel:%2B49%20228%209530%20-661" value="+492289530661" target="_blank">+49 228 9530 -661
Telefax  <a href="tel:%2B49%20228%209530-9" value="+4922895309" target="_blank">+49 228 9530-9
E-Mail     matthias.gerhards[hidden email]
Internet   www.dvka.de

 


Reply | Threaded
Open this post in threaded view
|

AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Gerhards, Matthias

 

Hi Anders,

thanks for the good answer on the jaxb upgrade problem. The solution in http://jira.codehaus.org/browse/MJAXB-61 works fine for the version upgrade to 2.x.x. I’ve tested that, to be sure, that every thing is running. But in my extended case (using jaxb-facets from https://github.com/whummer/jaxb-facets) there’s still a maven problem.

 

My pom now looks like this:

 

<plugin>

<groupId>org.codehaus.mojo</groupId>

            <artifactId>jaxb2-maven-plugin</artifactId>

            <version>1.5</version>

            <dependencies>

                  <dependency>

                        <groupId>com.sun.xml.bind</groupId>

                        <artifactId>jaxb-xjc</artifactId>

                        <version>2.2.6</version>

                  </dependency>

                  <dependency>

                        <groupId>com.sun.xml.bind</groupId>

                        <artifactId>jaxb-impl</artifactId>

                        <version>2.2.6-facets-1.0.9</version>                           

                  </dependency>

            </dependencies>

            <executions>

                  <execution>

 

Note that „<version>2.2.6-facets-1.0.9</version>“ is the forked implementation of jaxb facets. Should be api compatible to jaxb-impl 2.2.6.

 

 

Using this, I am getting the following error:

--------------------------------------------------------

[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen (default) on project model: Execution default of goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen failed: Plugin org.codehaus.mojo:jaxb2-maven-plugin:1.5 or one of its dependencies could not be resolved: Failure to find com.sun.xml.bind:jaxb-impl:jar:2.2.6-facets-1.0.9 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen (default) on project model: Execution default of goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen failed: Plugin org.codehaus.mojo:jaxb2-maven-plugin:1.5 or one of its dependencies could not be resolved: Failure to find com.sun.xml.bind:jaxb-impl:jar:2.2.6-facets-1.0.9 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced 

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

…..

 

I know, that does not seem to be a problem of the plugin, but a maven problem. But the jars are present in local repository and there should be no reason to fetch them from the remote repository anyhow. By the way: proxy settings are fine. Any idea?

 

 

Kind regards

 

Matthias Gerhards

 

 


Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Anders Hammar
Gesendet: Mittwoch, 18. September 2013 12:14
An: Mojo Users List
Betreff: Re: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

 

You could possibly do this by overriding the deps for the plugin. Se example here:

 

For this example to work you need to use the same groupId and artifactId as the orifinal deps. Only change version. IIRC you cannot exclude any existing deps.

 

/Anders

 

On Wed, Sep 18, 2013 at 10:10 AM, Gerhards, Matthias <[hidden email]> wrote:

H al,

can I convince jaxb2-maven-plugin on java 6 to use any other jaxb version than 2.1 e.g. using the endorsed strategy? In my case I would like to replace jaxb 2.1 by a forked version called jaxb-facets that includes extended features for schema generation with schemagen. I’ve tried to manage that stuff now for two days and forehead is sour from all the head banging ;-)

 

Regards

Matthias Gerhards

Externer Mitarbeiter
GKV-Spitzenverband
Deutsche Verbindungsstelle
Krankenversicherung - Ausland (DVKA)
Postfach 20 04 64

D-53134 Bonn

Telefon <a href="tel:%2B49%20228%209530%20-661" target="_blank" value="+492289530661">+49 228 9530 -661
Telefax  <a href="tel:%2B49%20228%209530-9" target="_blank" value="+4922895309">+49 228 9530-9
E-Mail     matthias.gerhards[hidden email]
Internet   www.dvka.de

 

 

Reply | Threaded
Open this post in threaded view
|

Re: force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Anders Hammar
How did you add the artifact to your local repo and what version of Maven are you using?

/Anders


On Wed, Sep 18, 2013 at 2:55 PM, Gerhards, Matthias <[hidden email]> wrote:

 

Hi Anders,

thanks for the good answer on the jaxb upgrade problem. The solution in http://jira.codehaus.org/browse/MJAXB-61 works fine for the version upgrade to 2.x.x. I’ve tested that, to be sure, that every thing is running. But in my extended case (using jaxb-facets from https://github.com/whummer/jaxb-facets) there’s still a maven problem.

 

My pom now looks like this:

 

<plugin>

<groupId>org.codehaus.mojo</groupId>

            <artifactId>jaxb2-maven-plugin</artifactId>

            <version>1.5</version>

            <dependencies>

                  <dependency>

                        <groupId>com.sun.xml.bind</groupId>

                        <artifactId>jaxb-xjc</artifactId>

                        <version>2.2.6</version>

                  </dependency>

                  <dependency>

                        <groupId>com.sun.xml.bind</groupId>

                        <artifactId>jaxb-impl</artifactId>

                        <version>2.2.6-facets-1.0.9</version>                           

                  </dependency>

            </dependencies>

            <executions>

                  <execution>

 

Note that „<version>2.2.6-facets-1.0.9</version>“ is the forked implementation of jaxb facets. Should be api compatible to jaxb-impl 2.2.6.

 

 

Using this, I am getting the following error:

--------------------------------------------------------

[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen (default) on project model: Execution default of goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen failed: Plugin org.codehaus.mojo:jaxb2-maven-plugin:1.5 or one of its dependencies could not be resolved: Failure to find com.sun.xml.bind:jaxb-impl:jar:2.2.6-facets-1.0.9 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen (default) on project model: Execution default of goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen failed: Plugin org.codehaus.mojo:jaxb2-maven-plugin:1.5 or one of its dependencies could not be resolved: Failure to find com.sun.xml.bind:jaxb-impl:jar:2.2.6-facets-1.0.9 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced 

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

…..

 

I know, that does not seem to be a problem of the plugin, but a maven problem. But the jars are present in local repository and there should be no reason to fetch them from the remote repository anyhow. By the way: proxy settings are fine. Any idea?

 

 

Kind regards

 

Matthias Gerhards

 

 


Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Anders Hammar
Gesendet: Mittwoch, 18. September 2013 12:14
An: Mojo Users List
Betreff: Re: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

 

You could possibly do this by overriding the deps for the plugin. Se example here:

 

For this example to work you need to use the same groupId and artifactId as the orifinal deps. Only change version. IIRC you cannot exclude any existing deps.

 

/Anders

 

On Wed, Sep 18, 2013 at 10:10 AM, Gerhards, Matthias <[hidden email]> wrote:

H al,

can I convince jaxb2-maven-plugin on java 6 to use any other jaxb version than 2.1 e.g. using the endorsed strategy? In my case I would like to replace jaxb 2.1 by a forked version called jaxb-facets that includes extended features for schema generation with schemagen. I’ve tried to manage that stuff now for two days and forehead is sour from all the head banging ;-)

 

Regards

Matthias Gerhards

Externer Mitarbeiter
GKV-Spitzenverband
Deutsche Verbindungsstelle
Krankenversicherung - Ausland (DVKA)
Postfach 20 04 64

D-53134 Bonn

Telefon <a href="tel:%2B49%20228%209530%20-661" value="+492289530661" target="_blank">+49 228 9530 -661
Telefax  <a href="tel:%2B49%20228%209530-9" value="+4922895309" target="_blank">+49 228 9530-9
E-Mail     matthias.gerhards[hidden email]
Internet   www.dvka.de

 

 


Reply | Threaded
Open this post in threaded view
|

AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Gerhards, Matthias

Hi Anders,

I am using maven 3.0.5 on Windows with the m2e plugin under eclipse for dependency management. Everything else is performed from a command line.

 

The artifacts are coming from the global dependencies and a remote repository setting. As far as I know, there is no possibility to use a remote repository in the plugins dependency settings. My full pom looks like this:

 

<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>

    <groupId>avaro</groupId>

    <artifactId>avaro</artifactId>

    <version>0.0.1</version>

  </parent>

  <artifactId>model</artifactId>

  <name>model</name>

  <description>The model classes of the avaro project</description>

 

      <properties>

            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

            <maven.compiler.target>1.6</maven.compiler.target>

            <maven.compiler.source>1.6</maven.compiler.source>

      </properties>

 

      <repositories>

            <repository>

            <id>github-repo-releases</id>

            <url>https://raw.github.com/whummer/mvn/master/releases</url>

        </repository>

      </repositories>

 

 

      <dependencies>

           <!-- 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-impl</artifactId>

              <version>2.2.6-facets-1.0.9</version>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-lang3</artifactId>

                  <version>3.0</version>

            </dependency>

            <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>4.8.1</version>

            <scope>test</scope>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-io</artifactId>

            <version>1.3.2</version>

            </dependency>

            <dependency>

                  <groupId>xerces</groupId>

                  <artifactId>xercesImpl</artifactId>

                  <version>2.11.0</version>

            </dependency>

      </dependencies>

   

      <build>

            <plugins>

                  <plugin>

                  <groupId>org.codehaus.mojo</groupId>

                  <artifactId>jaxb2-maven-plugin</artifactId>

                  <version>1.5</version>

                  <dependencies>

                        <dependency>

                                   <groupId>com.sun.xml.bind</groupId>

                                   <artifactId>jaxb-xjc</artifactId>

                                   <version>2.2.6</version>

                        </dependency>

                        <dependency>

                              <groupId>com.sun.xml.bind</groupId>

                              <artifactId>jaxb-impl</artifactId>

                              <version>2.2.6-facets-1.0.9</version>                           

                             </dependency>

                        </dependencies>

                  <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>

                              <transformSchemas>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/basics</uri>

                                        <toFile>Basics.xsd</toFile>

                                    </transformSchema>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/allgemeineAngaben</uri>

                                        <toFile>AllgemeineAngaben.xsd</toFile>

                                    </transformSchema>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/antragsteller</uri>

                                        <toFile>Antragsteller.xsd</toFile>

                                    </transformSchema>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/erwerbstaetigkeiten</uri>

                                        <toFile>Erwerbstaetigkeiten.xsd</toFile>

                                    </transformSchema>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/erwerbstaetigkeitenVergangenheit</uri>

                                        <toFile>ErwerbstaetigkeitenVergangenheit.xsd</toFile>

                                    </transformSchema>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/sozialversicherungen</uri>

                                        <toFile>Sozialversicherungen.xsd</toFile>

                                    </transformSchema>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/schriftwechsel</uri>

                                        <toFile>Schriftwechsel.xsd</toFile>

                                    </transformSchema>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/erklaerungen</uri>

                                        <toFile>Erklaerungen.xsd</toFile>

                                    </transformSchema>

                              </transformSchemas>

                              </configuration>

                        </execution>

                  </executions>

                  </plugin>

                  <plugin>

                        <groupId>org.apache.maven.plugins</groupId>

                        <artifactId>maven-dependency-plugin</artifactId>

                        <configuration>

                              <outputDirectory>${project.build.directory}/endorsed</outputDirectory>

                        </configuration>

                        <executions>

                             <execution>

                                   <id>copy-endorsed</id>

                                   <phase>generate-resources</phase>

                                         <goals>

                                               <goal>copy</goal>

                                         </goals>

                                         <configuration>

                                               <artifactItems>

                                                     <artifactItem>

                                                           <groupId>javax.xml.bind</groupId>

                                                           <artifactId>jaxb-api</artifactId>

                                                           <version>2.2.7-facets-1.0.3</version>

                                                           <overWrite>true</overWrite>

                                                           <destFileName>jaxb-api.jar</destFileName>

                                                     </artifactItem>

                                                     <artifactItem>

                                                           <groupId>com.sun.xml.bind</groupId>

                                                           <artifactId>jaxb-impl</artifactId>

                                                           <version>2.2.6-facets-1.0.9</version>

                                                           <overWrite>true</overWrite>

                                                           <destFileName>jaxb-impl.jar</destFileName>

                                                     </artifactItem>

                                               </artifactItems>

                                         </configuration>

                             </execution>

                        </executions>

                  </plugin>

                   <plugin>     

                        <groupId>org.apache.maven.plugins</groupId>

                        <artifactId>maven-compiler-plugin</artifactId>

                         <configuration>                       

                        <source>1.6</source>

                        <target>1.6</target>

                        <fork>true</fork>

                        <compilerArguments>

                             <endorseddirs>${endorsed.dir}</endorseddirs>

                        </compilerArguments>

                        </configuration>

                   </plugin>

            </plugins>

           

            <pluginManagement>

            <plugins>

                  <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->

                  <plugin>

                        <groupId>org.eclipse.m2e</groupId>

                        <artifactId>lifecycle-mapping</artifactId>

                        <version>1.0.0</version>

                        <configuration>

                             <lifecycleMappingMetadata>

                                   <pluginExecutions>

                                         <pluginExecution>

                                               <pluginExecutionFilter>

                                                     <groupId>

                                                           org.codehaus.mojo

                                                     </groupId>

                                                     <artifactId>

                                                           jaxb2-maven-plugin

                                                     </artifactId>

                                                     <versionRange>

                                                           1.5

                                                     </versionRange>

                                                     <goals>

                                                           <goal>

                                                                 schemagen

                                                           </goal>

                                                     </goals>

                                               </pluginExecutionFilter>

                                               <action>

                                                     <ignore></ignore>

                                               </action>

                                         </pluginExecution>

                                         <pluginExecution>

                                               <pluginExecutionFilter>

                                                     <groupId>

                                                           org.apache.maven.plugins

                                                     </groupId>

                                                     <artifactId>

                                                           maven-dependency-plugin

                                                     </artifactId>

                                                     <versionRange>

                                                           1.5

                                                     </versionRange>

                                                     <goals>

                                                           <goal>

                                                                 copy

                                                           </goal>

                                                     </goals>

                                               </pluginExecutionFilter>

                                               <action>

                                                     <ignore></ignore>

                                               </action>

                                         </pluginExecution>

                                   </pluginExecutions>

                             </lifecycleMappingMetadata>

                        </configuration>

                  </plugin>

            </plugins>

      </pluginManagement>

      </build>

</project>

 

 

Viele Grüße

Matthias Gerhards

Externer Mitarbeiter
GKV-Spitzenverband
Deutsche Verbindungsstelle
Krankenversicherung - Ausland (DVKA)
Postfach 20 04 64

D-53134 Bonn

Telefon +49 228 9530 -661
Telefax  +49 228 9530-9
E-Mail     matthias.gerhards[hidden email]
Internet   www.dvka.de

 


Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Anders Hammar
Gesendet: Mittwoch, 18. September 2013 15:14
An: Mojo Users List
Betreff: Re: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

 

How did you add the artifact to your local repo and what version of Maven are you using?

 

/Anders

 

On Wed, Sep 18, 2013 at 2:55 PM, Gerhards, Matthias <[hidden email]> wrote:

 

Hi Anders,

thanks for the good answer on the jaxb upgrade problem. The solution in http://jira.codehaus.org/browse/MJAXB-61 works fine for the version upgrade to 2.x.x. I’ve tested that, to be sure, that every thing is running. But in my extended case (using jaxb-facets from https://github.com/whummer/jaxb-facets) there’s still a maven problem.

 

My pom now looks like this:

 

<plugin>

<groupId>org.codehaus.mojo</groupId>

            <artifactId>jaxb2-maven-plugin</artifactId>

            <version>1.5</version>

            <dependencies>

                  <dependency>

                        <groupId>com.sun.xml.bind</groupId>

                        <artifactId>jaxb-xjc</artifactId>

                        <version>2.2.6</version>

                  </dependency>

                  <dependency>

                        <groupId>com.sun.xml.bind</groupId>

                        <artifactId>jaxb-impl</artifactId>

                        <version>2.2.6-facets-1.0.9</version>                           

                  </dependency>

            </dependencies>

            <executions>

                  <execution>

 

Note that „<version>2.2.6-facets-1.0.9</version>“ is the forked implementation of jaxb facets. Should be api compatible to jaxb-impl 2.2.6.

 

 

Using this, I am getting the following error:

--------------------------------------------------------

[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen (default) on project model: Execution default of goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen failed: Plugin org.codehaus.mojo:jaxb2-maven-plugin:1.5 or one of its dependencies could not be resolved: Failure to find com.sun.xml.bind:jaxb-impl:jar:2.2.6-facets-1.0.9 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen (default) on project model: Execution default of goal org.codehaus.mojo:jaxb2-maven-plugin:1.5:schemagen failed: Plugin org.codehaus.mojo:jaxb2-maven-plugin:1.5 or one of its dependencies could not be resolved: Failure to find com.sun.xml.bind:jaxb-impl:jar:2.2.6-facets-1.0.9 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced 

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

…..

 

I know, that does not seem to be a problem of the plugin, but a maven problem. But the jars are present in local repository and there should be no reason to fetch them from the remote repository anyhow. By the way: proxy settings are fine. Any idea?

 

 

Kind regards

 

Matthias Gerhards

 

 


Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Anders Hammar
Gesendet: Mittwoch, 18. September 2013 12:14
An: Mojo Users List
Betreff: Re: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

 

You could possibly do this by overriding the deps for the plugin. Se example here:

 

For this example to work you need to use the same groupId and artifactId as the orifinal deps. Only change version. IIRC you cannot exclude any existing deps.

 

/Anders

 

On Wed, Sep 18, 2013 at 10:10 AM, Gerhards, Matthias <[hidden email]> wrote:

H al,

can I convince jaxb2-maven-plugin on java 6 to use any other jaxb version than 2.1 e.g. using the endorsed strategy? In my case I would like to replace jaxb 2.1 by a forked version called jaxb-facets that includes extended features for schema generation with schemagen. I’ve tried to manage that stuff now for two days and forehead is sour from all the head banging ;-)

 

Regards

Matthias Gerhards

Externer Mitarbeiter
GKV-Spitzenverband
Deutsche Verbindungsstelle
Krankenversicherung - Ausland (DVKA)
Postfach 20 04 64

D-53134 Bonn

Telefon <a href="tel:%2B49%20228%209530%20-661" target="_blank" value="+492289530661">+49 228 9530 -661
Telefax  <a href="tel:%2B49%20228%209530-9" target="_blank" value="+4922895309">+49 228 9530-9
E-Mail     matthias.gerhards[hidden email]
Internet   www.dvka.de

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Anders Hammar

Exactly how did you get the facets jaxb jar into the local repo? Did you do mvn install:install (or possibly install:install-file) or did you just copy it there?

/Anders (mobile)

Den 18 sep 2013 16:02 skrev "Gerhards, Matthias" <[hidden email]>:

Hi Anders,

I am using maven 3.0.5 on Windows with the m2e plugin under eclipse for dependency management. Everything else is performed from a command line.

 

The artifacts are coming from the global dependencies and a remote repository setting. As far as I know, there is no possibility to use a remote repository in the plugins dependency settings. My full pom looks like this:

 

<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>

    <groupId>avaro</groupId>

    <artifactId>avaro</artifactId>

    <version>0.0.1</version>

  </parent>

  <artifactId>model</artifactId>

  <name>model</name>

  <description>The model classes of the avaro project</description>

 

      <properties>

            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

            <maven.compiler.target>1.6</maven.compiler.target>

            <maven.compiler.source>1.6</maven.compiler.source>

      </properties>

 

      <repositories>

            <repository>

            <id>github-repo-releases</id>

            <url>https://raw.github.com/whummer/mvn/master/releases</url>

        </repository>

      </repositories>

 

 

      <dependencies>

           <!-- 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-impl</artifactId>

              <version>2.2.6-facets-1.0.9</version>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-lang3</artifactId>

                  <version>3.0</version>

            </dependency>

            <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>4.8.1</version>

            <scope>test</scope>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-io</artifactId>

            <version>1.3.2</version>

            </dependency>

            <dependency>

                  <groupId>xerces</groupId>

                  <artifactId>xercesImpl</artifactId>

                  <version>2.11.0</version>

            </dependency>

      </dependencies>

   

      <build>

            <plugins>

                  <plugin>

                  <groupId>org.codehaus.mojo</groupId>

                  <artifactId>jaxb2-maven-plugin</artifactId>

                  <version>1.5</version>

                  <dependencies>

                        <dependency>

                                   <groupId>com.sun.xml.bind</groupId>

                                   <artifactId>jaxb-xjc</artifactId>

                                   <version>2.2.6</version>

                        </dependency>

                        <dependency>

                              <groupId>com.sun.xml.bind</groupId>

                              <artifactId>jaxb-impl</artifactId>

                              <version>2.2.6-facets-1.0.9</version>                           

                             </dependency>

                        </dependencies>

                  <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>

                              <transformSchemas>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/basics</uri>

                                        <toFile>Basics.xsd</toFile>

                                   

...
Reply | Threaded
Open this post in threaded view
|

Re: force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Wayne Fay
In reply to this post by Gerhards, Matthias
> not be resolved: Failure to find
> com.sun.xml.bind:jaxb-impl:jar:2.2.6-facets-1.0.9 in
> http://repo.maven.apache.org/maven2 was cached in the local repository,
> resolution will not be reattempted until the update interval of central has
> elapsed or updates are forced

Looks like https://jira.codehaus.org/browse/MNG-5181   to me.

Wayne

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

AW: AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Gerhards, Matthias
In reply to this post by Anders Hammar

Hi Anders,

the jaxb jar has been downloaded by the eclipse m2e plugin in the IDE. But I realized that even „mvn install“ fails on the command line. I’am still in the setup phase of my project and tested the schemagen and jaxb-facets cooperation. But my problem is maybe only one of the fu*** maven eclipse m2e issues. Before I waist your time any more, I better try to get that stuff fixed. Thanks for you support so far.

 

Regards Matthias

 

 

 

  

 

 


Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Anders Hammar
Gesendet: Mittwoch, 18. September 2013 16:09
An: Mojo Users List
Betreff: Re: AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

 

Exactly how did you get the facets jaxb jar into the local repo? Did you do mvn install:install (or possibly install:install-file) or did you just copy it there?

/Anders (mobile)

Den 18 sep 2013 16:02 skrev "Gerhards, Matthias" <[hidden email]>:

Hi Anders,

I am using maven 3.0.5 on Windows with the m2e plugin under eclipse for dependency management. Everything else is performed from a command line.

 

The artifacts are coming from the global dependencies and a remote repository setting. As far as I know, there is no possibility to use a remote repository in the plugins dependency settings. My full pom looks like this:

 

<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>

    <groupId>avaro</groupId>

    <artifactId>avaro</artifactId>

    <version>0.0.1</version>

  </parent>

  <artifactId>model</artifactId>

  <name>model</name>

  <description>The model classes of the avaro project</description>

 

      <properties>

            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

            <maven.compiler.target>1.6</maven.compiler.target>

            <maven.compiler.source>1.6</maven.compiler.source>

      </properties>

 

      <repositories>

            <repository>

            <id>github-repo-releases</id>

            <url>https://raw.github.com/whummer/mvn/master/releases</url>

        </repository>

      </repositories>

 

 

      <dependencies>

           <!-- 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-impl</artifactId>

              <version>2.2.6-facets-1.0.9</version>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-lang3</artifactId>

                  <version>3.0</version>

            </dependency>

            <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>4.8.1</version>

            <scope>test</scope>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-io</artifactId>

            <version>1.3.2</version>

            </dependency>

            <dependency>

                  <groupId>xerces</groupId>

                  <artifactId>xercesImpl</artifactId>

                  <version>2.11.0</version>

            </dependency>

      </dependencies>

   

      <build>

            <plugins>

                  <plugin>

                  <groupId>org.codehaus.mojo</groupId>

                  <artifactId>jaxb2-maven-plugin</artifactId>

                  <version>1.5</version>

                  <dependencies>

                        <dependency>

                                   <groupId>com.sun.xml.bind</groupId>

                                   <artifactId>jaxb-xjc</artifactId>

                                   <version>2.2.6</version>

                        </dependency>

                        <dependency>

                              <groupId>com.sun.xml.bind</groupId>

                              <artifactId>jaxb-impl</artifactId>

                              <version>2.2.6-facets-1.0.9</version>                           

                             </dependency>

                        </dependencies>

                  <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>

                              <transformSchemas>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/basics</uri>

                                        <toFile>Basics.xsd</toFile>

                                   

...

Reply | Threaded
Open this post in threaded view
|

Re: AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Anders Hammar
Please see Wayne's response. Most likely the problem. What you need to do is to get yourself a repo manager and add the patched artifact to it instead of directly to your local repo.

/Anders


On Wed, Sep 18, 2013 at 4:57 PM, Gerhards, Matthias <[hidden email]> wrote:

Hi Anders,

the jaxb jar has been downloaded by the eclipse m2e plugin in the IDE. But I realized that even „mvn install“ fails on the command line. I’am still in the setup phase of my project and tested the schemagen and jaxb-facets cooperation. But my problem is maybe only one of the fu*** maven eclipse m2e issues. Before I waist your time any more, I better try to get that stuff fixed. Thanks for you support so far.

 

Regards Matthias

 

 

 

  

 

 


Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Anders Hammar
Gesendet: Mittwoch, 18. September 2013 16:09
An: Mojo Users List
Betreff: Re: AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

 

Exactly how did you get the facets jaxb jar into the local repo? Did you do mvn install:install (or possibly install:install-file) or did you just copy it there?

/Anders (mobile)

Den 18 sep 2013 16:02 skrev "Gerhards, Matthias" <[hidden email]>:

Hi Anders,

I am using maven 3.0.5 on Windows with the m2e plugin under eclipse for dependency management. Everything else is performed from a command line.

 

The artifacts are coming from the global dependencies and a remote repository setting. As far as I know, there is no possibility to use a remote repository in the plugins dependency settings. My full pom looks like this:

 

<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>

    <groupId>avaro</groupId>

    <artifactId>avaro</artifactId>

    <version>0.0.1</version>

  </parent>

  <artifactId>model</artifactId>

  <name>model</name>

  <description>The model classes of the avaro project</description>

 

      <properties>

            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

            <maven.compiler.target>1.6</maven.compiler.target>

            <maven.compiler.source>1.6</maven.compiler.source>

      </properties>

 

      <repositories>

            <repository>

            <id>github-repo-releases</id>

            <url>https://raw.github.com/whummer/mvn/master/releases</url>

        </repository>

      </repositories>

 

 

      <dependencies>

           <!-- 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-impl</artifactId>

              <version>2.2.6-facets-1.0.9</version>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-lang3</artifactId>

                  <version>3.0</version>

            </dependency>

            <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>4.8.1</version>

            <scope>test</scope>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-io</artifactId>

            <version>1.3.2</version>

            </dependency>

            <dependency>

                  <groupId>xerces</groupId>

                  <artifactId>xercesImpl</artifactId>

                  <version>2.11.0</version>

            </dependency>

      </dependencies>

   

      <build>

            <plugins>

                  <plugin>

                  <groupId>org.codehaus.mojo</groupId>

                  <artifactId>jaxb2-maven-plugin</artifactId>

                  <version>1.5</version>

                  <dependencies>

                        <dependency>

                                   <groupId>com.sun.xml.bind</groupId>

                                   <artifactId>jaxb-xjc</artifactId>

                                   <version>2.2.6</version>

                        </dependency>

                        <dependency>

                              <groupId>com.sun.xml.bind</groupId>

                              <artifactId>jaxb-impl</artifactId>

                              <version>2.2.6-facets-1.0.9</version>                           

                             </dependency>

                        </dependencies>

                  <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>

                              <transformSchemas>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/basics</uri>

                                        <toFile>Basics.xsd</toFile>

                                   

...


Reply | Threaded
Open this post in threaded view
|

AW: AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

Gerhards, Matthias

Hi Andrs,

yes, I fixed my maven m2e eclipse problems now and the old problem persists. So I guess it is the maven 3 issue Wayne described. I will try it with a repository manager. The interesting fact is, that the repository is accessible without any problem. But in the plugin configuration there is no way to define a remote repo. But any how, I guess a repo manager will fix the issue. Thanks a lot for your help.

 

Regards Matthias

 


Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Anders Hammar
Gesendet: Mittwoch, 18. September 2013 21:43
An: Mojo Users List
Betreff: Re: AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

 

Please see Wayne's response. Most likely the problem. What you need to do is to get yourself a repo manager and add the patched artifact to it instead of directly to your local repo.

/Anders

 

On Wed, Sep 18, 2013 at 4:57 PM, Gerhards, Matthias <[hidden email]> wrote:

Hi Anders,

the jaxb jar has been downloaded by the eclipse m2e plugin in the IDE. But I realized that even „mvn install“ fails on the command line. I’am still in the setup phase of my project and tested the schemagen and jaxb-facets cooperation. But my problem is maybe only one of the fu*** maven eclipse m2e issues. Before I waist your time any more, I better try to get that stuff fixed. Thanks for you support so far.

 

Regards Matthias

 

 

 

  

 

 


Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Anders Hammar
Gesendet: Mittwoch, 18. September 2013 16:09
An: Mojo Users List
Betreff: Re: AW: [mojo-user] force jaxb2-maven-plugin schemagen to use any other jaxb version than 2.1?

 

Exactly how did you get the facets jaxb jar into the local repo? Did you do mvn install:install (or possibly install:install-file) or did you just copy it there?

/Anders (mobile)

Den 18 sep 2013 16:02 skrev "Gerhards, Matthias" <[hidden email]>:

Hi Anders,

I am using maven 3.0.5 on Windows with the m2e plugin under eclipse for dependency management. Everything else is performed from a command line.

 

The artifacts are coming from the global dependencies and a remote repository setting. As far as I know, there is no possibility to use a remote repository in the plugins dependency settings. My full pom looks like this:

 

<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>

    <groupId>avaro</groupId>

    <artifactId>avaro</artifactId>

    <version>0.0.1</version>

  </parent>

  <artifactId>model</artifactId>

  <name>model</name>

  <description>The model classes of the avaro project</description>

 

      <properties>

            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

            <maven.compiler.target>1.6</maven.compiler.target>

            <maven.compiler.source>1.6</maven.compiler.source>

      </properties>

 

      <repositories>

            <repository>

            <id>github-repo-releases</id>

            <url>https://raw.github.com/whummer/mvn/master/releases</url>

        </repository>

      </repositories>

 

 

      <dependencies>

           <!-- 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-impl</artifactId>

              <version>2.2.6-facets-1.0.9</version>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-lang3</artifactId>

                  <version>3.0</version>

            </dependency>

            <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>4.8.1</version>

            <scope>test</scope>

          </dependency>

          <dependency>

                  <groupId>org.apache.commons</groupId>

                  <artifactId>commons-io</artifactId>

            <version>1.3.2</version>

            </dependency>

            <dependency>

                  <groupId>xerces</groupId>

                  <artifactId>xercesImpl</artifactId>

                  <version>2.11.0</version>

            </dependency>

      </dependencies>

   

      <build>

            <plugins>

                  <plugin>

                  <groupId>org.codehaus.mojo</groupId>

                  <artifactId>jaxb2-maven-plugin</artifactId>

                  <version>1.5</version>

                  <dependencies>

                        <dependency>

                                   <groupId>com.sun.xml.bind</groupId>

                                   <artifactId>jaxb-xjc</artifactId>

                                   <version>2.2.6</version>

                        </dependency>

                        <dependency>

                              <groupId>com.sun.xml.bind</groupId>

                              <artifactId>jaxb-impl</artifactId>

                              <version>2.2.6-facets-1.0.9</version>                           

                             </dependency>

                        </dependencies>

                  <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>

                              <transformSchemas>

                                    <transformSchema>

                                        <uri>http://www.dvka.de/avaro/basics</uri>

                                        <toFile>Basics.xsd</toFile>

                                   

...