From 3cf25c5f90e7723e8998e7826969563d30cda90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=B1=D0=BE=D0=BB=D0=B5=D0=B2=20=D0=92=D0=B0?= =?UTF-8?q?=D1=81=D0=B8=D0=BB=D0=B8=D0=B9?= Date: Wed, 29 Jul 2026 17:43:25 +0300 Subject: [PATCH] Fix protobuf-spi-impl configuration: use annotationProcessor instead of implementation --- README.md | 2 +- .../mapstruct/dependency/AdditionalDependency.java | 2 +- .../plugins/mapstruct/manager/DependencyManager.java | 2 +- .../akazver/gradle/plugins/mapstruct/DependencyTest.java | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e6ba230..21962d0 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ The plugin automatically: | | [apache/camel-spring-boot](https://github.com/apache/camel-spring-boot) | [org.apache.camel.springboot/camel-mapstruct-starter](https://mvnrepository.com/artifact/org.apache.camel.springboot/camel-mapstruct-starter) | `implementation` | | | [apache/camel-quarkus](https://github.com/apache/camel-quarkus) | [org.apache.camel.quarkus/camel-quarkus-mapstruct](https://mvnrepository.com/artifact/org.apache.camel.quarkus/camel-quarkus-mapstruct) | `implementation` | | **Quarkus** | [quarkiverse/quarkus-mapstruct](https://github.com/quarkiverse/quarkus-mapstruct) | [io.quarkiverse.mapstruct/quarkus-mapstruct](https://mvnrepository.com/artifact/io.quarkiverse.mapstruct/quarkus-mapstruct) | `implementation` | -| **Protobuf** | [entur/mapstruct-spi-protobuf](https://github.com/entur/mapstruct-spi-protobuf) | [no.entur.mapstruct.spi/protobuf-spi-impl](https://mvnrepository.com/artifact/no.entur.mapstruct.spi/protobuf-spi-impl) | `implementation` | +| **Protobuf** | [entur/mapstruct-spi-protobuf](https://github.com/entur/mapstruct-spi-protobuf) | [no.entur.mapstruct.spi/protobuf-spi-impl](https://mvnrepository.com/artifact/no.entur.mapstruct.spi/protobuf-spi-impl) | `annotationProcessor` | ## Config diff --git a/src/main/java/io/github/akazver/gradle/plugins/mapstruct/dependency/AdditionalDependency.java b/src/main/java/io/github/akazver/gradle/plugins/mapstruct/dependency/AdditionalDependency.java index 15888a6..7ef1c00 100644 --- a/src/main/java/io/github/akazver/gradle/plugins/mapstruct/dependency/AdditionalDependency.java +++ b/src/main/java/io/github/akazver/gradle/plugins/mapstruct/dependency/AdditionalDependency.java @@ -57,7 +57,7 @@ public class AdditionalDependency extends PluginDependency { // https://mvnrepository.com/artifact/no.entur.mapstruct.spi/protobuf-spi-impl public static final AdditionalDependency PROTOBUF_SPI_IMPL = - new AdditionalDependency("implementation", "no.entur.mapstruct.spi:protobuf-spi-impl:1.62.0"); + new AdditionalDependency("annotationProcessor", "no.entur.mapstruct.spi:protobuf-spi-impl:1.62.0"); public AdditionalDependency(String configuration, String id) { super(configuration, id); diff --git a/src/main/java/io/github/akazver/gradle/plugins/mapstruct/manager/DependencyManager.java b/src/main/java/io/github/akazver/gradle/plugins/mapstruct/manager/DependencyManager.java index f6d77b3..7efab63 100644 --- a/src/main/java/io/github/akazver/gradle/plugins/mapstruct/manager/DependencyManager.java +++ b/src/main/java/io/github/akazver/gradle/plugins/mapstruct/manager/DependencyManager.java @@ -95,7 +95,7 @@ private void addOptionalDependencies(String processorConfig) { if (hasProtobuf) { LOGGER.lifecycle(ADDING_MESSAGE, "Protobuf"); - addDependency(PROTOBUF_SPI_IMPL); + addDependency(PROTOBUF_SPI_IMPL, processorConfig); } } diff --git a/src/test/java/io/github/akazver/gradle/plugins/mapstruct/DependencyTest.java b/src/test/java/io/github/akazver/gradle/plugins/mapstruct/DependencyTest.java index bdac36d..b7eea5d 100644 --- a/src/test/java/io/github/akazver/gradle/plugins/mapstruct/DependencyTest.java +++ b/src/test/java/io/github/akazver/gradle/plugins/mapstruct/DependencyTest.java @@ -271,11 +271,11 @@ void addOptionalDependenciesWithProtobuf() { evaluate(project); String[] expectedAnnotationProcessor = { - MAPSTRUCT_PROCESSOR.getId() + MAPSTRUCT_PROCESSOR.getId(), PROTOBUF_SPI_IMPL.getId() }; String[] expectedImplementation = { - MAPSTRUCT.getId(), PROTOBUF_JAVA.getId(), PROTOBUF_SPI_IMPL.getId() + MAPSTRUCT.getId(), PROTOBUF_JAVA.getId() }; optionalDependenciesWithoutSpringTest(project, expectedAnnotationProcessor, expectedImplementation); @@ -294,11 +294,11 @@ void addOptionalDependenciesWithProtobufPlugin() { assertThat(project.getConfigurations().findByName("protobuf")).isNotNull(); String[] expectedAnnotationProcessor = { - MAPSTRUCT_PROCESSOR.getId() + MAPSTRUCT_PROCESSOR.getId(), PROTOBUF_SPI_IMPL.getId() }; String[] expectedImplementation = { - MAPSTRUCT.getId(), PROTOBUF_JAVA.getId(), PROTOBUF_SPI_IMPL.getId() + MAPSTRUCT.getId(), PROTOBUF_JAVA.getId() }; optionalDependenciesWithoutSpringTest(project, expectedAnnotationProcessor, expectedImplementation);