-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support more than one custom annotation which registers MP REST Clien…
…t provider Changed the RestCliendBase constructor to accept an array list of annotation classes
- Loading branch information
1 parent
1822e0c
commit d46d35b
Showing
28 changed files
with
762 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...tion-tests/maven/src/test/resources/projects/rest-client-custom-headers-extension/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.acme</groupId> | ||
<artifactId>quarkus-extensions-parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id> | ||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> | ||
<quarkus.platform.version>@project.version@</quarkus.platform.version> | ||
<quarkus-plugin.version>@project.version@</quarkus-plugin.version> | ||
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
<modules> | ||
<module>rest-client-custom-headers</module> | ||
<module>runner</module> | ||
</modules> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<version>\${quarkus-plugin.version}</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>${quarkus.platform.group-id}</groupId> | ||
<artifactId>${quarkus.platform.artifact-id}</artifactId> | ||
<version>${quarkus.platform.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.acme</groupId> | ||
<artifactId>rest-client-custom-headers</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
</project> |
52 changes: 52 additions & 0 deletions
52
...ojects/rest-client-custom-headers-extension/rest-client-custom-headers/deployment/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.acme</groupId> | ||
<artifactId>rest-client-custom-headers-parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>rest-client-custom-headers-deployment</artifactId> | ||
<name>Rest Client Custom Headers - Deployment</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-arc-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-core-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-rest-client-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.acme</groupId> | ||
<artifactId>rest-client-custom-headers</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>\${quarkus.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
24 changes: 24 additions & 0 deletions
24
...lient-custom-headers/deployment/src/main/java/org/acme/deployment/ExtensionBuildStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.acme.deployment; | ||
|
||
import io.quarkus.arc.deployment.AdditionalBeanBuildItem; | ||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.restclient.deployment.RestClientAnnotationProviderBuildItem; | ||
import org.acme.CustomHeader1Filter; | ||
import org.acme.CustomHeader2Filter; | ||
|
||
|
||
public class ExtensionBuildStep { | ||
|
||
@BuildStep | ||
void registerProvider(BuildProducer<AdditionalBeanBuildItem> additionalBeans, | ||
BuildProducer<RestClientAnnotationProviderBuildItem> restAnnotationProvider) { | ||
additionalBeans.produce(AdditionalBeanBuildItem.unremovableOf(CustomHeader1Filter.class)); | ||
additionalBeans.produce(AdditionalBeanBuildItem.unremovableOf(CustomHeader2Filter.class)); | ||
|
||
restAnnotationProvider.produce(new RestClientAnnotationProviderBuildItem("org.acme.CustomHeader1", | ||
CustomHeader1Filter.class)); | ||
restAnnotationProvider.produce(new RestClientAnnotationProviderBuildItem("org.acme.CustomHeader2", | ||
CustomHeader2Filter.class)); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...esources/projects/rest-client-custom-headers-extension/rest-client-custom-headers/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.acme</groupId> | ||
<artifactId>quarkus-extensions-parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>rest-client-custom-headers-parent</artifactId> | ||
<name>Rest Client Custom Headers - Parent</name> | ||
|
||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<maven.compiler.parameters>true</maven.compiler.parameters> | ||
<quarkus.version>@project.version@</quarkus.version> | ||
<compiler-plugin.version>3.8.1</compiler-plugin.version> | ||
</properties> | ||
|
||
<modules> | ||
<module>runtime</module> | ||
<module>deployment</module> | ||
</modules> | ||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>\${compiler-plugin.version}</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</project> |
64 changes: 64 additions & 0 deletions
64
.../projects/rest-client-custom-headers-extension/rest-client-custom-headers/runtime/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.acme</groupId> | ||
<artifactId>rest-client-custom-headers-parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>rest-client-custom-headers</artifactId> | ||
<name>Rest Client Custom Headers - Runtime</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-arc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-rest-client</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-bootstrap-maven-plugin</artifactId> | ||
<version>\${quarkus.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>extension-descriptor</goal> | ||
</goals> | ||
<phase>compile</phase> | ||
<configuration> | ||
<deployment>org.acme:rest-client-custom-headers-deployment:1.0-SNAPSHOT</deployment> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>\${quarkus.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
13 changes: 13 additions & 0 deletions
13
...rs-extension/rest-client-custom-headers/runtime/src/main/java/org/acme/CustomHeader1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.acme; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target({ ElementType.TYPE }) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
public @interface CustomHeader1 { | ||
} |
Oops, something went wrong.