How to debug Groovy Scripts loaded from the database?

I have a set of groovy scripts that I store in the database. I would like to debug those in my Intellij. I can download them to my local file system and  make sure that they compiled to the output directory.But still the source
binding does not happen. Can you please let me know on what I need to do to accomplish this.

3 comments

Hi Derek,

I'm afraid the problem is unclear - as far as I understand, you have a groovy script at local machine (it's original is not relevant, it might be created by hand; checked out from VCS; loaded from database etc) and the question is how to compile and debug it from the ide?

Denis

0

Apologies if the question is ambiguous. What I want is to debug groovy scripts. As part of debugging, the IDE should be able to bind a source file to the running code. In case of files stored in the file system, any IDE inclucing IDEA is able to make the connection and I can step in to the groovy script with my debugger.

But in case of scripts stored in the database, we are essentially loading  a script from a table column and we cannot by default, debug this groovy scripts. For this to work, I can create actual groovy script files by loading from the db at runtime, but how to do I tell the IDE, where to look for the source file I am loading from the database.

0

You can try to create a library and configure the *.groovy files as sources there. Then that library should be added as a dependency (direct or transitive) to your module. I believe that will make the trick.

Denis

0

Please sign in to leave a comment.