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

Merges changes from commons-ognl and cleans up code #155

Merged
merged 11 commits into from
Sep 1, 2022
  •  
  •  
  •  
18 changes: 8 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: org.apache.maven:maven-compat
versions:
- 3.8.1
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
40 changes: 24 additions & 16 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,34 @@

name: Java CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 11, 17 ]
java: [ '8', '11', '17' ]
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/cache@v2.1.4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: ${{ matrix.java }}
- name: Build with Maven on Java ${{ matrix.java }}
run: mvn -V test -Ddoclint=all --file pom.xml --no-transfer-progress
- uses: actions/checkout@v2.3.4
- uses: actions/cache@v2.1.4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: ${{ matrix.java }}
- name: Build with Maven on Java ${{ matrix.java }}
if: matrix.java != '11'
run: mvn -V test -Ddoclint=all --file pom.xml --no-transfer-progress
- name: Code coverage
if: matrix.java == '11'
run: mvn -V test -Ddoclint=all -Pcoverage --file pom.xml --no-transfer-progress
5 changes: 2 additions & 3 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ import ognl.Ognl;
import ognl.OgnlContext;

public class OgnlExpression {

private Object expression;

public OgnlExpression(String expressionString) throws OgnlException {
expression = Ognl.parseExpression(expressionString);
}

public Object getExpression()
{
public Object getExpression() {
return expression;
}

Expand Down
110 changes: 66 additions & 44 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -10,7 +11,7 @@
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<packaging>jar</packaging>
<version>3.3.4-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
<name>OGNL - Object Graph Navigation Library</name>
<description>OGNL - Object Graph Navigation Library</description>

Expand All @@ -32,14 +33,9 @@
<developerConnection>scm:git:git@github.com:jkuhnert/ognl.git</developerConnection>
</scm>

<organization>
<name>OpenSymphony</name>
<url>http://www.opensymphony.com</url>
</organization>

<issueManagement>
<system>jira</system>
<url>http://jira.opensymphony.com/browse/OGNL</url>
<system>Github Issues</system>
<url>https://github.com/jkuhnert/ognl/issues</url>
</issueManagement>

<developers>
Expand Down Expand Up @@ -99,7 +95,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version> <!-- Most recent 2.x available -->
<version>2.22.2</version>
<configuration>
<includes>
<include>**/*Test.java</include>
Expand Down Expand Up @@ -151,6 +147,9 @@
<index>true</index>
</archive>
<source>1.8</source>
<sourceFileExcludes>
<fileExclude>**/target/generated-sources/**/*.java</fileExclude>
</sourceFileExcludes>
<links>
<link>https://docs.oracle.com/javase/8/docs/api/</link>
</links>
Expand All @@ -166,7 +165,32 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.2.0</version> <!-- Most recent 2.x available -->
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javacc-maven-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>ognl-jjtree</id>
<phase>generate-sources</phase>
<configuration>
<outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
<packageName>ognl</packageName>
<!-- Uncomment if AST files needs to be generated
<nodePackage>*.jtree</nodePackage>
-->
<!-- Uncomment if visitor default implementation needs to be generated
<visitor>true</visitor>
-->
</configuration>
<goals>
<!-- change goal to jtree-javacc to generate AST too -->
<goal>javacc</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

Expand All @@ -175,39 +199,6 @@
</build>

<profiles>
<profile>
<id>javacc-generate</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<java classname="org.javacc.jjtree.Main" fork="true">
<arg value="-OUTPUT_DIRECTORY=${project.build.sourceDirectory}/ognl" />
<arg value="${project.basedir}/src/etc/ognl.jjt" />
</java>

<java classname="org.javacc.parser.Main" fork="true">
<arg value="-OUTPUT_DIRECTORY=${project.build.sourceDirectory}/ognl" />
<arg value="${project.basedir}/src/etc/ognl.jj" />
</java>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jdk17</id>
<activation>
Expand All @@ -232,6 +223,37 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Loading