paypal / resteasy-spring-boot

RESTEasy Spring Boot Starter
Other
188 stars 105 forks source link
jax-rs resteasy resteasy-spring-boot spring spring-boot

Build Status Codacy Badge Codacy Coverage Maven Central License

RESTEasy Spring Boot Starter


Important: this project has been transfered from PayPal team to RESTEasy team.

All future versions are going to be managed and released from https://github.com/resteasy/resteasy-spring-boot.

This Git repo will be kept here for historical purposes only.


There was no RESTEasy Spring Boot starter out there, so PayPal team decided to create one and share it with the community.

This Spring Boot starter is fully functional, has ZERO PayPal specific code on it, and can be used normally by any regular Spring Boot application that wants to have REST endpoints and prefers RESTEasy as the JAX-RS implementation.

Also, this RESTEasy Spring Boot starter integrates with Spring as expected, which means every JAX-RS REST resource that is also a Spring bean will be automatically auto-scanned, integrated, and available.

Features

Quick start

Adding POM dependency

Add the Maven dependency below to your Spring Boot application pom file.

<dependency>
   <groupId>com.paypal.springboot</groupId>
   <artifactId>resteasy-spring-boot-starter</artifactId>
   <version>2.3.4-RELEASE</version>
   <scope>runtime</scope>
</dependency>

Registering JAX-RS application classes

Just define your JAX-RS application class (a subclass of Application) as a Spring bean, and it will be automatically registered. See the example below. See section JAX-RS application registration methods in How to use RESTEasy Spring Boot Starter for further information.

package com.sample.app;

import org.springframework.stereotype.Component;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@Component
@ApplicationPath("/sample-app/")
public class JaxrsApplication extends Application {
}

Registering JAX-RS resources and providers

Just define them as Spring beans, and they will be automatically registered. Notice that JAX-RS resources can be singleton or request scoped, while JAX-RS providers must be singletons.

Further information

See How to use RESTEasy Spring Boot Starter.

Release notes

See RESTEasy Spring Boot starter release notes.

Projects

Reporting an issue

Please open an issue using our GitHub issues page.

Contributing

You are very welcome to contribute to RESTEasy Spring Boot starter! Read our Contribution guidelines.

Contacting us

To contact us, please send an email to fabiocarvalho777@gmail.com.

License

This project is licensed under the Apache 2 License.