I was looking for a way to have YAML files for liquibase or log4j verified in IntelliJ just like how it works for application.yaml for Spring Boot. As I understand I should have a JSON file with schema, and load it through Language&Frameworks/Schemas and DTDs in IDE, but I couldn't find any. Is there another way to have autocompletion/syntax hints in Intellij?
Related
With intellij plugins I have access to PsiFiles, which let me read the contents of a, say, java file. They provide, in effect, a tree-like structure for examining a file, which is great.
Is there some way to do the same - or similar - with a pom.xml file? If so, how would I do this?
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)
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.
I am developing a java project using Eclipse as IDE and ant as the build tool. For logging I am making use of log4j library. I am able to get the log messages in a log file for my whole application using log4j configuration. But when I build project using ANT, the ANT build messages are still posted to console.I want to make sure that when I build the project, the build messages that ANT generates, like build failure/success, should also be posted to that sames logger file using log4j.
Please help me in this if anyone has got an idea in detail. Thanks
You can make use of Log4jListener available in ant.
Your log4j.properties file would look something like this
log4j.rootLogger=ERROR, LogFile
log4j.logger.org.apache.tools.ant.Project=INFO
log4j.logger.org.apache.tools.ant.Target=INFO
log4j.logger.org.apache.tools.ant.taskdefs=INFO
log4j.logger.org.apache.tools.ant.taskdefs.Echo=WARN
log4j.appender.LogFile=org.apache.log4j.FileAppender
log4j.appender.LogFile.layout=org.apache.log4j.PatternLayout
log4j.appender.LogFile.layout.ConversionPattern=[%6r] %8c{1} : %m%n
log4j.appender.LogFile.file=build.log
And you when you run the ant build you have to pass the listener argument as follows -
ant -listener org.apache.tools.ant.listener.Log4jListener
For the above command to work your log4j.porperites and the log4j jar sould be on the ant classpath. This way your build logs will go to both console and the file build.log
In IntelliJ IDEA is there a way of creating a Spring Template Project as in Spring Source ToolSuite ? The intention over here is to get a POM file created automatically with the dependencies related to a Spring Project as in Spring Source ToolSuite. The existing way of IntelliJ IDEA is to create a Maven project and then to modify the POM file. Any information regarding this would be appreciated.
I don't know much about intelliJ, but all of the template projects are available on giyhub. There are URLs that aggregate the links to the template repositories. Take a look at these two files and the clone the project that you want to use as a template:
http://dist.springsource.com/release/STS/help/descriptors-3.0.xml
https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/descriptor.xml