|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +
|
| 4 | + Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) |
| 5 | + and/or other contributors as indicated by the @authors tag. See the |
| 6 | + copyright.txt file in the distribution for a full listing of all |
| 7 | + contributors. |
| 8 | +
|
| 9 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | + you may not use this file except in compliance with the License. |
| 11 | + You may obtain a copy of the License at |
| 12 | +
|
| 13 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | +
|
| 15 | + Unless required by applicable law or agreed to in writing, software |
| 16 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | + See the License for the specific language governing permissions and |
| 19 | + limitations under the License. |
| 20 | +
|
| 21 | +--> |
| 22 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 23 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 24 | + <modelVersion>4.0.0</modelVersion> |
| 25 | + |
| 26 | + <parent> |
| 27 | + <groupId>org.mapstruct.examples.spi</groupId> |
| 28 | + <artifactId>protobuf-parent</artifactId> |
| 29 | + <version>1.0.0</version> |
| 30 | + </parent> |
| 31 | + |
| 32 | + <artifactId>protobuf-usage</artifactId> |
| 33 | + <version>1.0.0-SNAPSHOT</version> |
| 34 | + |
| 35 | + <dependencies> |
| 36 | + <dependency> |
| 37 | + <groupId>org.mapstruct</groupId> |
| 38 | + <artifactId>mapstruct-jdk8</artifactId> |
| 39 | + </dependency> |
| 40 | + <dependency> |
| 41 | + <groupId>com.google.protobuf</groupId> |
| 42 | + <artifactId>protobuf-java</artifactId> |
| 43 | + <version>${protobuf.java.version}</version> |
| 44 | + </dependency> |
| 45 | + <dependency> |
| 46 | + <groupId>junit</groupId> |
| 47 | + <artifactId>junit</artifactId> |
| 48 | + <version>4.12</version> |
| 49 | + <scope>test</scope> |
| 50 | + </dependency> |
| 51 | + </dependencies> |
| 52 | + |
| 53 | + <build> |
| 54 | + <extensions> |
| 55 | + <extension> |
| 56 | + <groupId>kr.motd.maven</groupId> |
| 57 | + <artifactId>os-maven-plugin</artifactId> |
| 58 | + <version>${os.mavenplugin.version}</version> |
| 59 | + </extension> |
| 60 | + </extensions> |
| 61 | + |
| 62 | + <plugins> |
| 63 | + <plugin> |
| 64 | + <groupId>org.xolstice.maven.plugins</groupId> |
| 65 | + <artifactId>protobuf-maven-plugin</artifactId> |
| 66 | + <version>${protobuf.plugin.version}</version> |
| 67 | + <executions> |
| 68 | + <execution> |
| 69 | + <phase>generate-sources</phase> |
| 70 | + <goals> |
| 71 | + <goal>compile</goal> |
| 72 | + <goal>compile-custom</goal> |
| 73 | + </goals> |
| 74 | + <configuration> |
| 75 | + <protocArtifact>com.google.protobuf:protoc:3.2.0:exe:${os.detected.classifier} |
| 76 | + </protocArtifact> |
| 77 | + <pluginId>grpc-java</pluginId> |
| 78 | + <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.2.0:exe:${os.detected.classifier} |
| 79 | + </pluginArtifact> |
| 80 | + </configuration> |
| 81 | + </execution> |
| 82 | + </executions> |
| 83 | + </plugin> |
| 84 | + <plugin> |
| 85 | + <artifactId>maven-compiler-plugin</artifactId> |
| 86 | + <configuration> |
| 87 | + <annotationProcessorPaths> |
| 88 | + <path> |
| 89 | + <groupId>org.mapstruct</groupId> |
| 90 | + <artifactId>mapstruct-processor</artifactId> |
| 91 | + <version>${org.mapstruct.version}</version> |
| 92 | + </path> |
| 93 | + <path> |
| 94 | + <!-- Add your SPI implementation. --> |
| 95 | + <groupId>org.mapstruct.examples.spi</groupId> |
| 96 | + <artifactId>protobuf-spi-impl</artifactId> |
| 97 | + <version>1.0.0</version> |
| 98 | + <!-- |
| 99 | + In real life, this should be a fixed version from a different |
| 100 | + reactor project and not be part of the same multi-module project. |
| 101 | + Maven wouldn't be able to consider that in the build-order calculation |
| 102 | + and might pull in the spi-impl from a previous build (especially |
| 103 | + tricky in multi-threaded builds). |
| 104 | + For Eclipse, there would be similar problems, as it can't reference |
| 105 | + build artifacts of workspace projects in the processor classpath but |
| 106 | + only jar-files (in this case from the local M2-repo cache). |
| 107 | + --> |
| 108 | + </path> |
| 109 | + </annotationProcessorPaths> |
| 110 | + </configuration> |
| 111 | + </plugin> |
| 112 | + </plugins> |
| 113 | + </build> |
| 114 | +</project> |
0 commit comments