After some experience with gradle, I found out that when building a jar file, it didn’t add the libraries that were used to write code to this file. I saw on the forum that there are plugins or scripts using kotoroh, when building a gradle jar, download the libraries specified in dependencies and put them into a jar file along with the rest of the project, which when running the jar file makes it possible not to specify the paths to these most libraries. Do such things exist and where can one read about it?
1 answer
Found an option. In the build file I wrote the following:
group 'test' version '2.0' apply plugin: 'java' apply plugin: "application" mainClassName = "testpack.JClass" sourceCompatibility = 1.5 repositories { mavenCentral() } dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' compile 'org.seleniumhq.selenium:selenium-java:2.53.0' compile 'junit:junit:4.12' compile 'org.seleniumhq.selenium:selenium-chrome-driver:2.53.0' } jar { manifest { attributes "Main-Class": "$mainClassName" } from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA' } Suddenly, someone will come in handy ...
|