Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/jakarta el 8 #810

Closed
wants to merge 12 commits into from
25 changes: 25 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Java CI with Maven

on:
push:
branches:
- master
- feature/*
- bugfix/*
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn clean package -DskipTests --file pom.xml
80 changes: 47 additions & 33 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@
<description>Jinja templating engine implemented in Java</description>

<properties>
<basepom.check.skip-prettier>false</basepom.check.skip-prettier>
<jakarta.el.version>4.0.0</jakarta.el.version>
<jakarta.el.impl.version>4.0.2</jakarta.el.impl.version>
<basepom.check.skip-prettier>true</basepom.check.skip-prettier>
<dep.plugin.git.revision.skip>false</dep.plugin.git.revision.skip>

<dep.javassist.version>3.24.1-GA</dep.javassist.version>

<dep.plugin.jacoco.version>0.8.3</dep.plugin.jacoco.version>
<dep.plugin.versions.version>2.8.1</dep.plugin.versions.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -58,6 +62,16 @@
<artifactId>java-ipv6</artifactId>
<version>0.17</version>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>${jakarta.el.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<version>${jakarta.el.impl.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -79,12 +93,8 @@
<artifactId>jsoup</artifactId>
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-api</artifactId>
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-impl</artifactId>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.re2j</groupId>
Expand Down Expand Up @@ -155,6 +165,15 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${dep.plugin.versions.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
Expand Down Expand Up @@ -195,36 +214,31 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<!-- Remove basepom's stuff -->
<configuration combine.self="override" />
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<executions>
<execution>
<id>check-dependency-updates</id>
<goals>
<goal>shade</goal>
<goal>display-dependency-updates</goal>
</goals>
<phase>package</phase>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<shadedArtifactAttached>false</shadedArtifactAttached>
<artifactSet>
<includes>
<include>de.odysseus.juel:juel-api</include>
<include>de.odysseus.juel:juel-impl</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>javax.el</pattern>
<shadedPattern>jinjava.javax.el</shadedPattern>
</relocation>
<relocation>
<pattern>de.odysseus.el</pattern>
<shadedPattern>jinjava.de.odysseus.el</shadedPattern>
</relocation>
</relocations>
</configuration>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<configuration>
<skip>${dep.plugin.git.revision.skip}</skip>
</configuration>
<executions>
<execution>
<id>default</id>
<goals>
<goal>revision</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/hubspot/jinjava/Jinjava.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

import com.hubspot.jinjava.doc.JinjavaDoc;
import com.hubspot.jinjava.doc.JinjavaDocFactory;
import com.hubspot.jinjava.el.ExpressionFactoryImpl;
import com.hubspot.jinjava.el.ExtendedSyntaxBuilder;
import com.hubspot.jinjava.el.TruthyTypeConverter;
import com.hubspot.jinjava.el.ext.eager.EagerExtendedSyntaxBuilder;
import com.hubspot.jinjava.el.misc.TypeConverter;
import com.hubspot.jinjava.el.tree.TreeBuilder;
import com.hubspot.jinjava.interpret.Context;
import com.hubspot.jinjava.interpret.FatalTemplateErrorsException;
import com.hubspot.jinjava.interpret.InterpretException;
Expand All @@ -36,15 +39,12 @@
import com.hubspot.jinjava.lib.tag.Tag;
import com.hubspot.jinjava.loader.ClasspathResourceLocator;
import com.hubspot.jinjava.loader.ResourceLocator;
import de.odysseus.el.ExpressionFactoryImpl;
import de.odysseus.el.misc.TypeConverter;
import de.odysseus.el.tree.TreeBuilder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.stream.Collectors;
import javax.el.ExpressionFactory;
import jakarta.el.ExpressionFactory;

/**
* The main client API for the Jinjava library, instances of this class can be used to render jinja templates with a given map of context values. Example use:
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/hubspot/jinjava/JinjavaConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.hubspot.jinjava.random.RandomNumberGeneratorStrategy;
import com.hubspot.jinjava.tree.parse.DefaultTokenScannerSymbols;
import com.hubspot.jinjava.tree.parse.TokenScannerSymbols;
import jakarta.el.ELResolver;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.ZoneId;
Expand All @@ -35,7 +36,6 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.el.ELResolver;

public class JinjavaConfig {
private final Charset charset;
Expand Down
Loading