Skip to content

Instantly share code, notes, and snippets.

@fujohnwang
Created October 22, 2014 07:38
Show Gist options
  • Save fujohnwang/4acd9183350767d06438 to your computer and use it in GitHub Desktop.
Save fujohnwang/4acd9183350767d06438 to your computer and use it in GitHub Desktop.
lombok maven config
<properties>
<compiler.version>1.6</compiler.version>
<java_source_version>1.6</java_source_version>
<java_target_version>1.6</java_target_version>
<file_encoding>UTF-8</file_encoding>
</properties>
<build>
<finalName>test</finalName>
<plugins>
<!-- Java Compiler -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>${compiler.version}</compilerVersion>
<source>${java_source_version}</source>
<target>${java_target_version}</target>
<encoding>${file_encoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<charset>${file_encoding}</charset>
<encoding>${file_encoding}</encoding>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.14.8.0</version>
<configuration>
<encoding>${file_encoding}</encoding>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>lombok-needs-tools-jar</id>
<activation>
<file>
<!--only for win and linux, mac is not needed-->
<exists>${java.home}/../lib/tools.jar</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.14.8.0</version>
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.14.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
@fujohnwang
Copy link
Author

@DaTa
public class Lombok {
private String version = "1.4.18.0";
private String url = "http://projectlombok.org/";
private String mavenPlugin = "http://awhitford.github.io/lombok.maven/lombok-maven-plugin/index.html";
private String ideaPlugin = "https://code.google.com/p/lombok-intellij-plugin/";
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment