Use .gdsl file in a Java project in IntelliJ

14,694

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.

Share:
14,694
Michael Lihs
Author by

Michael Lihs

Infrastructure consultant at Thoughtworks Infrastructure as Code with Terraform, Pulumi & tons of bash Build and test automation Backend development (recently Golang, Python) Previously: Robert Bosch GmbH, punkt.de GmbH University of Karlsruhe

Updated on June 07, 2022

Comments

  • Michael Lihs
    Michael Lihs almost 2 years

    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?