Search code examples
javagradlenetbeansgradle-shadow-plugin

NetBeans Gradle shadow dependency not added at runtime


I've imported a Gradle project into NetBeans 12.4. This project uses shadow plugin and sets the JDBC driver as a shadow excluded dependency:

shadow files('lib/sqljdbc.jar')

When I hit the Run or Debug button in NetBeans, the program fails when trying to load the JDBC driver. How can I tell NetBeans or Gradle to include "shadow" dependencies when running?


Solution

  • In the file "gradle.properties", add the following line:

    action.run.args=runShadow ${javaExec.jvmArgs} ${javaExec.args}