You can obtain a distribution bundle containing the MapStruct binaries, source code and API documentation from SourceForge.
If you’re using Maven to build your project add the following to your pom.xml to use MapStruct:
...
<properties>
<org.mapstruct.version>1.1.0.Final</org.mapstruct.version>
</properties>
...
<dependencies>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId> <!-- use mapstruct-jdk8 for Java 8 or higher -->
<version>${org.mapstruct.version}</version>
</dependency>
</dependencies>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.6</source> <!-- or higher, depending on your project -->
<target>1.6</target> <!-- or higher, depending on your project -->
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
With Gradle, you add something along the following lines to your build.gradle:
plugins {
...
id 'net.ltgt.apt' version '0.8'
}
dependencies {
...
compile 'org.mapstruct:mapstruct:1.1.0.Final'
// OR use this with Java 8 and beyond
compile 'org.mapstruct:mapstruct-jdk8:1.1.0.Final'
apt 'org.mapstruct:mapstruct-processor:1.1.0.Final'
}
tbd.