diff --git a/.travis.yml b/.travis.yml
index 0c67e8166..9392ffc75 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ addons:
language: java
jdk:
- - oraclejdk8
+ - openjdk8
- openjdk11
- openjdk12
diff --git a/docs/pom.xml b/docs/pom.xml
index 290b5f0af..1bcdb0146 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -5,7 +5,7 @@
io.pebbletemplatespebble-project
- 3.0.11-SNAPSHOT
+ 3.1.0-SNAPSHOTdocs
diff --git a/docs/src/orchid/resources/changelog/v3_1_0.md b/docs/src/orchid/resources/changelog/v3_1_0.md
new file mode 100644
index 000000000..355ac406f
--- /dev/null
+++ b/docs/src/orchid/resources/changelog/v3_1_0.md
@@ -0,0 +1,12 @@
+---
+version: '3.1.0'
+---
+
+- **BREAKING CHANGES**: Consider avoiding feature version in spring boot starter name (#459)
+- Upgrade spring boot integration to Spring Boot 2.1 (#460)
+- Allow override core operators (#455, #456)
+- Allows variables to be set in templates when provided context is an immutable map (#453)
+- Fixed a few typos in the docs (#452)
+- Remove unnecessary variable 'state' in LexerImpl by using Stack (#450)
+- Updates Orchid to 0.17.1 and fixes its breaking changes (#448)
+- Null value in a Map should not throw AttributeNotFoundException (#447, #446)
diff --git a/docs/src/orchid/resources/wiki/guide/spring-boot-integration.md b/docs/src/orchid/resources/wiki/guide/spring-boot-integration.md
index 78cb1672c..0ed841dab 100644
--- a/docs/src/orchid/resources/wiki/guide/spring-boot-integration.md
+++ b/docs/src/orchid/resources/wiki/guide/spring-boot-integration.md
@@ -7,7 +7,7 @@ Spring Boot starter for autoconfiguring Pebble as an MVC ViewResolver.
## Basic Usage
Add the starter dependency to your pom.xml:
-### spring-boot v1
+### spring-boot v2
```XML
io.pebbletemplates
@@ -20,17 +20,17 @@ Or build.gradle:
compile "io.pebbletemplates:pebble-spring-boot-starter:{{ site.version }}"
```
-### spring-boot v2
+### spring-boot v1
```XML
io.pebbletemplates
- pebble-spring-boot-2-starter
+ pebble-legacy-spring-boot-starter{{ site.version }}
```
Or build.gradle:
```groovy
-compile "io.pebbletemplates:pebble-spring-boot-2-starter:{{ site.version }}"
+compile "io.pebbletemplates:pebble-legacy-spring-boot-starter:{{ site.version }}"
```
This is enough for autoconfiguration to kick in. This includes:
diff --git a/pebble-spring/pebble-spring-boot-starter/CHANGELOG.md b/pebble-spring/pebble-legacy-spring-boot-starter/CHANGELOG.md
similarity index 100%
rename from pebble-spring/pebble-spring-boot-starter/CHANGELOG.md
rename to pebble-spring/pebble-legacy-spring-boot-starter/CHANGELOG.md
diff --git a/pebble-spring/pebble-spring-boot-2-starter/pom.xml b/pebble-spring/pebble-legacy-spring-boot-starter/pom.xml
similarity index 79%
rename from pebble-spring/pebble-spring-boot-2-starter/pom.xml
rename to pebble-spring/pebble-legacy-spring-boot-starter/pom.xml
index 7fd92aadb..83d624da9 100644
--- a/pebble-spring/pebble-spring-boot-2-starter/pom.xml
+++ b/pebble-spring/pebble-legacy-spring-boot-starter/pom.xml
@@ -1,20 +1,20 @@
-
+
4.0.0
- pebble-springio.pebbletemplates
- 3.0.11-SNAPSHOT
+ pebble-spring
+ 3.1.0-SNAPSHOT
- pebble-spring-boot-2-starter
+ pebble-legacy-spring-boot-starter
- Pebble Spring Boot 2 Starter
- Spring Boot 2 starter or Pebble Template Engine
+ Pebble Spring Boot Starter
+ Spring Boot starter for Pebble Template Enginehttp://pebbletemplates.io
- 2.0.1.RELEASE
+ 1.5.21.RELEASE
@@ -26,7 +26,7 @@
io.pebbletemplates
- pebble-spring5
+ pebble-spring4${project.version}
@@ -38,7 +38,7 @@
test
-
+
@@ -53,4 +53,4 @@
-
\ No newline at end of file
+
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java
similarity index 93%
rename from pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java
index 57ecbbc7a..c39977697 100644
--- a/pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java
+++ b/pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java
@@ -4,8 +4,8 @@
import com.mitchellbosecke.pebble.extension.Extension;
import com.mitchellbosecke.pebble.loader.ClasspathLoader;
import com.mitchellbosecke.pebble.loader.Loader;
-import com.mitchellbosecke.pebble.spring.PebbleViewResolver;
-import com.mitchellbosecke.pebble.spring.extension.SpringExtension;
+import com.mitchellbosecke.pebble.spring4.PebbleViewResolver;
+import com.mitchellbosecke.pebble.spring4.extension.SpringExtension;
import java.util.List;
import javax.servlet.Servlet;
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,7 +13,7 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
+import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -96,7 +96,7 @@ public static class PebbleViewResolverConfiguration {
@ConditionalOnMissingBean(name = "pebbleViewResolver")
public PebbleViewResolver pebbleViewResolver() {
PebbleViewResolver pvr = new PebbleViewResolver();
- this.properties.applyToMvcViewResolver(pvr);
+ this.properties.applyToViewResolver(pvr);
pvr.setPebbleEngine(this.pebbleEngine);
if (this.pebbleEngine.getLoader() instanceof ClasspathLoader) {
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleProperties.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleProperties.java
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleProperties.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleProperties.java
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java
similarity index 65%
rename from pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java
index 379a2d6b8..1435641f0 100644
--- a/pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java
+++ b/pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java
@@ -1,7 +1,9 @@
package com.mitchellbosecke.pebble.boot.autoconfigure;
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider;
+import org.springframework.boot.bind.RelaxedPropertyResolver;
import org.springframework.core.env.Environment;
+import org.springframework.core.env.PropertyResolver;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.ClassUtils;
@@ -11,8 +13,9 @@ public class PebbleTemplateAvailabilityProvider implements TemplateAvailabilityP
public boolean isTemplateAvailable(String view, Environment environment, ClassLoader classLoader,
ResourceLoader resourceLoader) {
if (ClassUtils.isPresent("com.mitchellbosecke.pebble.PebbleEngine", classLoader)) {
- String prefix = environment.getProperty("pebble.prefix", PebbleProperties.DEFAULT_PREFIX);
- String suffix = environment.getProperty("pebble.suffix", PebbleProperties.DEFAULT_SUFFIX);
+ PropertyResolver resolver = new RelaxedPropertyResolver(environment, "pebble.");
+ String prefix = resolver.getProperty("prefix", PebbleProperties.DEFAULT_PREFIX);
+ String suffix = resolver.getProperty("suffix", PebbleProperties.DEFAULT_SUFFIX);
return resourceLoader.getResource(prefix + view + suffix).exists();
}
return false;
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/package-info.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/package-info.java
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/package-info.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/package-info.java
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/main/resources/META-INF/spring.factories b/pebble-spring/pebble-legacy-spring-boot-starter/src/main/resources/META-INF/spring.factories
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/main/resources/META-INF/spring.factories
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/main/resources/META-INF/spring.factories
diff --git a/pebble-spring/pebble-legacy-spring-boot-starter/src/main/resources/META-INF/spring.provides b/pebble-spring/pebble-legacy-spring-boot-starter/src/main/resources/META-INF/spring.provides
new file mode 100644
index 000000000..65aecbb1d
--- /dev/null
+++ b/pebble-spring/pebble-legacy-spring-boot-starter/src/main/resources/META-INF/spring.provides
@@ -0,0 +1 @@
+provides: pebble,pebble-spring4
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java
similarity index 87%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java
index 699b801b6..a02caf2cf 100644
--- a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java
+++ b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java
@@ -30,14 +30,6 @@ public LocaleResolver localeResolver() {
return new AcceptHeaderLocaleResolver();
}
- @Bean
- public MessageSource messageSource() {
- ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
- messageSource.setBasename("messages");
- messageSource.setFallbackToSystemLocale(false);
- return messageSource;
- }
-
@Bean
public Extension testExtension() {
return new TestExtension();
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java
similarity index 90%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java
index 672b3782a..08792e1e2 100644
--- a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java
+++ b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java
@@ -1,6 +1,5 @@
package com.mitchellbosecke.pebble.boot;
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -12,15 +11,16 @@
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.http.MediaType;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT)
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = Application.class, webEnvironment=WebEnvironment.RANDOM_PORT)
public class ControllerTest {
@Autowired
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/Controllers.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/Controllers.java
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/Controllers.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/Controllers.java
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java
similarity index 85%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java
index 9ea36f50f..4f4ef0a27 100644
--- a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java
+++ b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java
@@ -7,9 +7,9 @@
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit4.SpringRunner;
-@RunWith(SpringJUnit4ClassRunner.class)
+@RunWith(SpringRunner.class)
@SpringBootTest(classes = NonWebApplication.class)
public class CoreTests {
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java
similarity index 87%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java
index 6b4216d00..bbfc12225 100644
--- a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java
+++ b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java
@@ -1,7 +1,6 @@
package com.mitchellbosecke.pebble.boot;
import org.springframework.boot.SpringApplication;
-import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.MessageSource;
@@ -12,9 +11,7 @@
public class NonWebApplication {
public static void main(String[] args) {
- SpringApplication sa = new SpringApplicationBuilder(NonWebApplication.class)
- .web(WebApplicationType.NONE)
- .build();
+ SpringApplication sa = new SpringApplicationBuilder(NonWebApplication.class).web(false).build();
sa.run(args);
}
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java
similarity index 91%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java
index 3bf919dd8..54d229963 100644
--- a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java
+++ b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java
@@ -9,7 +9,7 @@
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext;
+import org.springframework.boot.context.embedded.EmbeddedWebApplicationContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
@@ -60,9 +60,8 @@ private void scanPackage(ClassPathScanningCandidateComponentProvider componentPr
}
private boolean isRunningInEmbeddedContainer() {
- return this.applicationContext instanceof ServletWebServerApplicationContext
- && ((ServletWebServerApplicationContext) this.applicationContext).getServletContext()
- == null;
+ return this.applicationContext instanceof EmbeddedWebApplicationContext
+ && ((EmbeddedWebApplicationContext) this.applicationContext).getServletContext() == null;
}
private ClassPathScanningCandidateComponentProvider createComponentProvider() {
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentHandler.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentHandler.java
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentHandler.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentHandler.java
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentScan.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentScan.java
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentScan.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentScan.java
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentScanRegistrar.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentScanRegistrar.java
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentScanRegistrar.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponentScanRegistrar.java
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebFilterHandler.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebFilterHandler.java
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebFilterHandler.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebFilterHandler.java
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebListenerHandler.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebListenerHandler.java
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebListenerHandler.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebListenerHandler.java
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebServletHandler.java b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebServletHandler.java
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebServletHandler.java
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/WebServletHandler.java
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/resources/messages.properties b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/messages.properties
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/resources/messages.properties
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/messages.properties
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/resources/messages_es.properties b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/messages_es.properties
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/resources/messages_es.properties
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/messages_es.properties
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/resources/templates/contextPath.pebble b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/templates/contextPath.pebble
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/resources/templates/contextPath.pebble
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/templates/contextPath.pebble
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/resources/templates/extensions.pebble b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/templates/extensions.pebble
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/resources/templates/extensions.pebble
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/templates/extensions.pebble
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/resources/templates/hello.pebble b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/templates/hello.pebble
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/resources/templates/hello.pebble
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/templates/hello.pebble
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/test/resources/templates/index.pebble b/pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/templates/index.pebble
similarity index 100%
rename from pebble-spring/pebble-spring-boot-2-starter/src/test/resources/templates/index.pebble
rename to pebble-spring/pebble-legacy-spring-boot-starter/src/test/resources/templates/index.pebble
diff --git a/pebble-spring/pebble-spring-boot-2-starter/src/main/resources/META-INF/spring.provides b/pebble-spring/pebble-spring-boot-2-starter/src/main/resources/META-INF/spring.provides
deleted file mode 100644
index fa6b11812..000000000
--- a/pebble-spring/pebble-spring-boot-2-starter/src/main/resources/META-INF/spring.provides
+++ /dev/null
@@ -1 +0,0 @@
-provides: pebble,pebble-spring5
diff --git a/pebble-spring/pebble-spring-boot-starter/pom.xml b/pebble-spring/pebble-spring-boot-starter/pom.xml
index 15b3fbe11..552e29a8c 100644
--- a/pebble-spring/pebble-spring-boot-starter/pom.xml
+++ b/pebble-spring/pebble-spring-boot-starter/pom.xml
@@ -1,20 +1,20 @@
+
-
4.0.0
- io.pebbletemplatespebble-spring
- 3.0.11-SNAPSHOT
+ io.pebbletemplates
+ 3.1.0-SNAPSHOTpebble-spring-boot-starter
- Pebble Spring Boot Starter
- Spring Boot starter for Pebble Template Engine
+ Pebble Spring Boot 2 Starter
+ Spring Boot 2 starter or Pebble Template Enginehttp://pebbletemplates.io
- 1.5.21.RELEASE
+ 2.1.7.RELEASE
@@ -26,7 +26,7 @@
io.pebbletemplates
- pebble-spring4
+ pebble-spring5${project.version}
@@ -38,7 +38,7 @@
test
-
+
@@ -53,4 +53,4 @@
-
+
\ No newline at end of file
diff --git a/pebble-spring/pebble-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java b/pebble-spring/pebble-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java
index c39977697..57ecbbc7a 100644
--- a/pebble-spring/pebble-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java
+++ b/pebble-spring/pebble-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleAutoConfiguration.java
@@ -4,8 +4,8 @@
import com.mitchellbosecke.pebble.extension.Extension;
import com.mitchellbosecke.pebble.loader.ClasspathLoader;
import com.mitchellbosecke.pebble.loader.Loader;
-import com.mitchellbosecke.pebble.spring4.PebbleViewResolver;
-import com.mitchellbosecke.pebble.spring4.extension.SpringExtension;
+import com.mitchellbosecke.pebble.spring.PebbleViewResolver;
+import com.mitchellbosecke.pebble.spring.extension.SpringExtension;
import java.util.List;
import javax.servlet.Servlet;
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,7 +13,7 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
+import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -96,7 +96,7 @@ public static class PebbleViewResolverConfiguration {
@ConditionalOnMissingBean(name = "pebbleViewResolver")
public PebbleViewResolver pebbleViewResolver() {
PebbleViewResolver pvr = new PebbleViewResolver();
- this.properties.applyToViewResolver(pvr);
+ this.properties.applyToMvcViewResolver(pvr);
pvr.setPebbleEngine(this.pebbleEngine);
if (this.pebbleEngine.getLoader() instanceof ClasspathLoader) {
diff --git a/pebble-spring/pebble-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java b/pebble-spring/pebble-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java
index 1435641f0..379a2d6b8 100644
--- a/pebble-spring/pebble-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java
+++ b/pebble-spring/pebble-spring-boot-starter/src/main/java/com/mitchellbosecke/pebble/boot/autoconfigure/PebbleTemplateAvailabilityProvider.java
@@ -1,9 +1,7 @@
package com.mitchellbosecke.pebble.boot.autoconfigure;
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider;
-import org.springframework.boot.bind.RelaxedPropertyResolver;
import org.springframework.core.env.Environment;
-import org.springframework.core.env.PropertyResolver;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.ClassUtils;
@@ -13,9 +11,8 @@ public class PebbleTemplateAvailabilityProvider implements TemplateAvailabilityP
public boolean isTemplateAvailable(String view, Environment environment, ClassLoader classLoader,
ResourceLoader resourceLoader) {
if (ClassUtils.isPresent("com.mitchellbosecke.pebble.PebbleEngine", classLoader)) {
- PropertyResolver resolver = new RelaxedPropertyResolver(environment, "pebble.");
- String prefix = resolver.getProperty("prefix", PebbleProperties.DEFAULT_PREFIX);
- String suffix = resolver.getProperty("suffix", PebbleProperties.DEFAULT_SUFFIX);
+ String prefix = environment.getProperty("pebble.prefix", PebbleProperties.DEFAULT_PREFIX);
+ String suffix = environment.getProperty("pebble.suffix", PebbleProperties.DEFAULT_SUFFIX);
return resourceLoader.getResource(prefix + view + suffix).exists();
}
return false;
diff --git a/pebble-spring/pebble-spring-boot-starter/src/main/resources/META-INF/spring.provides b/pebble-spring/pebble-spring-boot-starter/src/main/resources/META-INF/spring.provides
index 65aecbb1d..fa6b11812 100644
--- a/pebble-spring/pebble-spring-boot-starter/src/main/resources/META-INF/spring.provides
+++ b/pebble-spring/pebble-spring-boot-starter/src/main/resources/META-INF/spring.provides
@@ -1 +1 @@
-provides: pebble,pebble-spring4
+provides: pebble,pebble-spring5
diff --git a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java
index 699b801b6..a02caf2cf 100644
--- a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java
+++ b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/Application.java
@@ -30,14 +30,6 @@ public LocaleResolver localeResolver() {
return new AcceptHeaderLocaleResolver();
}
- @Bean
- public MessageSource messageSource() {
- ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
- messageSource.setBasename("messages");
- messageSource.setFallbackToSystemLocale(false);
- return messageSource;
- }
-
@Bean
public Extension testExtension() {
return new TestExtension();
diff --git a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java
index 08792e1e2..672b3782a 100644
--- a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java
+++ b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ControllerTest.java
@@ -1,5 +1,6 @@
package com.mitchellbosecke.pebble.boot;
+import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -11,16 +12,15 @@
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.http.MediaType;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class, webEnvironment=WebEnvironment.RANDOM_PORT)
+@RunWith(SpringJUnit4ClassRunner.class)
+@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT)
public class ControllerTest {
@Autowired
diff --git a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java
index 4f4ef0a27..9ea36f50f 100644
--- a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java
+++ b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/CoreTests.java
@@ -7,9 +7,9 @@
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-@RunWith(SpringRunner.class)
+@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = NonWebApplication.class)
public class CoreTests {
diff --git a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java
index bbfc12225..6b4216d00 100644
--- a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java
+++ b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/NonWebApplication.java
@@ -1,6 +1,7 @@
package com.mitchellbosecke.pebble.boot;
import org.springframework.boot.SpringApplication;
+import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.MessageSource;
@@ -11,7 +12,9 @@
public class NonWebApplication {
public static void main(String[] args) {
- SpringApplication sa = new SpringApplicationBuilder(NonWebApplication.class).web(false).build();
+ SpringApplication sa = new SpringApplicationBuilder(NonWebApplication.class)
+ .web(WebApplicationType.NONE)
+ .build();
sa.run(args);
}
diff --git a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java
index 54d229963..3bf919dd8 100644
--- a/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java
+++ b/pebble-spring/pebble-spring-boot-starter/src/test/java/com/mitchellbosecke/pebble/boot/ServletComponenRegisteringPostProcessor.java
@@ -9,7 +9,7 @@
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-import org.springframework.boot.context.embedded.EmbeddedWebApplicationContext;
+import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
@@ -60,8 +60,9 @@ private void scanPackage(ClassPathScanningCandidateComponentProvider componentPr
}
private boolean isRunningInEmbeddedContainer() {
- return this.applicationContext instanceof EmbeddedWebApplicationContext
- && ((EmbeddedWebApplicationContext) this.applicationContext).getServletContext() == null;
+ return this.applicationContext instanceof ServletWebServerApplicationContext
+ && ((ServletWebServerApplicationContext) this.applicationContext).getServletContext()
+ == null;
}
private ClassPathScanningCandidateComponentProvider createComponentProvider() {
diff --git a/pebble-spring/pebble-spring3/pom.xml b/pebble-spring/pebble-spring3/pom.xml
deleted file mode 100644
index 9824dd6f4..000000000
--- a/pebble-spring/pebble-spring3/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
- 4.0.0
-
- io.pebbletemplates
- pebble-spring
- 3.0.11-SNAPSHOT
-
-
- pebble-spring3
-
- Pebble Integration with Spring 3
- Pebble Integration with Spring 3
- http://pebbletemplates.io
-
-
- 3.0.1
- 3.2.13.RELEASE
-
-
-
-
-
- org.springframework
- spring-framework-bom
- ${spring-framework.version}
- pom
- import
-
-
-
-
-
-
- io.pebbletemplates
- pebble
-
-
- javax.servlet
- javax.servlet-api
- ${servlet-api.version}
- provided
-
-
- org.springframework
- spring-webmvc
- provided
-
-
-
-
- org.springframework
- spring-test
- test
-
-
- org.mockito
- mockito-core
- test
-
-
- junit
- junit
- test
-
-
-
-
-
-
- maven-jar-plugin
-
-
-
- io.pebbletemplates.spring
-
-
-
-
-
-
-
diff --git a/pebble-spring/pebble-spring3/src/main/java/com/mitchellbosecke/pebble/spring/PebbleView.java b/pebble-spring/pebble-spring3/src/main/java/com/mitchellbosecke/pebble/spring/PebbleView.java
deleted file mode 100644
index f9eb6431a..000000000
--- a/pebble-spring/pebble-spring3/src/main/java/com/mitchellbosecke/pebble/spring/PebbleView.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2013 by Mitchell Bösecke
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-package com.mitchellbosecke.pebble.spring;
-
-import com.mitchellbosecke.pebble.PebbleEngine;
-import com.mitchellbosecke.pebble.error.PebbleException;
-import com.mitchellbosecke.pebble.spring.context.Beans;
-import com.mitchellbosecke.pebble.template.PebbleTemplate;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Locale;
-import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.servlet.support.RequestContextUtils;
-import org.springframework.web.servlet.view.AbstractTemplateView;
-
-public class PebbleView extends AbstractTemplateView {
-
- public static final String REQUEST_VARIABLE_NAME = "request";
- public static final String RESPONSE_VARIABLE_NAME = "response";
- public static final String SESSION_VARIABLE_NAME = "session";
-
- private static final String BEANS_VARIABLE_NAME = "beans";
- private static final int NANO_PER_SECOND = 1000000;
- /**
- *
- * TIMER logger. This logger will output the time required for executing each template processing
- * operation.
- *
- *
- * The value of this constant is
- * com.mitchellbosecke.pebble.spring.PebbleView.timer. This allows
- * you to set a specific configuration and/or appenders for timing info at your logging system
- * configuration.
- *