Skip to content

Instantly share code, notes, and snippets.

@pozil
Last active March 1, 2022 13:57
Show Gist options
  • Save pozil/7f553c2fda488492ec8f86821cc66a97 to your computer and use it in GitHub Desktop.
Save pozil/7f553c2fda488492ec8f86821cc66a97 to your computer and use it in GitHub Desktop.
Build JAR files with WSC from WSDL files
#!/bin/sh
API_VERSION=54.0.0
WSC_VERSION=54.0.0
echo "Building Salesforce API Jars for version $API_VERSION"
echo "Using WSC version $WSC_VERSION"
# Prepare directories
rm -fr wsc
rm -fr build
mkdir build
git clone https://github.com/forcedotcom/wsc.git
cd wsc
# Build JAR files
mvn clean package -Dgpg.skip -DskipTests
java -jar target/force-wsc-$WSC_VERSION-uber.jar ../partner-$API_VERSION.wsdl ../build/force-partner-$API_VERSION.jar
java -jar target/force-wsc-$WSC_VERSION-uber.jar ../enterprise-$API_VERSION.wsdl ../build/force-enterprise-$API_VERSION.jar
java -jar target/force-wsc-$WSC_VERSION-uber.jar ../metadata-$API_VERSION.wsdl ../build/force-metadata-$API_VERSION.jar
cp target/force-wsc-$WSC_VERSION.jar ../build/.

This script lets you build JAR files with WSC from Salesforce WSDL files.

  1. Create a new directory and place this shell file in the directory.
  2. Obtain the Enterprise, Partner and Metadata WSDL files from your Salesforce org and place them in the folder.
  3. Run the build-jars.sh script.
  4. Grab the JAR files from the build directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment