java.lang.Object
io.github.flink.gcp.connector.testutils.sql.ShadedJar

@Internal public final class ShadedJar extends Object
Locates the uber-jar a flink-sql-connector-gcp-* module builds, for the tests that inspect or run against it.

The two things that differ between those modules — the artifact id and the prefix every bundled package is relocated under — are this type's whole state; everything else about finding and describing the jar is the same for all of them.

  • Method Details

    • of

      public static ShadedJar of(String artifactId, String shadedPrefix)
      Parameters:
      artifactId - the module's artifact id, e.g. flink-sql-connector-gcp-pubsub
      shadedPrefix - the relocation prefix in slash form with a trailing slash, e.g. io/github/flink/gcp/connector/pubsub/shaded/
    • shadedPrefix

      public String shadedPrefix()
      The prefix this module's relocations move every bundled package under, in slash form.
    • shadedPackagePrefix

      public String shadedPackagePrefix()
      The same prefix in dot form, as it appears in class names and SPI file names.
    • path

      public Path path() throws IOException
      Returns the shaded jar in target/.

      Found by listing rather than by interpolating ${project.version}, so a version bump does not have to be made here too. The integration-test phase runs after package, so the jar is present by the time any caller runs.

      The shade plugin leaves the pre-shade jar beside the shaded one as original-<name>.jar. It is excluded by the startsWith below rather than by a rule of its own — worth knowing before reordering that predicate, because nothing else keeps the unshaded jar out and every assertion built on this would then be about the wrong file.

      Two matches means a stale jar from an earlier version is still in target/; run mvn clean.

      Throws:
      IOException
    • basedir

      public static Path basedir()
      The calling module's base directory.

      Resolved from the project.basedir system property the connector parent's surefire configuration sets, rather than from the working directory: the integration-test execution forks, and a relative path does not resolve there. Normalized, because Path.toAbsolutePath() does not remove a leading . and Path.equals(java.lang.Object) compares name elements — so an unnormalized fallback path could never equal a code-source location it in fact points at.

    • targetDir

      public static Path targetDir()
      The calling module's target/ directory.