These instructions assume you are using vscode for development as SDK is configured for it.
- Clone this repo and open the
javafolder in vscode. - Install the recommended extension pack "Extension Pack for Java"
- The extension will prompt you to install a JDK. Choose JDK version 11 (LTS).
- Download and install Maven.
- 👉 You may need to set up M2_HOME and/or additional environment variables manually.
- Once you have the extension and JDK installed, run
mvn test(see next section for test setup).
- Get a user token using the CLI command:
user show --verbose - Create a new environment variable
TEST_TUNNEL_TOKENwith a string value "Bearer ". - Create a new environment variable
TEST_TUNNEL_NAMEwith a value containing the name of the tunnel. - Optionally: set
TEST_TUNNEL_VERBOSE=1to enable verbose console logging during tests. - Use the CLI to host the tunnel.
- Run the tests with
mvn test, or run a single test withmvn test -Dtest=TunnelClientTests#connectClient
The Tunnels Java SDK is published as a GitHub package through a GitHub Action. Since the repo is shared by multiple language SDKs, the Java packages are distinguished with a tag of the form java-vX.Y.Z. See tags for examples.
Follow these steps to publish a new version of the Java package:
- Create a new release.
- Create a new tag in the
java-vX.Y.Zformat. The version needs to be greater than the latestjava-*version in the releases page. - Set the release title the same as the version tag. Increment the major, minor, or patch version from the latest release as appropriate.
- Publish the release.