3

I am generating code with . Current version (3.2.4) uses JAXB/XJC version 2.2.11.

How do I upgrade used JAXB/XJC to a later version, for instance 2.3.0?

Here's what I've tried so far:

        <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-codegen-plugin</artifactId>
            <version>3.2.4</version>
            <executions>
                <execution>
                    <id>generate-sources</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>wsdl2java</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <wsdlOptions>
                    <wsdlOption>
                        <wsdl>${project.basedir}/src/main/resources/main.wsdl</wsdl>
                        <bindingFiles>
                            <bindingFile>${project.basedir}/src/main/resources/bindings.xjb</bindingFile>
                            <bindingFile>${project.basedir}/src/main/resources/wsdl-bindings.xjb</bindingFile>
                        </bindingFiles>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                    <version>2.3.0</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                    <version>2.3.0</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-core</artifactId>
                    <version>2.3.0</version>
                </dependency>
            </dependencies>
        </plugin>

However I still get see the following warnings:

[WARNING] The POM for com.sun.xml.bind:jaxb-xjc:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.sun.xml.bind:jaxb-core:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

So I'm not really sure the version 2.3.0 gets picked up.

lexicore
  • 42,748
  • 17
  • 132
  • 221
  • From what you showed us, the version `2.3.0` is probably picked up. Though it seems that the `jaxb` dependencies have transitive dependencies pointing to `2.2.11`. What you can do is run the `mvn dependency:tree` command to see exactly where you see the version `2.2.11` appear, and try and exclude them – DamCx Jun 04 '18 at 08:23
  • @DamCx No, there are no transitive dependencies from `2.3.0` to `2.2.11`. – lexicore Jun 04 '18 at 08:29
  • What about the `mvn dependency:tree` command? – DamCx Jun 04 '18 at 08:30
  • @DamCx I ran it, this is how I know there are no transitive dependencies from `2.3.0` to `2.2.11`. However `mvn dependency:tree` only shows me dependencies of the given project, not of some used Maven plugin. I've check dependencies of `com.sun.xml.bin:jaxb-*` by adding these directly as dependencies of the project. Not sure how I can check the effective dependencies of the `cxf-codegen-plugin`. – lexicore Jun 04 '18 at 08:34
  • Use this command for the plugins: `mvn dependency:resolve-plugins`. It might be a bit long, but should do the job. – DamCx Jun 04 '18 at 08:36
  • @DamCx Thank you! Here is [the result of `mvn dependency:resolve-plugins`](https://pastebin.com/SqquD7KX). Still not quite enlightening, I don't see `jaxb-xjc` and `jaxb-core` artifacts there. – lexicore Jun 04 '18 at 08:45
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/172383/discussion-between-damcx-and-lexicore). – DamCx Jun 04 '18 at 08:48

0 Answers0