Spring application.properties is grayed out with Spring Initilizr - spring

I am new to spring and trying to use Spring Initilizr for my project.
I am using the code that was generated by this tool after adding dependencies for 'Spring Web' and 'Spring Data Redis'.
When I open the generated code in IntelliJ and try to edit the file application.properties, I notice that everything I type there is grayed out. According to IntelliJ it is an 'unused property'.
Any idea how to enable application.properties in my project?

As it was mentioned in one of the comments, it is indeed an issue with InteliJ. The properties are working as expected, IntelliJ for some reason doesn't display it correctly.

I see that the answer is accepted; but do not see the solution provided explicitly. In the event it helps others, the property file will be read even if it is greyed out or says "unused property". But if you want the color coded keys, this is what I did to make Intellij recognize the application properties file.
Option-1) Recomplile application.properties under Build -> Recomplile 'application.properties' https://i.stack.imgur.com/I6MXc.png
Option-2) Invalidate cache under File -> Invalidate Caches with IDE restart
Rebuild the project with either of these options and see if the file is recognized.

Related

Can't open application.properties in Eclipse

I've encountered a problem as I'm practising with Spring Boot. I've installed in Eclipse the Spring Tool 4 plugin and then created a Spring project. The problem is I can't open the application.properties file within Eclipse and I do not understand the reason. I double click and nothing happens.
Is this a known problem or am I doing something wrong? The file is openable from outside the IDE with a text editor but it seems empty.
Thanks
Try to open the file by pressing ctrl+shift+R and application. properties.

Intellij Idea hides my spring cloud contracts under test/resources

I have written my first spring-cloud-contract using Intellij Idea 2018.2. Everything works fine, but I cannot edit the contract from within Idea because it hides the complete src/test/resources/contracts folder in the project view. So I have to individually open each contract vi the file -> open... menu.
Can anybody tell me how I can access my contract files in Idea from the project view?
I have the same problem with maven. It enough to refresh the project and the folder will be added to the classpath

VS2013 displays incorrect configuration in property page

Short version
VS2013, switching property page views of files to a certain configuration shows the wrong configuration!
Long version
I have a solution with several projects, each project containing a "Debug", "DebugRelease", and "Release" configuration.
For the projects, viewing the properties in the property page viewer (right click, choose "Properties") displays the configuration settings corectly.
For individual files, viewing the properties in the property page viewer looks correct in Release, looks correct in DebugRelease, and Debug seems to display the same properties as DebugRelease.
In fact, making any changes and saving them causes the project XML to make changes for "DebugRelease". Additionally, making changes in "Debug" causes "DebugRelease" to change as well... Seems like "Debug" for some reason isn't being displayed.
Compiling seems to compile to DebugRelease as well, even though the solution configuration is set to use Debug across all projects.
If I rename the "Debug" configuration to something that's not a prefix of "DebugRelease" it seems to work okay. If I rename it to a prefix, however, the same problem persists.
More vexing still, I have other project configuration names that are similar (BlahBlah_Debug, BlahBlah_DebugRelease, and BlahBlah_Release) and only some of those display similar behavior -- some of them work fine.
Problem first noticed under VS2013.4. Updated to VS2013.5 and it still persists. This didn't used to be an issue.
The obvious work around is to rename the project configurations, but there's a decent amount of tooling that expects the configurations as they already are.

STS unable to bind maven file (.m2)

I'm working on a maven project in Spring tool suite(STS), issue is unable to navigate to other classes and methods (using ctrl+ mouse click), and its showing many error messages near import statements and other places in the class.
When clicked on the red cross mark which states error and select FIX project setup below is the message displayed on popup window.
The following proposals have been found to fix the unresolvable reference to 'Bootstrap'
Add archive 'lpa-core-1.2.5.jar - c:\Users\tom.m2\repository\com\lpa\lpa-core\1.2.5' to buildpath of 'lpa-realtime-service'
Please suggest how to include .m2 file automatically while build process to avoid the error messages and to navigate to other classes and methods using ctrl and mouse click.
It sounds like your project is not properly set up so that the IDE doesn't really configure its classpath correctly. Normally this would all happen automatically via m2e (i.e. Eclipse's maven support).
M2e is included in STS by default, so its probably installed, but somehow your project isn't treated as a maven project.
You can try to re-import it using the proper 'import wizard' which should set things up correctly for you.
Steps:
Delete the project from the workspace. Take care not to actually delete the files themselves. (There's a checkbox 'Delete project contents on disk', so don't select that).
clean out all the 'junk' data from your project. Delete all tese files / folders from your project .classpath, .project, .settings, target.
Now that you have a 'clean slate'. Import it using m2e. Menu: File >> Import >> Existing Maven Projects".
This should setup everything correctly.
I say should because it depends to a large degree on what is in the project itself. But this, in principle, is the correct way to import maven project into STS (or Eclipse in general).

I am not able to see the tabs in spring config editor in Spring STS plugin

I am trying to see the graphical user interface to look my spring batch jobs.
I can't see spring batch graphs in Editor.
In dependency graph, the tabs are not shown at the bottom.
Someone please help me.
I miss information in your question, but i can think of 3 possibilities:
.) You didnt open your xml with the spring config editor. Close the file in your IDE, right click -> open with -> other -> spring config editor.
.) You didnt add spring project nature to your project. Right click on your project -> Spring tools -> add spring project nature.
.) You miss the batch-context in your xml. Open the file with the spring config editor, click namespaces, add batch, save it and you should see the batch and batch-graph tab at the bottom.
Spring config files are not added. They were not automatically detected.
The way add that.
Project properites -> Spring -> Bean Support -> Config files.

Resources