You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:13:17 UTC
[sling-org-apache-sling-scripting-thymeleaf] 06/50: SLING-5351
Thymeleaf fails loading version from properties
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.scripting.thymeleaf-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-thymeleaf.git
commit 1c6067be1399f7950bf1f7bb51af13109c5a68b2
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Dec 3 22:44:44 2015 +0000
SLING-5351 Thymeleaf fails loading version from properties
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/thymeleaf@1717859 13f79535-47bb-0310-9956-ffa450edef68
---
.../thymeleaf/internal/ThymeleafScriptEngineFactory.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/sling/scripting/thymeleaf/internal/ThymeleafScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/thymeleaf/internal/ThymeleafScriptEngineFactory.java
index a374d22..a1afadd 100644
--- a/src/main/java/org/apache/sling/scripting/thymeleaf/internal/ThymeleafScriptEngineFactory.java
+++ b/src/main/java/org/apache/sling/scripting/thymeleaf/internal/ThymeleafScriptEngineFactory.java
@@ -42,7 +42,6 @@ import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.thymeleaf.TemplateEngine;
-import org.thymeleaf.Thymeleaf;
import org.thymeleaf.dialect.IDialect;
import org.thymeleaf.messageresolver.IMessageResolver;
import org.thymeleaf.standard.StandardDialect;
@@ -190,7 +189,13 @@ public final class ThymeleafScriptEngineFactory extends AbstractScriptEngineFact
@Override
public String getLanguageVersion() {
- return Thymeleaf.VERSION;
+ try {
+ final java.util.Properties properties = new java.util.Properties();
+ properties.load(getClass().getResourceAsStream("org/thymeleaf/thymeleaf.properties"));
+ return properties.getProperty("version");
+ } catch (Exception e) {
+ }
+ return "";
}
@Override
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.