Michael Lihs
Michael Lihs

Reputation: 8220

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?

Upvotes: 36

Views: 22124

Answers (1)

Michael Lihs
Michael Lihs

Reputation: 8220

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.

Upvotes: 32

Related Questions