Intellij idea thymeleaf completion in spring boot project - intellij-idea

I'm having a code assist issue in a SpringBoot / Thymeleaf project in Intellij idea.
I have setted up a simple Spring boot project using gradle and I want to use thymeleaf as a template engine; however I'm not getting any code assistance in my HTML pages.
The application runs properly however the only code assistance that I have is for the i18n messages, no code assistance for POJOs or any other thing.
My project has the Spring facet configured.
I'm running :
Intellij Idea 2016.2
Spring boot 1.3.6
Do I have to do anything else in the project to have this working?
Thanks
Ulises

Actually this is a known bug from Intellij :
https://youtrack.jetbrains.com/issue/IDEA-132738
for which there's no fix yet but only a workaround :
<!--/*--><!--#thymesVar id="loginFormBean" type="sample.system.login.LoginFormBean"--><!--*/-->

Related

Thymeleaf not being applied in Spring boot application in IntelliJ community edition(using gradle)

I have been using spring boot + thymeleaf in IntelliJ community edition for probably over half a year now. I started a new project this month and everything works except thymeleaf. It does not say I am having issues or errors in Intellij but when I run my application on localhost everything shows except anything I did relating to Thymeleaf. When I open the source code, the code with Thymeleaf is not there at all neither is the xmlns:th="http://thymeleaf.org" in the html tag. I do not need help with code. I just need help with thymeleaf. Has IntelliJ taken it out of it's community edition. It was so helpful to newbies like me who want to create their own projects. I will upload picture as well.
what my webpage shows
source code does not show any thymeleaf
dependencies
html code to show that thymeleaf does not show up in browswer

Can't produce an executable jar from Spring Boot, Gradle, and IntelliJ-Idea

I have created a Spring Boot Microservice using IntelliJ-Idea and Gradle as the build engine. I have made no changes to the initial Spring Boot configuration. I also have made no modifications to the build.gradle file provided. I built the application using starter.spring.io through IntelliJ-Idea and have the following dependencies:
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-devtools')
compile('org.springframework.boot:spring-boot-starter-web')
runtime('org.postgresql:postgresql')
testCompile('org.springframework.boot:spring-boot-starter-test')
The application currently contains 12 classes and 2 interfaces and is a Web Service provider. It runs fine on my system but when I build with Gradle, the Manifest.MF contains no Main-Class entry.
I created a very simple Hello World app and tried several combinations of IDE’s and build tools(Gradle and Maven)
and got the following results:
 
 
Interestingly, I was able to produce executable jars in Eclipse which has a separate Runnable JAR Export process.
I'm fairly new to IntelliJ and Gradle. Has anyone see this behavior before? Any ideas what I might be doing wrong in IntelliJ? I have my Hello World project zipped up if anyone needs it.
I took the advise of M. Denium and I did the Gradle build from the Command Line. The jars created were formatted correctly to be executable. Everything worked like a charm. In fact the Main-Class is a Spring Boot class called org.springframework.boot.loader.JarLauncher and the main class for my app was in a property called Start-Class. The IDE totally misses this.
Looks like you will need to include spring boot plugin for gradle - org.springframework.boot:spring-boot-gradle-plugin
More details in the gradle section of the getting started guide

IntelliJ Ultimate ignores spring boot application.properties

Today I've install IntelliJ Ultimate version 2016.1.1 build 145.597. What I did later, was import of may project from IntelliJ Community Edition. This project is based on spring-boot 1.3.3. The problem is that when I want to run my application in IntelliJ Ultimate somehow application.properties file is ignored and it starts with default spring settings. When I'm running the same project in IntelliJ Community Edition or from command line everything works fine. Problem exists only in Ultimate edition when I'm adding and running spring boot run configuration, if I use gradle configuration and bootRun task it works.
I didn't use before IntelliJ Ultimate.
Does anyone know what could be wrong? I wasted 2 hours googling for solution of my problem but I didn't find anything.
Content of src/main/resources/application.properties:
server.port=2081
server.ssl.key-store=cfg/certs/keystore.p12
server.ssl.key-store-password=dev
server.ssl.key-alias=alias
server.ssl.key-store-type=PKCS12
spring.datasource.url=jdbc:h2:file:./cfg/db/app;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.hibernate.ddl-auto=none
Project structure:
I had same issue for IntelliJ Ultimate 2016.1.1
Reimporting the project and deleting existing project worked for me.
I believe the issue is pertinent with 1.1 version. Didn't had issue with IntelliJ IDEA 2016.1.4
check if file application.properties is directly under target/classess after compiled, maybe the wrong settings copy it to other directory that spring boot cannot know
one simple thing to fix the problem.
If you already open the IntelliJ idea, close the project and remove it from IntelliJ
idea.
navigate to your project directory (ex: F:\dev\my-project) and remove the .idea
folder from it.
then open the IntelliJ idea again. open your project from File -> Open.
then run the project.
this is the simplest solution.
thanks!
I had a similar problem with my spring boot application running from IntelliJ Ultimate Version 2020.3 . I had a Connection.properties configured in spring-config.xml file as below and got the FileNotFoundException for my Connection.properties file even after placing the file under src/main/resources folder in my gradle project
<context:property-placeholder location="file:Connection.properties" />
It worked after changing it to
<context:property-placeholder location="classpath:Connection.properties" />
Note the "file:" to "classpath:" in "location" attribute

How to write code for IntelliJ - Android Plugin

I am writing a plugin for IntelliJ IDEA that depends on the Android plugin.
The IntelliJ Community Edition source code doesn't seem to include the Android plugin. I want to access the APIs like AndroidFacet and AndroidUtils in my plugin project. How can I go about doing this? I tried pulling code from https://android.googlesource.com/platform/tools/adt/idea/ and adding it to classpath but no luck so far.
Any help will be greatly appreciated.
Edit: The above might be confusing. What i really need is the JARs for the Android plugin so that I can add them to the ClassPath and access stuff like AndroidFacet, etc.
You can read this manual Developing IDEA plugin with dependency on Scala plugin. Change Scala plugin with the android plugin.

Working with IntelliJ + Spring Data + AspectJ

I am attempting to work with a Spring Data Graph project in IntelliJ 11.1.4 Ultimate edition. The project builds fine but the editor says that the persist() method on my classes annotated with #NodeEntity can't be found. Additionally, none if the aspect enhanced methods, like persist, show up for auto-complete suggestions.
I am using the AspectJ Support plugin and I have the compiler set to AJC. Both IntelliJ and Maven can build and run the project, it appears that the editor is the only piece that has the problem.
Am I missing something obvious? Is this a limitation of IntelliJ? I thought 11.1.4 addressed this but I might be mistaken.
Unfortunately AspectJ support isn't fully implemented yet - though resolve and completion should work. Could you please file a ticket in the tracker with a small demo project attached?