jbang-idea icon indicating copy to clipboard operation
jbang-idea copied to clipboard

JBang Scripts Inside a Maven Project

Open aghasemi opened this issue 2 years ago • 2 comments
trafficstars

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

aghasemi avatar Oct 18 '23 11:10 aghasemi

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.

maxandersen avatar Oct 19 '23 22:10 maxandersen

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.

aghasemi avatar Oct 20 '23 09:10 aghasemi