Skip to content

Commit

Permalink
Unban com.google.code.findbugs:jsr305 for gRPC extension
Browse files Browse the repository at this point in the history
Fixes #5167
  • Loading branch information
jamesnetherton committed Aug 11, 2023
1 parent 01f624f commit 5847d11
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 12 deletions.
6 changes: 0 additions & 6 deletions extensions/grpc/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-common-deployment</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
Expand Down
48 changes: 48 additions & 0 deletions extensions/grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,52 @@
<module>deployment</module>
<module>runtime</module>
</modules>

<build>
<plugins>
<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>
<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>
<xsltLocation>${maven.multiModuleProjectDirectory}/tooling/enforcer-rules/allow-findbugs.xsl</xsltLocation>
</filteredExternalRules>
<filteredExternalRules>
<location>${maven.multiModuleProjectDirectory}/tooling/enforcer-rules/camel-quarkus-banned-dependencies-spring.xml</location>
</filteredExternalRules>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
6 changes: 0 additions & 6 deletions extensions/grpc/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-common</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
Expand Down
43 changes: 43 additions & 0 deletions integration-tests/grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,49 @@

<build>
<plugins>
<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>
<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>
<xsltLocation>${maven.multiModuleProjectDirectory}/tooling/enforcer-rules/allow-findbugs.xsl</xsltLocation>
</filteredExternalRules>
<filteredExternalRules>
<location>${maven.multiModuleProjectDirectory}/tooling/enforcer-rules/camel-quarkus-banned-dependencies-spring.xml</location>
</filteredExternalRules>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
Expand Down
33 changes: 33 additions & 0 deletions tooling/enforcer-rules/allow-findbugs.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output omit-xml-declaration="yes"/>

<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

<!-- Allows findbugs usage in the gRPC extension -->
<!-- https://github.com/apache/camel-quarkus/issues/5167 -->
<xsl:template match="//bannedDependencies/excludes/exclude[contains(text(), 'com.google.code.findbugs:jsr305')]"/>
</xsl:stylesheet>

0 comments on commit 5847d11

Please sign in to comment.