Reputation: 16085
I need to execute an external Java application as part of a Gradle build process. The external application needs the same JARs in its classpath as the application Gradle is building. Is there any way to expose the dependencies I have defined in Gradle to the external application?
i.e. I need to run this:
java -jar -cp [jars from Gradle] myapp.jar
Upvotes: 0
Views: 876
Reputation: 13466
You could add a simple task to your build to get the resulting classpath.
task printClasspath << {
println configurations.runtime.asPath
}
Upvotes: 2