Removing dependencies from classpath

I am kind of hacking gradle to let me publish sql resources to artifactory. I am publishing sql scripts as jar files so I can declare the scripts as dependencies. (BTW I think there should be a gradle feature that allows publisihng/consuming non-java dependencies)

When I declare dependencies like this:

testRuntime(group: 'com.softwareag.db.cdbs', name: 'mssql-analysis', version: 'latest.milestone')

this allows me to find the jar file on disk and unzip it for use.

However, I do not want these dependencies to be added to the classpath when running tests (windows classpath too long issues).

Is there a way I can apply a pattern to not put any dependency in the classpath for test execution and IDE generation that has ‘com.softwareag.db.cdbs’ in it?

thanks! phil

Have you tried something like

configurations {
  dependencies {
  forSql 'com.softwareag.db.cdbs:mssql-analysis:latest.milestone'

Now it will not appear on classpath when runnign tests, but you can still get hold of all of the files via ‘project.configurations.forSql.files’

Lol… this is exactly what occurred to me about 5 mins ago!

Giving it a go right now, I’ll report my results.