Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Jan 26, 2023
2 parents 80013cc + 95c5c20 commit d5d4033
Show file tree
Hide file tree
Showing 26 changed files with 468 additions and 97 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
2 changes: 1 addition & 1 deletion .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [8, 11, 17]
java: [11, 17]
os: [ubuntu-latest]
distribution: [temurin]
include:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Deploy snapshots to Sonatpe OSS repository and deploy site to GitHub Pages
# Deploy snapshots to Sonatype OSS repository and deploy site to GitHub Pages

name: Deploy

Expand All @@ -15,19 +15,19 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Configure GIT
run: |
git config --global user.email "${{ secrets.GH_SITE_DEPLOY_EMAIL }}"
git config --global user.name "${{ secrets.GH_SITE_DEPLOY_NAME }}"
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
cache: 'maven'
java-version: 11
cache: maven

- name: Build, verify, deploy, generate site
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
with:
body: 'Changes: https://wcm.io/tooling/maven/plugins/i18n-maven-plugin/changes-report.html'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<img src="https://wcm.io/images/favicon-16@2x.png"/> i18n-maven-plugin
======
[![Build](https://github.com/wcm-io/io.wcm.maven.plugins.i18n-maven-plugin/workflows/Build/badge.svg?branch=develop)](https://github.com/wcm-io/io.wcm.maven.plugins.i18n-maven-plugin/actions?query=workflow%3ABuild+branch%3Adevelop)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.wcm.maven.plugins/i18n-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.wcm.maven.plugins/i18n-maven-plugin)
[![Maven Central](https://img.shields.io/maven-central/v/io.wcm.maven.plugins/i18n-maven-plugin)](https://repo1.maven.org/maven2/io/wcm/maven/plugins/i18n-maven-plugin)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=wcm-io_io.wcm.maven.plugins.i18n-maven-plugin&metric=coverage)](https://sonarcloud.io/summary/new_code?id=wcm-io_io.wcm.maven.plugins.i18n-maven-plugin)

Transforms and validates i18n resources for usage in Sling/AEM applications.

Documentation: https://wcm.io/tooling/maven/plugins/i18n-maven-plugin/<br/>
Issues: https://wcm-io.atlassian.net/browse/WTOOL<br/>
Issues: https://github.com/wcm-io/io.wcm.maven.plugins.i18n-maven-plugin/issues<br/>
Wiki: https://wcm-io.atlassian.net/wiki/<br/>
Continuous Integration: https://github.com/wcm-io/io.wcm.maven.plugins.i18n-maven-plugin/actions<br/>
Commercial support: https://wcm.io/commercial-support.html
Expand Down
12 changes: 12 additions & 0 deletions changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
<body>

<release version="1.3.0" date="2023-01-26">
<action type="add" dev="sseifert" issue="9">
Introduce new output format JSON_PROPERTIES: Flat list of key/value pairs in JSON format.
</action>
<action type="update" dev="sseifert" issue="8">
Switch from org.apache.sling.commons.json to Johnzon (javax.json).
</action>
<action type="update" dev="sseifert">
Switch to Java 11 as minimum version.
</action>
</release>

<release version="1.2.2" date="2022-01-27">
<action type="update" dev="sseifert">
Declare Maven core dependencies as provided.
Expand Down
73 changes: 59 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm.maven</groupId>
<artifactId>io.wcm.maven.parent</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
<relativePath />
</parent>

<groupId>io.wcm.maven.plugins</groupId>
<artifactId>i18n-maven-plugin</artifactId>
<version>1.2.2</version>
<version>1.3.0</version>
<packaging>maven-plugin</packaging>

<name>i18n Maven Plugin</name>
Expand All @@ -50,7 +50,7 @@
<maven.version>3.0.5</maven.version>

<!-- Enable reproducible builds -->
<project.build.outputTimestamp>2022-01-27T09:09:40Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2023-01-26T09:06:49Z</project.build.outputTimestamp>

<!-- Enable recording of coverage during execution of maven-invoker-plugin -->
<jacoco.propertyName>invoker.mavenOpts</jacoco.propertyName>
Expand Down Expand Up @@ -90,7 +90,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>2.0.6</version>
<version>3.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -106,9 +106,15 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.json</artifactId>
<version>2.0.18</version>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-json_1.1_spec</artifactId>
<version>1.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
<version>1.2.19</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -136,19 +142,19 @@
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>2.9.0</version>
<version>2.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-legacy</artifactId>
<version>2.9.0</version>
<version>2.9.1</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -180,35 +186,74 @@
</executions>
</plugin>

<plugin>
<!-- Merge Jacoco results from unit tests and integration tests -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>before-unit-test-execution</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</destFile>
<propertyName>surefire.jacoco.args</propertyName>
</configuration>
</execution>
<execution>
<id>before-integration-test-execution</id>
<goals>
<goal>prepare-agent-integration</goal>
<goal>report</goal>
<goal>report-integration</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</destFile>
<propertyName>invoker.jacoco.args</propertyName>
</configuration>
</execution>
<execution>
<id>merge-unit-and-integration</id>
<phase>post-integration-test</phase>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<directory>${project.build.directory}/jacoco-output</directory>
<includes>
<include>*.exec</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.jacoco.args}</argLine>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<projectsDirectory>src/it</projectsDirectory>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<pomIncludes>
<pomInclude>**/pom.xml</pomInclude>
<pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
<postBuildHookScript>verify</postBuildHookScript>
<streamLogsOnFailures>true</streamLogsOnFailures>
<extraArtifacts>
<extraArtifact>org.jacoco:org.jacoco.agent:${jacoco-maven-plugin.version}:jar:runtime</extraArtifact>
</extraArtifacts>
<mavenOpts>${invoker.jacoco.args}</mavenOpts>
</configuration>
<executions>
<execution>
Expand Down
1 change: 1 addition & 0 deletions src/it/json-to-json-properties/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals = clean verify
92 changes: 92 additions & 0 deletions src/it/json-to-json-properties/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
wcm.io
%%
Copyright (C) 2022 wcm.io
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%
-->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.wcm.maven</groupId>
<artifactId>io.wcm.maven.aem-global-parent</artifactId>
<version>2.0.0</version>
<relativePath/>
</parent>

<groupId>io.wcm.maven.plugins.it</groupId>
<artifactId>i18n-maven-plugin-json-to-json</artifactId>
<version>1.0.0-SNAPSHOT</version>

<properties>
<!-- Java version -->
<java.version>11</java.version>
</properties>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<!-- those resources are processed by the i18n-maven-plugin -->
<exclude>i18n/**</exclude>
</excludes>
</resource>
</resources>
<plugins>

<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd>
Sling-Initial-Content: SLING-INF/app-root;overwrite:=true;ignoreImportProviders:=xml;path:=/apps/integration-test
</bnd>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>

<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<goals>
<goal>transform</goal>
</goals>
<configuration>
<outputFormat>json_properties</outputFormat>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"key1": "value1",
"key21": {
"key22": {
"key23": "value 2"
}
}
}
11 changes: 11 additions & 0 deletions src/it/json-to-json-properties/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import groovy.json.JsonSlurper

File jsonFile = new File(basedir, "target/classes/SLING-INF/app-root/i18n/en.json")
assert jsonFile.exists();

def json = new JsonSlurper().parseText(jsonFile.getText("utf-8"))

assert json["key1"] == "value1"
assert json["key21.key22.key23"] == "value 2"

return true;
3 changes: 1 addition & 2 deletions src/it/json-to-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@

<properties>
<!-- Java version -->
<java.version>1.8</java.version>
<build.compiler.release>8</build.compiler.release>
<java.version>11</java.version>
</properties>

<build>
Expand Down
3 changes: 1 addition & 2 deletions src/it/json-to-properties/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@

<properties>
<!-- Java version -->
<java.version>1.8</java.version>
<build.compiler.release>8</build.compiler.release>
<java.version>11</java.version>
</properties>

<build>
Expand Down
3 changes: 1 addition & 2 deletions src/it/properties-to-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@

<properties>
<!-- Java version -->
<java.version>1.8</java.version>
<build.compiler.release>8</build.compiler.release>
<java.version>11</java.version>
</properties>

<build>
Expand Down
Loading

0 comments on commit d5d4033

Please sign in to comment.