RE: Strange behaviour when using the Grab annotation

2024-01-06 Thread Bob Brown
I think that @Grab needs to be 'attached' to something like an import. The doco (https://groovy-lang.org/grape.html) says: """ Note that we are using an annotated import here, which is the recommended way. """ Take a look at: https://dzone.com/articles/groovy-and-jsch-sftp HTH BOB From: QuoƟ

Re: Strange behaviour when using the Grab annotation

2024-01-07 Thread Clemens Quoss
Hello Bob! Thanks for your answer. Yes, of course the right way would be to also use the 'grabbed' dependency in one way or the other. This test script of mine was for investigating what dependency in a large script of mine pulls in groovy-all:2.4.x making this script unusable with Groovy 4.

Re: Strange behaviour when using the Grab annotation

2024-01-08 Thread Paul King
If you look up the Javadoc for Grab, you will see that it can be on more things than just an import. It can be on a type, a method, a field, a local variable and so forth. It can't be used on a single statement. The suggestion for placing it on an import statement is really just a suggestion. It is