I am trying to generate a JAR (salesforce-soap-connection.jar) file that I want to use as a dependency (library) in my project. Currently, I generate this jar file using the command below and then push the generated jar file in my repo.
java -classpath ./sf/force-wsc-45.0.0.jar:./sf/js-1.7R2.jar:./sf/ST4-4.3.1.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/lib/tools.jar:./sf/antlr-4.7.2-complete.jar com.sforce.ws.tools.wsdlc ./sf/enterprise.wsdl ./sf/salesforce-soap-connection.jar
Basically, I want to do this using Gradle. (Instead of running the above command, do exactly what the command does using Gradle)
The jar files that are used in the above command should be downloaded from maven repository and only enterprise.wsdl will be present in project/src/main/resources folder.
The generated jar file should be kept in project/lib folder.
This is my build.gradle file. Please suggest what to do next…
plugins {
id 'scala'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.scala-lang:scala-library:2.11.8'
implementation 'joda-time:joda-time:2.1'
implementation 'org.joda:joda-convert:2.1.1'
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'org.apache.logging.log4j:log4j-api:2.6.2'
implementation 'org.apache.logging.log4j:log4j-core:2.6.2'
implementation 'com.google.cloud:google-cloud-storage:1.52.0'
implementation 'com.google.cloud:google-cloud-bigquery:1.110.0'
implementation 'org.jooq:jooq:3.12.0'
implementation 'org.jooq:jooq-scala_2.11:3.10.5'
implementation 'com.google.apis:google-api-services-bigquery:v2-rev459-1.25.0'
implementation 'org.json:json:20180813'
implementation 'com.google.code.gson:gson:2.8.3'
implementation 'org.yaml:snakeyaml:1.25'
implementation 'com.github.tototoshi:scala-csv_2.11:1.3.6'
implementation 'org.json4s:json4s-native_2.11:3.6.10'
implementation 'org.apache.commons:commons-dbcp2:2.0.1'
implementation 'commons-io:commons-io:2.6'
implementation fileTree('lib')
}
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes "Main-Class": "com.org.loader.main"
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}