1

I am trying to migrate my Java class generation from the former javax.* to jakarta.* I am using the Maven Plugin

<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>3.1.0</version>

setting the target to 3.0 and using the args

<arguments>
    <argument>-Xinject-code</argument>
    <argument>-Xannotate</argument>
</arguments>

In my xjb I have some annotate bindings (to add Lombok annotations to my classes).

<jxb:bindings version="3.0"
    xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    xmlns:annox="http://annox.dev.java.net"
    jxb:extensionBindingPrefixes="xjc annox">

I get the exception: "com.sun.tools.xjc.BadCommandLineException: unrecognized parameter -Xannotate"

I get, that annotate is a xjc plugin. Is there a new implementation of it, that i can add to the jaxb2-maven-plugin dependencies to make this work?

I already tried

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <version>3.1.0</version>
    ...
    <dependencies>
        <dependency>
            <groupId>org.patrodyne.jvnet</groupId>
            <artifactId>hisrc-hyperjaxb-annox-plugin</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
        </dependency>
    </dependencies>
</plugin>

Without success (still unrecognized parameter)

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Ismael
  • 11
  • 2

0 Answers0