diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Kobalt.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Kobalt.kt index e736aab1..a64ecaef 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Kobalt.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Kobalt.kt @@ -5,6 +5,7 @@ import com.beust.kobalt.HostConfig import com.beust.kobalt.Plugins import com.google.inject.Injector import java.io.InputStream +import java.time.Duration import java.util.* public class Kobalt { @@ -34,8 +35,9 @@ public class Kobalt { if (repo.url.endsWith("/")) repo else repo.copy(url = (repo.url + "/"))) - private val PROPERTY_KOBALT_VERSION = "kobalt.version" private val KOBALT_PROPERTIES = "kobalt.properties" + private val PROPERTY_KOBALT_VERSION = "kobalt.version" + private val PROPERTY_KOBALT_VERSION_CHECK_TIMEOUT = "kobalt.version.check_timeout" // ISO-8601 /** kobalt.properties */ private val kobaltProperties: Properties by lazy { readProperties() } @@ -73,6 +75,7 @@ public class Kobalt { } val version = kobaltProperties.getProperty(PROPERTY_KOBALT_VERSION) + val versionCheckTimeout = Duration.parse(kobaltProperties.getProperty(PROPERTY_KOBALT_VERSION_CHECK_TIMEOUT)) fun findPlugin(name: String) = Plugins.findPlugin(name) } diff --git a/src/main/resources/kobalt.properties b/src/main/resources/kobalt.properties index 0f994c0b..182ef21c 100644 --- a/src/main/resources/kobalt.properties +++ b/src/main/resources/kobalt.properties @@ -1 +1,2 @@ kobalt.version=0.401 +kobalt.version.check_timeout=P1DT2H