IntelliJ Spring properties auto completion in *.yml files - intellij-idea

I've been trying to make IntelliJ treat *.yml files the same way it treats application.yml or bootstrap.yml.
What I mean is, that I have auto completion and syntax warnings when I edit for example a application.yml file, but none of these features when I edit a file called microservices-monitor-prod.yml which is located in a config server resource folder.
Is there any way to have the same IntelliJ features when editing such files ?

IntelliJ IDEA 2017.2 (currently available as RC) allows to choose custom naming schemes for Spring Boot configuration files (https://youtrack.jetbrains.com/issue/IDEA-133445)

Related

Make Checkstyle IntelliJ plug in use a rule relative to the project

I work on a project that uses a microservice architecture.
We externalized the checkstyle configuration in a separated library, we use IntelliJ and the checkstyle plug in.
The checkstyle plug in refers to a static xml file (example of configuration : IntelliJ IDEA code format from checkstyle configuration ) and the configuration of the plug in is automatically is the same for all projects.
When we change the version of our checkstyle configuration, we do not want to adapt the code of all microservices at once and so, at the same time, some services will use the old checkstyle config and some others will use the new one until we upgrade the version.
So, I want to make the checkstyle IntelliJ plug in to refer in every project to the file {project directory}/target/checkstyle-checker.xml and not an unique checkstyle.xml
Does it exist a way to achieve this ? Or at least to make the configuration of the plug in different for all projects ?
Thank you for reading !

Grails 3 plugin using properties from application.yml

I am creating a plugin using Grail 3 (3.2.11). My plugin needs to access different properties (e.g. URLs) for each environment (e.g. development, staging, production). When writing a Grails application I add the properties to the application.yml file. Where do they go in the plugin? I tried adding them to application.yml of the plugin and that does not work as expected. If I add them to the application.yml file of the application using the plugin they work. But I want the properties to be part of the plugin so each person who uses the plugin does not need to provide the properties. I would expect it to work like message properties. Where a plugin can have message properties and an application can override them by providing the same property in their local application message.properties. What am I not understanding.
In the same conf directory as application.yml you can place a plugin.yml (or plugin.groovy) which should allow you to change the plugin configuration similar to the way its done in the application's config file(s).

Is it possible to configure file types mapping in Idea via gradle 'idea' plugin

A little intro:
I work on a project with legacy codebase witch uses internal xml based descriptors with specific file extensions (about may be 10 extensions).
Let it be *.desc, *.check etc.
To have code highlighting for such a files I can configure Idea to consider these types of files as XML.
It's available through:
Preferences / Editor / File types
And then add all custom extensions to 'Recognized file types': 'XML'
Our project uses gradle as build tool
and my question is:
Is it possible to make same configuration via dsl of gadle 'idea' plugin?
The short answer is: No.
One could create a custom Gradle task that will modify IDE file type preferences XML file in the config directory. While it's possible to run such task automatically on the project refresh in IntelliJ IDEA, it will most likely not work since you can't modify IDE configuration when IDE is running (the changes will be reverted). So, you will have to run it from the command line, outside of IntelliJ IDEA when IDE is not running.
It's probably not what you want, but if documented, can be used by the team as the manual step to make this configuration change easier.
Using gradle idea is not recommended anyway.
A better way might be to provide your own IDE plug-in that will associate these file extensions with XML file type and instruct the team to install this plug-in.

Spring Boot default settings do not allow me to autogenerate a new class in IntelliJ

Just switched to the Intellij Ultimate 14.1.4 IDE. Tried to build a simple Spring Boot helloworld endpoint but ran into several problems.
I first created a new Spring initializer project with no issues. I went through the various windows setting up the project with no issues. When the project was created it did not generate a Spring Boot main application class, which is no big deal; it's just an irritation for a newbie.
I selected src > file > new and tried to select a Java class but found that there was none in the drop down box. Most of the drop downs were JavaScript, CSS, and JSON files. I guess I do not have the correct default for Spring Boot. Anybody know how to set this up?
The crux of the issue is that you were not running that command in the context of a source or test folder. If you attempt to do any autogenerate commands in a non-source folder, you won't get the full set of things that can be generated.
The simple fix is to be sure that you're in the right folder - likely src/main/java.
If the folder isn't marked blue, then right-click on it, and select Mark Directory As > Sources Root.
This is what it appears when you don't have the folder marked as source:
...and this is what it looks like when you do:

Configuring Play Framework 2.0 conf file in Intellij IDEA 14.1.4

I'm using Intellij IDEA 14.1.4 to develop a Play 2.x application and I was wondering if it's possible to somehow configure the conf file used by Play. I'd like to do something similar to what's described here: https://www.playframework.com/documentation/2.4.x/ProductionConfiguration.
$ /path/to/bin/<project-name> -Dconfig.file=/opt/conf/prod.conf
Is is possible to somehow set up a configuration in IDEA? I've looked at the configuration settings in IDEA, but I haven't found anything to specify the conf file. I've also tried the IDEA forum but unfortunately nobody has answered so far.
Here's the configuration window in IDEA:
You can edit the "run configuration" and specify additional parameters. Recent versions of IDEA use sbt to run Play Applications, which allows you to add additional parameters.
Simply add -Dconfig.resource=idea.conf and create an idea.conf-file containing the development configuration.