Skip to content
 
 

Latest commit

 

History

64 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protobuf accessor naming strategy CircleCI

This naming strategy helps mapstruct generate working mapping code between your domain classes and protobuf classes. Both fullblown Java protobuf and protolite classes suported.

Manual mapping needed for

  • map<k,v>
  • oneof

Usage

Maven

Add the following section to you maven-compiler-plugin plugin configuration:

<annotationProcessorPaths>
	<path>
		<groupId>no.entur.mapstruct.spi</groupId>
		<artifactId>protobuf-spi-impl</artifactId>
		<version>1.0.0-SNAPSHOT</version>
	</path>
</annotationProcessorPaths>
<dependencies>
    <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct</artifactId>
        <version>${org.mapstruct.version}</version>
    </dependency>
</dependencies>

Complete example:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>

	<configuration>
		<source>1.8</source> 
		<target>1.8</target> 
		<annotationProcessorPaths>
			<path>
        		<groupId>no.entur.mapstruct.spi</groupId>
		        <artifactId>protobuf-spi-impl</artifactId>
		        <version>1.0.0-SNAPSHOT</version>
			</path>
		</annotationProcessorPaths>
	</configuration>
    <dependencies>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${org.mapstruct.version}</version>
        </dependency>
    </dependencies>

</plugin>

Gradle

implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor "no.entur.mapstruct.spi:protobuf-spi-impl:1.0.0"

More information:

http://mapstruct.org/documentation/stable/reference/html/index.html#using-spi

About

Protobuf accessor naming strategy for Mapstruct

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages