# lib.build/ Third-party jars needed by `build.xml`, checked in so a fresh clone on any machine can run `ant -lib lib.build "deploy(@local.sportrum.se)"` with nothing to download. See the comment above `` in `build.xml` for why a plain `classpathref` isn't always enough on its own (short version: Ant always loads its own `Scp`/`SSHExec` classes from whatever's already on Ant's own classpath — and if something else, like Debian/Ubuntu's `ant-optional` apt package, already put a different/older jsch there first, this project's own copy in `lib.build/` becomes invisible to it no matter what the project's own classpath says). **Command line: always use `-lib lib.build`.** Confirmed this is required whenever a system `ant-optional` package (or similar) is installed — that's the case for a plain apt-installed Ubuntu/Debian `ant`. Leaving it off fails fast with a clear message pointing back here, rather than a cryptic `NoClassDefFoundError`. **Eclipse: try it with no extra configuration first.** Whether this is needed in Eclipse depends entirely on whether that particular Eclipse install's bundled Ant distribution ships its own conflicting `ant-jsch.jar`. If yours hits `taskdef ... cannot be found: com/jcraft/jsch/Logger`, add `lib.build/jsch-*.jar` under Window -> Preferences -> Ant -> Runtime -> Classpath -> Ant Home Entries (same underlying fix as `-lib`, just via Eclipse's UI instead of a flag). Currently just: - `jsch-2.28.7.jar` — [com.github.mwiede/jsch](https://mvnrepository.com/artifact/com.github.mwiede/jsch), a maintained fork of the original com.jcraft:jsch (same package name, drop-in). Ant's ``/`` tasks need this on the classpath; the original jcraft version predates modern SSH key-exchange algorithms and fails against current OpenSSH defaults. Direct download: https://repo1.maven.org/maven2/com/github/mwiede/jsch/2.28.7/jsch-2.28.7.jar Same jar `xzpect-timer/lib.build/` uses — copied over rather than re-resolved, so both projects are pinned to an identical, already-tested version. If this ever needs a version bump, replace the jar here (and probably there too, for consistency) and update the filename/link above — nothing else in `build.xml` references the version number directly (it just loads every `*.jar` under this folder). ## Why not `ant-classloadertask`, like the sportrum webapp project? The sportrum webapp's own `build.xml` (its `release-all` target scps `sportrum.war`/`manager.zip` to the server) avoids needing `-lib` at all, via a third-party `` task that injects the jsch jar directly into Ant's own running core classloader. That trick only works on JDK 8 — it reflectively pokes `URLClassLoader.addURL()`, which stopped being how the JVM's application classloader works from JDK 9 onward. The webapp project gets away with it only because it's still built on JDK 8; xzpect-timer's `build.xml` tested this same approach directly against JDK 21 and confirmed it's a hard dead end there (see xzpect-timer's `lib.build/README.md` for the exact exceptions). This project (`sportrum-deploy`) deliberately follows xzpect-timer's `-lib`-based approach instead of the webapp's, even though it's deployed right alongside that JDK-8 webapp project: `ant deploy(@host)` here is a separate Ant invocation, and there's no guarantee it always runs under the same JDK as the webapp build — someone could easily run it from a newer default `ant` on their machine. The `-lib` approach works on any JDK, so it's the safer default here rather than inheriting an assumption tied to a different project's toolchain.