Skip to content

Commit 7c90193

Browse files
committed
[jgitflow-maven-plugin] merging 'release/1.3.0' into 'master'
2 parents 399754a + be2b1a8 commit 7c90193

25 files changed

+226
-65
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ npm-debug.log
1616
.settings
1717
.externalToolBuilders
1818
.pmd
19+
.eclipse-pmd
1920
.checkstyle
2021
.idea
2122
.vagrant
2223
*.iml
2324
.DS_Store
25+
*.retry
2426
.rubygems
2527
.sass-cache
2628
.rubygems-gem-maven-plugin
2729
*.sublime-*
2830
*nbactions*.xml
2931
.temp/
32+
.vlt
33+
.vlt-sync*
34+
.brackets.json

.travis.maven-settings.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<repository>
3333
<id>central</id>
34-
<url>http://repo1.maven.org/maven2/</url>
34+
<url>https://repo1.maven.org/maven2/</url>
3535
<layout>default</layout>
3636
<releases>
3737
<enabled>true</enabled>
@@ -57,7 +57,7 @@
5757

5858
<repository>
5959
<id>wcm-io-apache-intermediate-release</id>
60-
<url>http://wcm.io/maven/repositories/apache-intermediate-release</url>
60+
<url>https://wcm.io/maven/repositories/apache-intermediate-release</url>
6161
<layout>default</layout>
6262
<releases>
6363
<enabled>true</enabled>
@@ -83,7 +83,7 @@
8383

8484
<repository>
8585
<id>apache-snapshots</id>
86-
<url>http://repository.apache.org/snapshots</url>
86+
<url>https://repository.apache.org/snapshots</url>
8787
<layout>default</layout>
8888
<releases>
8989
<enabled>false</enabled>
@@ -100,7 +100,7 @@
100100

101101
<pluginRepository>
102102
<id>central</id>
103-
<url>http://repo1.maven.org/maven2/</url>
103+
<url>https://repo1.maven.org/maven2/</url>
104104
<layout>default</layout>
105105
<releases>
106106
<enabled>true</enabled>
@@ -126,7 +126,7 @@
126126

127127
<pluginRepository>
128128
<id>wcm-io-apache-intermediate-release</id>
129-
<url>http://wcm.io/maven/repositories/apache-intermediate-release</url>
129+
<url>https://wcm.io/maven/repositories/apache-intermediate-release</url>
130130
<layout>default</layout>
131131
<releases>
132132
<enabled>true</enabled>
@@ -152,7 +152,7 @@
152152

153153
<pluginRepository>
154154
<id>apache-snapshots</id>
155-
<url>http://repository.apache.org/snapshots</url>
155+
<url>https://repository.apache.org/snapshots</url>
156156
<layout>default</layout>
157157
<releases>
158158
<enabled>false</enabled>

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
language: java
2121

2222
jdk:
23-
- oraclejdk8
23+
- openjdk8
2424
- openjdk11
2525

2626
# Make sure travis can use container-based infrastructure

Jenkinsfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@Library('pipeline-library') pipelineLibrary
2+
@Library('pv-pipeline-library') pvPipelineLibrary
3+
4+
5+
import io.wcm.devops.jenkins.pipeline.ssh.SSHTarget
6+
7+
import static de.provision.devops.jenkins.pipeline.utils.ConfigConstants.*
8+
import static io.wcm.devops.jenkins.pipeline.utils.ConfigConstants.*
9+
10+
// See:
11+
// https://github.com/pro-vision/jenkins-pv-pipeline-library
12+
// https://github.com/pro-vision/jenkins-pv-pipeline-library/blob/master/docs/config-structure.md
13+
// Also have a look at https://github.com/wcm-io-devops/jenkins-pipeline-library for further configuration options
14+
15+
List triggers = defaults.getTriggers()
16+
triggers.push(githubPush())
17+
18+
Map config = [
19+
(BUILD_WRAPPER): [
20+
(BUILD_WRAPPER_SSH_TARGETS): [new SSHTarget("ssh-wcm.io")]
21+
],
22+
(PROPERTIES) : [
23+
(PROPERTIES_PIPELINE_TRIGGERS): triggers
24+
],
25+
(STAGE_COMPILE): [
26+
(MAVEN): [
27+
(MAVEN_GOALS): ["clean", "deploy", "site-deploy"],
28+
]
29+
],
30+
(STAGE_FEATURE_PREPARATION): [
31+
(STAGE_FEATURE_PREPARATION_MERGE): [
32+
(STAGE_FEATURE_PREPARATION_MERGE_ENABLED): false
33+
]
34+
]
35+
]
36+
37+
routeDefaultJenkinsFile(config)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<img src="http://wcm.io/images/[email protected]"/> CONGA Plugin for Apache Sling
1+
<img src="https://wcm.io/images/[email protected]"/> CONGA Plugin for Apache Sling
22
======
33
[![Build Status](https://travis-ci.org/wcm-io-devops/conga-sling-plugin.png?branch=develop)](https://travis-ci.org/wcm-io-devops/conga-sling-plugin)
44
[![Code Coverage](https://codecov.io/gh/wcm-io-devops/conga-sling-plugin/branch/develop/graph/badge.svg)](https://codecov.io/gh/wcm-io-devops/conga-sling-plugin)
55

6-
Documentation: http://devops.wcm.io/conga/plugins/sling/<br/>
6+
Documentation: https://devops.wcm.io/conga/plugins/sling/<br/>
77
Issues: https://wcm-io.atlassian.net/projects/WDCONGA<br/>
88
Wiki: https://wcm-io.atlassian.net/wiki/<br/>
99
Continuous Integration: https://travis-ci.org/conga-sling-plugin
1010

1111

1212
## Build from sources
1313

14-
If you want to build from sources make sure you have configured all [Maven Repositories](http://devops.wcm.io/maven.html) in your settings.xml.
14+
If you want to build from sources make sure you have configured all [Maven Repositories](https://devops.wcm.io/maven.html) in your settings.xml.
1515

1616
See [Travis Maven settings.xml](https://github.com/conga-sling-plugin/blob/master/.travis.maven-settings.xml) for an example with a full configuration.
1717

changes.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
2424
<body>
2525

26+
<release version="1.3.0" date="2020-04-23">
27+
<action type="add" dev="sseifert">
28+
Add support for [:repoinit] sections when generating OSGi configurations from Sling Provisioning files.
29+
</action>
30+
<action type="fix" dev="sseifert">
31+
Provisioning file format escaping rules: Escape variable expressions ${...} in values to ensure they are passed through and not interpreted as provisioning file variables.
32+
</action>
33+
</release>
34+
2635
<release version="1.2.6" date="2019-05-08">
2736
<action type="update" dev="sseifert">
2837
Read Felix ConfigAdmin configuration files with latest version (1.9.14), but write it using the old file format form ConfigAdmin 1.8.4 to support AEM 6.1 and below.

conga-sling-plugin/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
#L%
2020
-->
2121

22-
<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/xsd/maven-4.0.0.xsd">
22+
<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">
2323
<modelVersion>4.0.0</modelVersion>
2424

2525
<parent>
2626
<groupId>io.wcm.devops</groupId>
2727
<artifactId>io.wcm.devops.parent_toplevel</artifactId>
28-
<version>1.1.4</version>
28+
<version>1.2.2</version>
2929
<relativePath />
3030
</parent>
3131

3232
<groupId>io.wcm.devops.conga.plugins</groupId>
3333
<artifactId>io.wcm.devops.conga.plugins.sling</artifactId>
34-
<version>1.2.6</version>
34+
<version>1.3.0</version>
3535
<packaging>jar</packaging>
3636

3737
<name>CONGA Sling Plugin</name>
@@ -62,14 +62,14 @@
6262
<groupId>org.apache.felix</groupId>
6363
<artifactId>org.apache.felix.configadmin</artifactId>
6464
<!-- Support latest config file format for reading, stick with version 1.8.4 for writing (ConfigurationHandler class is copied to this plugin) -->
65-
<version>1.9.14</version>
65+
<version>1.9.16</version>
6666
<scope>compile</scope>
6767
</dependency>
6868

6969
<dependency>
7070
<groupId>org.apache.sling</groupId>
7171
<artifactId>org.apache.sling.provisioning.model</artifactId>
72-
<version>1.8.4</version>
72+
<version>1.8.6</version>
7373
<scope>compile</scope>
7474
</dependency>
7575

conga-sling-plugin/src/main/java/io/wcm/devops/conga/plugins/sling/handlebars/escaping/ProvisioningEscapingStrategy.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
*/
2020
package io.wcm.devops.conga.plugins.sling.handlebars.escaping;
2121

22+
import java.util.regex.Matcher;
23+
import java.util.regex.Pattern;
24+
2225
import io.wcm.devops.conga.generator.spi.handlebars.EscapingStrategyPlugin;
2326
import io.wcm.devops.conga.generator.spi.handlebars.context.EscapingStrategyContext;
2427
import io.wcm.devops.conga.generator.util.FileUtil;
@@ -34,6 +37,8 @@ public class ProvisioningEscapingStrategy implements EscapingStrategyPlugin {
3437
*/
3538
public static final String NAME = "sling-provisioning";
3639

40+
private static final Pattern VARIABLE_PATTERN = Pattern.compile("\\$\\{([^\\{\\}]+)\\}");
41+
3742
@Override
3843
public String getName() {
3944
return NAME;
@@ -47,8 +52,22 @@ public boolean accepts(String fileExtension, EscapingStrategyContext pluginConte
4752

4853
@Override
4954
public String escape(CharSequence value, EscapingStrategyContext pluginContext) {
55+
if (value == null) {
56+
return null;
57+
}
58+
5059
// use same escaping rules as for OSGi configurations
51-
return value == null ? null : OsgiConfigEscapingStrategy.ESCAPE_OSGI_CONFIG.translate(value);
60+
String escapedValue = OsgiConfigEscapingStrategy.ESCAPE_OSGI_CONFIG.translate(value);
61+
62+
// escape variables ${...} with \${...} - otherwise lead to "Unknown variable" error when validating sling provisioning file
63+
StringBuffer result = new StringBuffer();
64+
Matcher matcher = VARIABLE_PATTERN.matcher(escapedValue);
65+
while (matcher.find()) {
66+
matcher.appendReplacement(result, "\\\\\\$\\{" + matcher.group(1) + "\\}");
67+
}
68+
matcher.appendTail(result);
69+
70+
return result.toString();
5271
}
5372

5473
}

conga-sling-plugin/src/main/java/io/wcm/devops/conga/plugins/sling/postprocessor/ProvisioningOsgiConfigPostProcessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import org.apache.sling.provisioning.model.Model;
3030

31+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
3132
import io.wcm.devops.conga.generator.GeneratorException;
3233
import io.wcm.devops.conga.generator.spi.PostProcessorPlugin;
3334
import io.wcm.devops.conga.generator.spi.context.FileContext;
@@ -57,6 +58,7 @@ public boolean accepts(FileContext file, PostProcessorContext context) {
5758
}
5859

5960
@Override
61+
@SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE")
6062
public List<FileContext> apply(FileContext fileContext, PostProcessorContext context) {
6163
File file = fileContext.getFile();
6264
try {
@@ -80,11 +82,11 @@ public List<FileContext> apply(FileContext fileContext, PostProcessorContext con
8082
* @param model Provisioning Model
8183
* @param dir Target directory
8284
* @param context Post processor context
83-
* @throws IOException
8485
*/
8586
private List<FileContext> generateOsgiConfigurations(Model model, File dir, PostProcessorContext context) throws IOException {
8687
return ProvisioningUtil.visitOsgiConfigurations(model, new ConfigConsumer<FileContext>() {
8788
@Override
89+
@SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE")
8890
public FileContext accept(String path, Dictionary<String, Object> properties) throws IOException {
8991
context.getLogger().info(" Generate " + path);
9092

conga-sling-plugin/src/main/java/io/wcm/devops/conga/plugins/sling/util/ConfigurationHandler_ConfigAdmin184.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242

4343
import org.apache.felix.cm.file.FilePersistenceManager;
4444

45+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
46+
4547
/*
4648
* This file is COPIED from the sources of org.apache.felix.configadmin 1.8.4
4749
* to write the configuration using the old (single line) array style, which is required to support
@@ -66,7 +68,8 @@
6668
* </pre>
6769
*/
6870
//CHECKSTYLE:OFF
69-
@SuppressWarnings({ "unchecked", "unused", "javadoc" })
71+
@SuppressWarnings({ "unchecked", "unused", "javadoc", "PMD" })
72+
@SuppressFBWarnings({ "PERFORMANCE", "STYLE" })
7073
class ConfigurationHandler_ConfigAdmin184 {
7174

7275
protected static final String ENCODING = "UTF-8";

0 commit comments

Comments
 (0)