Giter Club home page Giter Club logo

idea-spring-boot-assistant's Introduction

Spring Boot Assistant - IntelliJ-based plugin that assists you in developing spring boot applications

Plugin in action

What does the plugin do

This plugin adds auto-completion support for Spring Boot configuration files (application.yml, etc.).

Features:

  1. Auto-completion of the configuration properties in your yaml files based on the spring boot's autoconfiguration jars are present in the classpath.

  2. Auto-completion of the configuration properties in your yaml files if you have classes annotated with @ConfigurationProperties , if your build is properly configured .

  3. Short form search & search for element deep within is also supported. i.e, sp.d will show you spring.data , spring.datasource, also, port would show server.port as a suggestion.

  4. Quick documentation for groups & properties (not all groups & properties will have documentation, depends on whether the original author specified documentation or not for any given element).

Bug report:

Please create an issue at GitHub.

Installation (in 3 easy steps)

To install the plugin open your editor (IntelliJ) and hit:

  1. File > Settings > Plugins and click on the Browse repositories button.
  2. Look for Spring Boot Assistant the right click and select Download plugin.
  3. Finally, hit the Apply button, agree to restart your IDE and you're all done!

Usage

Assuming that you have Spring boot's autoconfiguration jars are present in the classpath, this plugin will automatically allow you to autocomplete properties as suggestions in all your yml files

Suggestions would appear as soon as you type/press CTRL+SPACE.

Short form suggestions are also supported such as, sp.d will show you spring.data, spring.datasource, e.t.c as suggestions that make your typing faster

In addition to libraries in the classpath, the plugin also allows you to have your own @ConfigurationProperties available as suggestions in all your yml files.

For this to work, you need to ensure the following steps are followed for your project/module

Setup for showing ConfigurationProperties as suggestions within current module

  1. Make sure Enable annotation processing is checked under Settings > Build, Execution & Deployment > Compiler > Annotation Processors

  2. Make sure you add the following changes to your project

    For Maven

    Add the following dependency

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <optional>true</optional>
    </dependency>

    For Gradle

    Add the following build configuration. You can use the propdeps-plugin for optional scope (as we don't need spring-boot-configuration-processor as a dependency in the generated jar/war)

    dependencies {
        optional "org.springframework.boot:spring-boot-configuration-processor"
    }
    
    compileJava.dependsOn(processResources)
  3. (OPTIONAL) If intellij is generating build artifacts to output directory instead of gradle's default build directory, then you may need to File | Settings | Build, Execution, Deployment | Build Tools | Gradle | Runner => Delegate IDE build/run actions to gradle & restart the IDE. This will ensure that gradle plugin generates metadata & Intellij is pointing to it

If you want to look at a sample project, look inside samples directory where the above setup is done. These samples allow properties from @ConfigurationProperties to be shown as suggestions

IMPORTANT

After changing your custom @ConfigurationProperties files, suggestions would be refreshed only after you trigger the build explicitly using keyboard (Ctrl+F9)/UI

Known behaviour in ambiguous cases

  1. If two groups from different auto configurations conflict with each other, the documentation for the group picked is random & undefined
  2. If a group & property represent the depth, the behaviour of the plugin is undefined.

Support

For report bugs, or request a new feature, use Issues.

Changelog

See here.

License

Spring Boot Assistant - IntelliJ-based Plugin is open-sourced software licensed under the MIT License.

About

This project is based on Spring Assistant - IntelliJ Plugin, thanks to the excellent work by @1tontech.

idea-spring-boot-assistant's People

Contributors

flikas avatar thekalinga avatar guchengod avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.