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

Broken in Reactor setups by Maven 3.8 #101

Open
ches opened this issue Mar 25, 2022 · 0 comments
Open

Broken in Reactor setups by Maven 3.8 #101

ches opened this issue Mar 25, 2022 · 0 comments

Comments

@ches
Copy link

ches commented Mar 25, 2022

Describe the bug

It appears that in reactor projects where downstream modules depend on the build output of a module in which protobuf-maven-plugin generates code, with Maven 3.8.x the build products are no longer available on the classpath for the downstream modules—they fail to compile with "cannot find symbol" errors for the protobuf products.

I find that the protobuf products are built as expected in target/generated-sources and target/classes of the upstream module, it appears that the problem is only in classpath propagation through the reactor build state.

Reverting to Maven 3.6.3 works around the issue.

Environment

Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /usr/local/Cellar/maven/3.8.5/libexec
Java version: 1.8.0_292, vendor: AdoptOpenJDK, runtime: /Users/cmartin/.sdkman/candidates/java/8.0.292.hs-adpt/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

Standalone or IDE

Standalone

Plugin configuration

        <plugin>
          <groupId>org.xolstice.maven.plugins</groupId>
          <artifactId>protobuf-maven-plugin</artifactId>
          <version>0.6.1</version>
          <configuration>
            <checkStaleness>true</checkStaleness>
            <protocArtifact>
                com.google.protobuf:protoc:${protocVersion}:exe:${os.detected.classifier}
            </protocArtifact>
            <pluginId>grpc-java</pluginId>
            <pluginArtifact>
                io.grpc:protoc-gen-grpc-java:${grpcVersion}:exe:${os.detected.classifier}
            </pluginArtifact>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>compile</goal>
                <goal>compile-custom</goal>
                <goal>test-compile</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

To Reproduce

I will try to come back to this issue to add a minimal and publicly-available reproduction project.

Steps to reproduce the behavior:

  1. Set up a multi-module Maven build, where Module A uses protobuf-maven-plugin to generate some Java classes.
  2. Make a Module B which depends on Module A and refers to symbols produced by it.
  3. Use Maven 3.8 and run mvn --also-make compile

Log output

Compilation errors with "cannot find symbol" for the proto products. Again, can update with actual build logs from a public repro.

Expected behavior

Module B builds successfully, as it does when using Maven 3.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant