Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vyvy-vi/myplugin

myplugin: Maven plugin that extracts spring boot endpoints
https://github.com/vyvy-vi/myplugin

Last synced: 9 days ago
JSON representation

myplugin: Maven plugin that extracts spring boot endpoints

Awesome Lists containing this project

README

        

# myplugin (spring-boot-endpoint-finder)
This plugin was created after a session from Programming Pathshala on Maven, which involved a demonstration of creating Maven Plugins.

The plugin can identify which API endpoints are defined in which controller in a SpringBoot project, assuming that all the RequestMappings are found in a folder named controllers or controller or web or rest. If the folder is not found, it just goes to the path given in dummyLocation variable.

In future, this could be extended to output swagger.json file and auto-document the API.

Screenshot 2024-05-05 at 1 08 28 AM
Screenshot 2024-05-05 at 1 08 47 AM

## Installation
1. Clone this project
```
git clone https://github.com/Vyvy-vi/myplugin
```
2. Open project in terminal and install it
```
cd myplugin
mvn install
```
3. In the main project, that is the SpringBoot project in which you want to run this plugin, open the pom.xml and add the following content:
```xml


org.apache.maven.plugins
maven-install-plugin
3.1.1

install-file


org.myplugin
myplugin
1.0
jar
MYPLUGINPATH
true



org.myplugin
myplugin
1.0

hello

```
Replace MYPLUGINJARPATH with the path to your compiled jar file. In my case, this was - `/Users/vy/repos/myplugin/target/myplugin-1.0-SNAPSHOT.jar`

4. Install the main project
```
mvn install
```
5. For main project, select the Plugins dropdown from IntelliJ's maven panel, click on install and double click install:install-file. This should add myplugin to the project's plugins.
Screenshot 2024-05-05 at 1 06 24 AM

6. Click on the new `my` dropdown in Plugins (it might have a different name?) and double click my:hello. This should run the plugin for the project, and the output should try to find a controllers/controller/rest/web folder and contain all the mappings from there.
Screenshot 2024-05-05 at 1 07 03 AM