Skip to content

Commit 816239b

Browse files
authored
fix: protobuf 3 support (#1127)
Signed-off-by: Todd Baert <[email protected]>
1 parent be2685b commit 816239b

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

providers/flagd/pom.xml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
66
<groupId>dev.openfeature.contrib</groupId>
@@ -16,6 +16,7 @@
1616
<!-- exclusion expression for e2e tests -->
1717
<testExclusions>**/e2e/*.java</testExclusions>
1818
<io.grpc.version>1.69.0</io.grpc.version>
19+
<protobuf-java.min.version>3.25.5</protobuf-java.min.version>
1920
</properties>
2021

2122
<name>flagd</name>
@@ -38,7 +39,7 @@
3839
<groupId>com.google.protobuf</groupId>
3940
<artifactId>protobuf-java</artifactId>
4041
<!-- 5.0.0-rc < 5.0.0, unfortunately -->
41-
<version>[3.25.5,4.999999)</version>
42+
<version>[${protobuf-java.min.version},4.999999)</version>
4243
</dependency>
4344

4445
<dependency>
@@ -221,7 +222,7 @@
221222
<configuration>
222223
<protocArtifact>com.google.protobuf:protoc:3.25.5:exe:${os.detected.classifier}</protocArtifact>
223224
<pluginId>grpc-java</pluginId>
224-
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.69.0:exe:${os.detected.classifier}</pluginArtifact>
225+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.68.2:exe:${os.detected.classifier}</pluginArtifact>
225226
<protoSourceRoot>${project.basedir}/schemas/protobuf/</protoSourceRoot>
226227
</configuration>
227228
<executions>
@@ -237,6 +238,24 @@
237238
</build>
238239

239240
<profiles>
241+
<profile>
242+
<!-- this profile forces us to compile against our minimum version of protobuf-java,
243+
which is required so we can be compatible with both protobuf-java@v3 and protobuf-java@v4 consumers -->
244+
<id>build</id>
245+
<activation>
246+
<activeByDefault>true</activeByDefault>
247+
</activation>
248+
249+
<dependencies>
250+
<dependency>
251+
<groupId>com.google.protobuf</groupId>
252+
<artifactId>protobuf-java</artifactId>
253+
<!-- must match minimum version in protobuf-java dependency range above -->
254+
<version>${protobuf-java.min.version}</version>
255+
</dependency>
256+
</dependencies>
257+
258+
</profile>
240259
<profile>
241260
<!-- this profile handles running the flagd e2e tests -->
242261
<id>e2e</id>

0 commit comments

Comments
 (0)