Skip to content
Ryan Heaton edited this page Aug 23, 2016 · 3 revisions

Lombok Support

It is possible to integrate Enunciate with Project Lombok. This is done in two steps:

  1. Configure Lombok to Generate the Sources
  2. Configure Enunciate to Use the Generated Sources

You may also find the thread at #182 useful.

Maven Example

Configure Lombok to Generate the Sources

      <plugin>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok-maven-plugin</artifactId>
        <version>${lombok.version}</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>delombok</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <encoding>utf-8</encoding>
          <addOutputDirectory>false</addOutputDirectory>
          <sourceDirectory>src/main/java</sourceDirectory>
        </configuration>
      </plugin>

The Lombok plugin will put the generated sources in ${project.build.directory}/generated-sources/delombok.

Set the Enunciate Compiler Directory

      <plugin>
        <groupId>com.webcohesion.enunciate</groupId>
        <artifactId>enunciate-maven-plugin</artifactId>
        <version>${enunciate.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>assemble</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/delombok</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
Clone this wiki locally