Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[do not merge] attempt to reproduce incompatible protos issue. #2381

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions boms/test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

This is a test aiming to reproduce an issue with dependency conflict with a "google/api/field_behavior.proto" file.

pom included dependencies of question:
proto-google-common-protos and beam-vendor-grpc-1_60_1:
```
[INFO] --- dependency:3.7.0:tree (default-cli) @ test ---
[INFO] com.google.cloud.tools.opensource:test:jar:1.0-SNAPSHOT
[INFO] \- org.apache.beam:beam-sdks-java-core:jar:2.57.0:compile
[INFO] \- org.apache.beam:beam-vendor-grpc-1_60_1:jar:0.2:compile
```

```
[INFO] com.google.cloud.tools.opensource:test:jar:1.0-SNAPSHOT
[INFO] \- com.google.api.grpc:proto-google-common-protos:jar:2.39.0:compile
```

Use the mvn clean compile command to trigger the Protocol Buffer compilation. This will generate Java source files in the target/generated-sources/protobuf directory.
75 changes: 75 additions & 0 deletions boms/test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.google.cloud.tools.opensource</groupId>
<artifactId>cloud-tools-opensource-boms</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>test</artifactId>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>gcp-lts-bom</artifactId>
<version>7.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-common-protos</artifactId>
</dependency>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-core</artifactId>
</dependency>

<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
</dependencies>


<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.0</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<version>3.11.4</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<inputDirectories>
<include>src/main/proto</include>
</inputDirectories>
<includeMavenTypes>direct</includeMavenTypes>
<includeStdTypes>true</includeStdTypes>
<outputDirectory>${project.build.directory}/generated-sources/protobuf</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.google.cloud.tools.opensource;

public class Main {

public static void main(String[] args) {
System.out.println("Hello world!");
}
}
19 changes: 19 additions & 0 deletions boms/test/src/main/proto/book.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

package google.api;

import "google/api/resource.proto";
import "google/api/field_behavior.proto";

message Book {
option (google.api.resource) = {
type: "library.googleapis.com/Book"
pattern:
"shelves/{shelf}/books/{book}"
};

string name = 1
[(google.api.field_behavior) = IDENTIFIER];
string title = 2;
string author = 3;
}
Loading