Skip to content
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

Groovy plugin classpath not loading files in the same directory #183

Open
jordanrobinson opened this issue Jul 4, 2024 · 0 comments
Open

Comments

@jordanrobinson
Copy link

Hi there, first off thanks so much for your excellent plugin.

I've been having an issue with live plugins when they use other Groovy scripts in the same directory. For example, in the situation where there is this folder structure:

2024-07-04_09-47-40@2x

Where plugin.groovy is

import com.intellij.openapi.diagnostic.Logger
import static liveplugin.PluginUtil.*

import globals

if (isIdeStartup) return

show("isIdeStartup: $isIdeStartup")
show("project: $project")
show("pluginDisposable: $pluginDisposable")
show("pluginPath: $pluginPath")

show(globals.example)

and globals.groovy being

class globals {
    static String example = "example-import-fail-replication"
}

I get the error

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:file:/Users/jordanrobinson/example/.live-plugins/hello-world-test/plugin.groovy: 4: unable to resolve class globals @ line 4, column 1.   import globals   ^1 error
	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
... stack trace ...

If I specify adding it to the classpath in the form

// add-to-classpath /Users/jordanrobinson/example/.live-plugins/hello-world-test/

This works fine, but this isn't really a workable solution as my team currently have a few live plugins with various files and most people on the team do not have this issue, while 3-4 people do.

I've tried quite a few things so far but I'm at a bit of a loss as to what to try next. Please do let me know if there's anything more I can add that would be helpful.

Versions:
GoLand 2024.1.3 GO-241.17890.21
LivePlugin 0.8.8 beta
macOS Sonoma 14.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant