diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelAssembler.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelAssembler.java index 46e00197360..0b3fef2b74b 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelAssembler.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelAssembler.java @@ -304,7 +304,11 @@ public ModelAssembler addImport(URL url) { Objects.requireNonNull(url, "The provided url to ModelAssembler#addImport was null"); inputStreamModels.put(url.toExternalForm(), () -> { try { - return url.openStream(); + URLConnection connection = url.openConnection(); + if (properties.containsKey(ModelAssembler.DISABLE_JAR_CACHE)) { + connection.setUseCaches(false); + } + return connection.getInputStream(); } catch (IOException | UncheckedIOException e) { throw new ModelImportException("Unable to open Smithy model import URL: " + url.toExternalForm(), e); }