0

我正在尝试lombok.Builder在我生成的类上添加注释:

我越来越:

org.xml.sax.SAXParseException: Error parsing annotation.
Caused by: org.jvnet.annox.parser.exception.AnnotationExpressionParseException: Could not parse the annotation expression [@lombok.Builder].
Caused by: org.jvnet.annox.annotation.AnnotationClassNotFoundException: Annotation class [lombok.Builder] could not be found.
Caused by: java.lang.ClassNotFoundException: lombok.Builder

这是我的插件配置:

<?xml version="1.0" encoding="UTF-8"?>
<plugin>
   <groupId>org.jvnet.jaxb2.maven2</groupId>
   <artifactId>maven-jaxb2-plugin</artifactId>
   <version>0.14.0</version>
   <executions>
      <execution>
         <goals>
            <goal>generate</goal>
         </goals>
         <configuration>
            <schemaLanguage>XMLSCHEMA</schemaLanguage>
            <generateDirectory>${project.basedir}/src/main/java</generateDirectory>
            <generatePackage>cat.catsalut.hes.mpi.hazelcast.loader.domain.st</generatePackage>
            <schemaDirectory>${basedir}/xsd/servei-territorial</schemaDirectory>
            <schemaIncludes>
               <include>st.xsd</include>
            </schemaIncludes>
            <episode>false</episode>
            <args>
               <arg>-npa</arg>
               <arg>-no-header</arg>
               <arg>-Xannotate</arg>
            </args>
            <plugins>
               <plugin>
                  <groupId>org.jvnet.jaxb2_commons</groupId>
                  <artifactId>jaxb2-basics-annotate</artifactId>
                  <version>1.1.0</version>
               </plugin>
            </plugins>
            <bindingDirectory>${project.basedir}/xsd/servei-territorial</bindingDirectory>
            <bindingIncludes>*.xml</bindingIncludes>
            <!-- <verbose>true</verbose> <debug>true</debug> -->
         </configuration>
      </execution>
   </executions>
</plugin>

我的 bindings.xml:

<jaxb:bindings 
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    
    jaxb:extensionBindingPrefixes="annox xjc"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" 
    xmlns:annox="http://annox.dev.java.net"
    
    version="2.1">
    
    <!-- xmlrootelement -->
    <jaxb:bindings schemaLocation="st.xsd">
        <jaxb:bindings node="//xs:complexType[@name='SearchRequestType']">
            <!-- <annox:annotate target="class">
                <annox:annotate annox:class="lombok.Builder"/>
            </annox:annotate> -->
            <annox:annotate>@lombok.Builder</annox:annotate>
        </jaxb:bindings>
        
    </jaxb:bindings>

</jaxb:bindings>

有任何想法吗?

4

0 回答 0