jbangdev / jbang-idea

IntelliJ IDEA plugin for JBang
https://plugins.jetbrains.com/plugin/18257-jbang
MIT License
20 stars 9 forks source link

JBang Scripts Inside a Maven Project #95

Open aghasemi opened 1 year ago

aghasemi commented 1 year ago

Hi,

I have a typical maven project that I can open and edit in IntelliJ. In this project, I have some utility scripts to e.g. upload files to a remote directory etc..

The problem is that the JBang IntelliJ plugin does not work with these individual scripts inside a Maven project: Dependencies added via //DEPS are not recognised, and autocomplete does not work unless I move the script to the project source directory (src/main/java - and then only for dependencies added in project's pom.xml).

Can the plugin handle such a situation, or I have to open scripts in a parallel IDE?

Thanks

maxandersen commented 1 year ago

They currently need to be in a sources directory. You can mark the folder they are in as one and it should work.

I agree it's not optimal and we should see if the classpath could be scope To just apply to the nearest sources dir instead of globally.

aghasemi commented 1 year ago

I see. Thanks for the clarification. Then I also need to replicate the dependencies between the Jbang script and the POM file of the main project, but it's ok.