在IntelliJ的Java项目中使用.gdsl文件 [英] Use .gdsl file in a Java project in IntelliJ

查看:1420
本文介绍了在IntelliJ的Java项目中使用.gdsl文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含我的Jenkins Pipeline DSL语法的文件 pipeline.gdsl 。遵循此博客文章我将文件放入 / src 我的Java项目的文件夹。当我现在编辑我的 Jenkinsfile (驻留在我的项目的根文件夹中)时,我没有得到任何代码完成/语法解释,因为我期望。



我的项目是一个Java / Gradle项目,我无法制作一个Groovy项目。有没有其他的方法可以使IntelliJ知道 .gdsl 文件并提供代码完成?

解决方案

问题是, / src 在我的项目中未被标记为源根文件夹。创建一个文件夹 / src / main / groovy ,将文件放在那里并将其标记为源根目录(右键单击文件夹 - >将目录标记为 - > Sources Root )做到了这一招。


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?

解决方案

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.

这篇关于在IntelliJ的Java项目中使用.gdsl文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆