Skip to content

Commit

Permalink
Module move and rename: spring4 -> spring (#2392)
Browse files Browse the repository at this point in the history
* Module move and rename: spring4 -> spring

* Add the description for changes of Spring(4) module

* Feign Spring: relocation information

* Feign Spring, relocation: leave only artifactId

* Update license plugin's configuration
  • Loading branch information
vitalijr2 authored Apr 25, 2024
1 parent 1c06ba6 commit ebba793
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 92 deletions.
53 changes: 29 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<module>ribbon</module>
<module>sax</module>
<module>slf4j</module>
<module>spring</module>
<module>spring4</module>
<module>soap</module>
<module>soap-jakarta</module>
Expand Down Expand Up @@ -643,30 +644,34 @@
<artifactId>license-maven-plugin</artifactId>
<version>${license-maven-plugin.version}</version>
<configuration>
<!-- session.executionRootDirectory resolves properly even with nested modules -->
<header>${main.basedir}/src/etc/header.txt</header>
<excludes>
<exclude>.travis.yml</exclude>
<exclude>.editorconfig</exclude>
<exclude>.gitattributes</exclude>
<exclude>.gitignore</exclude>
<exclude>.mvn/**</exclude>
<exclude>mvnw*</exclude>
<exclude>etc/header.txt</exclude>
<exclude>**/.idea/**</exclude>
<exclude>**/target/**</exclude>
<exclude>LICENSE</exclude>
<exclude>NOTICE</exclude>
<exclude>OSSMETADATA</exclude>
<exclude>**/*.md</exclude>
<exclude>**/*.asciidoc</exclude>
<exclude>**/*.iuml</exclude>
<exclude>bnd.bnd</exclude>
<exclude>travis/**</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
<exclude>.circleci/**</exclude>
</excludes>
<licenseSets>
<licenseSet>
<!-- session.executionRootDirectory resolves properly even with nested modules -->
<header>${main.basedir}/src/etc/header.txt</header>
<excludes>
<exclude>.travis.yml</exclude>
<exclude>.editorconfig</exclude>
<exclude>.gitattributes</exclude>
<exclude>.gitignore</exclude>
<exclude>.mvn/**</exclude>
<exclude>mvnw*</exclude>
<exclude>etc/header.txt</exclude>
<exclude>**/.idea/**</exclude>
<exclude>**/target/**</exclude>
<exclude>LICENSE</exclude>
<exclude>NOTICE</exclude>
<exclude>OSSMETADATA</exclude>
<exclude>**/*.md</exclude>
<exclude>**/*.asciidoc</exclude>
<exclude>**/*.iuml</exclude>
<exclude>bnd.bnd</exclude>
<exclude>travis/**</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
<exclude>.circleci/**</exclude>
</excludes>
</licenseSet>
</licenseSets>
<strictCheck>true</strictCheck>
<mapping>
<java>SLASHSTAR_STYLE</java>
Expand Down
40 changes: 40 additions & 0 deletions spring/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Feign Spring
This module overrides OpenFeign/feign annotation processing to instead use standard ones supplied by the spring annotations specification.


## Currently Supported Annotation Processing
Feign only supports processing java interfaces (not abstract or concrete classes).

ISE is raised when any annotation's value is empty or null. Ex. `Path("")` raises an ISE.

Here are a list of behaviors currently supported.
### Type Annotations
#### `@RequestMapping`
Appends the ```value``` to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
The ```method``` sets the request method.
The ```produces``` adds the first value as the `Accept` header.
The ```consume``` adds the first value as the `Content-Type` header.
### Method Annotations
#### `@RequestMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
The method sets the request method.
#### `@GetMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `GET` request method.
#### `@PostMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `POST` request method.
#### `@PutMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `PUT` request method.
#### `@DeleteMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `DELETE` request method.
#### `@PatchMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `PATCH` request method.
### Parameter Annotations
#### `@PathVariable`
Links the value of the corresponding parameter to a template variable declared in the path.
#### `@RequestParam`
Links the value of the corresponding parameter to a query parameter. When invoked, null will skip the query param.
60 changes: 60 additions & 0 deletions spring/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2012-2024 The Feign Authors
Licensed 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.
-->
<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>io.github.openfeign</groupId>
<artifactId>parent</artifactId>
<version>13.3-SNAPSHOT</version>
</parent>

<artifactId>feign-spring</artifactId>
<name>Feign Spring</name>
<description>Feign Contracts for Spring</description>

<properties>
<main.basedir>${project.basedir}/..</main.basedir>

<spring.version>5.3.34</spring.version>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>feign-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>

<!-- testing -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>feign-mock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>feign-jackson</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed 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
Expand Down
41 changes: 2 additions & 39 deletions spring4/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
# Feign Spring
This module overrides OpenFeign/feign annotation processing to instead use standard ones supplied by the spring annotations specification.
# Feign Spring4


## Currently Supported Annotation Processing
Feign only supports processing java interfaces (not abstract or concrete classes).

ISE is raised when any annotation's value is empty or null. Ex. `Path("")` raises an ISE.

Here are a list of behaviors currently supported.
### Type Annotations
#### `@RequestMapping`
Appends the ```value``` to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
The ```method``` sets the request method.
The ```produces``` adds the first value as the `Accept` header.
The ```consume``` adds the first value as the `Content-Type` header.
### Method Annotations
#### `@RequestMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
The method sets the request method.
#### `@GetMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `GET` request method.
#### `@PostMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `POST` request method.
#### `@PutMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `PUT` request method.
#### `@DeleteMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `DELETE` request method.
#### `@PatchMapping`
Appends the value to `Target.url()`. Can have tokens corresponding to `@PathVariable` annotations.
Sets the `PATCH` request method.
### Parameter Annotations
#### `@PathVariable`
Links the value of the corresponding parameter to a template variable declared in the path.
#### `@RequestParam`
Links the value of the corresponding parameter to a query parameter. When invoked, null will skip the query param.
The module was moved to [spring](../spring) and renamed to **Feign Spring**.
31 changes: 6 additions & 25 deletions spring4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</parent>

<artifactId>feign-spring4</artifactId>
<name>Feign spring</name>
<name>Feign Spring4</name>
<description>Feign Contracts for Spring4</description>

<properties>
Expand All @@ -33,28 +33,9 @@
<spring.version>4.3.30.RELEASE</spring.version>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>feign-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>

<!-- testing -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>feign-mock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>feign-jackson</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<distributionManagement>
<relocation>
<artifactId>feign-spring</artifactId>
</relocation>
</distributionManagement>
</project>
2 changes: 1 addition & 1 deletion src/docs/overview-mindmap.iuml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*** JAX-RS
*** JAX-RS 2
*** JAX-RS 3 / Jakarta
*** Spring 4
*** Spring 5
*** SOAP
*** SOAP Jakarta
*** Spring boot (3rd party)
Expand Down

0 comments on commit ebba793

Please sign in to comment.