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

Compilation fails for gRPC applications in dev mode #5167

Closed
jamesnetherton opened this issue Aug 10, 2023 · 3 comments
Closed

Compilation fails for gRPC applications in dev mode #5167

jamesnetherton opened this issue Aug 10, 2023 · 3 comments
Assignees
Labels
area/grpc bug Something isn't working
Milestone

Comments

@jamesnetherton
Copy link
Contributor

Bug description

I finally realize why Quarkus does not exclude Findbugs in grpc-common. Seems gRPC has a number of occurrences of javax.annotation.CheckReturnValue:

https://github.com/search?q=repo%3Agrpc%2Fgrpc-java+CheckReturnValue&type=code&p=1

Which results in the following compilation error because we are excluding findbugs here:

https://github.com/apache/camel-quarkus/blob/main/extensions/grpc/runtime/pom.xml#L41-L45

Seems to not occur outside of dev mode though.

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] cannot access javax.annotation.CheckReturnValue
  class file for javax.annotation.CheckReturnValue not found
[INFO] 1 error
[INFO] -------------------------------------------------------------

The simplest fix would be to remove the Findbugs exclusion.

@jamesnetherton jamesnetherton added the bug Something isn't working label Aug 10, 2023
@jamesnetherton jamesnetherton self-assigned this Aug 10, 2023
@jamesnetherton
Copy link
Contributor Author

@ppalaga Is there any way of ignoring the dependency ban for Findbugs exclusively in the grpc/runtime module? Or would the ban have to be removed globally (maybe undesirable)?

@ppalaga
Copy link
Contributor

ppalaga commented Aug 10, 2023

Yeah, I also recollect gRPC was a special about findbugs.

We could try to redefine the rules in this module, something like

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>io.quarkus</groupId>
                                <artifactId>quarkus-enforcer-rules</artifactId>
                                <version>${quarkus.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>org.l2x6.cq</groupId>
                                <artifactId>cq-filtered-external-enforcer-rules</artifactId>
                                <version>${cq-plugin.version}</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>camel-quarkus-enforcer-rules</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireJavaVersion>
                                            <version>11</version>
                                        </requireJavaVersion>
                                        <dependencyConvergence />
                                        <filteredExternalRules>
                                            <location>classpath:enforcer-rules/quarkus-require-maven-version.xml</location>
                                        </filteredExternalRules>
                                        <filteredExternalRules>
                                            <location>classpath:enforcer-rules/quarkus-banned-dependencies.xml</location>
                                            <xsltLocation>${maven.multiModuleProjectDirectory}/tooling/enforcer-rules/quarkus-banned-dependencies.xsl</xsltLocation>
                                        </filteredExternalRules>
                                        <filteredExternalRules>
                                            <location>${maven.multiModuleProjectDirectory}/tooling/enforcer-rules/camel-quarkus-banned-dependencies.xml</location>
<!-- Exclude findbugs in this module -->
                                            <xsltLocation>${maven.multiModuleProjectDirectory}/tooling/enforcer-rules/exclude-findbugs.xsl</xsltLocation>
                                        </filteredExternalRules>
                                        <filteredExternalRules>
                                            <location>${maven.multiModuleProjectDirectory}/tooling/enforcer-rules/camel-quarkus-banned-dependencies-spring.xml</location>
                                        </filteredExternalRules>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

where tooling/enforcer-rules/exclude-findbugs.xsl could be adapted from the existing tooling/enforcer-rules/quarkus-banned-dependencies.xsl

@ppalaga
Copy link
Contributor

ppalaga commented Aug 10, 2023

It's actually "allow findbugs" rather than "exclude findbugs"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/grpc bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants