-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic dependency/classpath handling with maven #26
Comments
Let me take this issue to the maintainers of the groovy language server, as that is where the logic for the jars is held. |
You said: "It would be nice if adding every JAR file would not be required" You can also just set a directory, instead of each individual jar file. Like this in your vscode settings: "groovy.classpath": [
"/home/shadycuz/repos/dsty/jenkins-std-lib/build/dependencies"
], |
Is it supposed to recurse into subdirectories? I tried and kept getting the same errors. It only seemed to load the immediate JARs from that directory. |
Correct, It only reads jars from the parent directories. Would recursion fix the issue for you? |
I don't think so, because maven cache contains many different versions of everything. Versions are project specific and defined in the pom.xml. |
oh I see @mdealer Thanks |
I was also struggling with this (still am!) - I am trying to setup a groovy scripting environment for my java based application framework in VS Code. I use gradle for dependency management. I have a working gradle groovy project that builds the code (on the command line and in vscode: I thought I could automatically update the task updateGroovyClasspath {
doLast {
def javaDeps = configurations.runtimeClasspath.files.collect { "$it" }
def f = file("../.vscode/settings.json")
def builder = new JsonBuilder(new JsonSlurper().parse(f))
builder.content['groovy.classpath'] = javaDeps
f.write(builder.toPrettyString())
}
}
compileGroovy {
dependsOn updateGroovyClasspath
}
This works (at least I see lots of dependencies now in the settings), but the |
Good work so far, this extension looks promising.
But, I have a maven Groovy project (Jenkins shared library) and there are around 14000 files in the maven repo cache with direct and indirect dependencies of various versions of Jenkins and their plugins. It would be nice if adding every JAR file would not be required and the extension would detect maven and use its repo cache and searched it for the required JARs.
Right now I am facing many java.lang.NoClassDefFoundError or squiggly lines everywhere. All in all I think it's around 10-50 JARs, but it's cumbersome to adjust the list in extension settings as soon as a dependency tree changes versions.
The text was updated successfully, but these errors were encountered: