Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use .gdsl file in a Java project in IntelliJ

I have a file pipeline.gdsl that contains the Syntax for my Jenkins Pipeline DSL. Following this blog post I put the file into the /src folder of my Java project. When I now edit my Jenkinsfile (residing in the root folder of my project), I don't get any code completion / syntax explanation as I would expect.

My project is a Java / Gradle project and I cannot make a Groovy project out of it. Is there some other way to make IntelliJ aware of the .gdsl file and provide code completion?

like image 269
Michael Lihs Avatar asked Dec 09 '16 14:12

Michael Lihs


1 Answers

The problem was, that /src was not marked as a source root folder in my project. Creating a folder /src/main/groovy, putting the file in there and marking it as a sources root (right click on the folder -> Mark directory as -> Sources Root) did the trick.

like image 69
Michael Lihs Avatar answered Oct 09 '22 11:10

Michael Lihs