Spring Boot Assistant - IntelliJ-based plugin that assists you in developing spring boot applications
This plugin adds auto-completion support for Spring Boot configuration files (application.yml, etc.).
-
Auto-completion of the configuration properties in your
yaml
files based on the spring boot's autoconfiguration jars are present in the classpath. -
Auto-completion of the configuration properties in your
yaml
files if you have classes annotated with@ConfigurationProperties
, if your build is properly configured . -
Short form search & search for element deep within is also supported. i.e,
sp.d
will show youspring.data
,spring.datasource
, also,port
would showserver.port
as a suggestion. -
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).
To install the plugin open your editor (IntelliJ) and hit:
File > Settings > Plugins
and click on theBrowse repositories
button.- Look for
Spring Boot Assistant
the right click and selectDownload plugin
. - Finally, hit the
Apply
button, agree to restart your IDE and you're all done!
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
-
Make sure
Enable annotation processing
is checked underSettings > Build, Execution & Deployment > Compiler > Annotation Processors
-
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 needspring-boot-configuration-processor
as a dependency in the generated jar/war)dependencies { optional "org.springframework.boot:spring-boot-configuration-processor" } compileJava.dependsOn(processResources)
-
(OPTIONAL) If intellij is generating build artifacts to
output
directory instead of gradle's defaultbuild
directory, then you may need toFile | 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
- If two groups from different auto configurations conflict with each other, the documentation for the group picked is random & undefined
- If a group & property represent the depth, the behaviour of the plugin is undefined.
For report bugs, or request a new feature, use Issues.
See here.
Spring Boot Assistant - IntelliJ-based Plugin is open-sourced software licensed under the MIT License.
This project is based on Spring Assistant - IntelliJ Plugin, thanks to the excellent work by @1tontech.