Skip to content

Commit fd44222

Browse files
Merge pull request #39 from OP-TED/release/1.5.0
Prepare release of version 1.5.0
2 parents 7e7c13c + acbe461 commit fd44222

File tree

5 files changed

+27
-38
lines changed

5 files changed

+27
-38
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
java-version: '11'
3131
distribution: 'adopt'
32-
server-id: ossrh
32+
server-id: central
3333
server-username: MAVEN_USERNAME
3434
server-password: MAVEN_PASSWORD
3535
- name: Publish to the Maven Central Repository

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# eForms Core Library 1.4.0 Release Notes
1+
# eForms Core Library 1.5.0 Release Notes
22

33
The eForms Core Library is a collection of utilities that are used by our sample applications as well as the EFX Toolkit for Java Developers.
44

55
## In this release
66

7-
This release adds the option to indicate a qualifier for SDK components. If there are 2 or more classes that have an @SdkComponent annotation with the same version and component type, this allows you to differentiate them and load the component with the matching qualifier.
7+
This release fixes an issue in the XPathProcessor that could cause a redundant predicate production when contextualising XPaths with multiple predicates.
88

9-
The versions of various dependencies was updated: ANTLR 4.13.1, JAXB 4.0.4, logback 1.5.3, ph-genericode 7.1.1.
9+
The versions of various dependencies was updated: Apache Commons IO 2.19.0, Apache Commons Lang 3.18.0, Jackson 2.18.3, logback 1.5.18.
1010

1111
## Download
1212

pom.xml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>eu.europa.ted.eforms</groupId>
55
<artifactId>eforms-core-java</artifactId>
6-
<version>1.4.0</version>
6+
<version>1.5.0</version>
77

88
<name>eForms Core Library</name>
99
<description>API and tools for eForms applications.</description>
@@ -32,23 +32,10 @@
3232
<url>https://github.com/OP-TED/eforms-core-java.git</url>
3333
</scm>
3434

35-
<distributionManagement>
36-
<snapshotRepository>
37-
<id>ossrh</id>
38-
<url>https://${sonatype.server.url}/content/repositories/snapshots</url>
39-
</snapshotRepository>
40-
<repository>
41-
<id>ossrh</id>
42-
<url>https://${sonatype.server.url}/service/local/staging/deploy/maven2/</url>
43-
</repository>
44-
</distributionManagement>
45-
4635
<properties>
47-
<project.build.outputTimestamp>2024-08-02T09:11:15Z</project.build.outputTimestamp>
36+
<project.build.outputTimestamp>2024-08-02T09:50:45Z</project.build.outputTimestamp>
4837
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4938

50-
<sonatype.server.url>s01.oss.sonatype.org</sonatype.server.url>
51-
5239
<!-- Java compiler -->
5340
<java.version>11</java.version>
5441
<maven.compiler.source>${java.version}</maven.compiler.source>
@@ -57,13 +44,13 @@
5744
<!-- Versions - Third-party libraries -->
5845
<version.antlr4>4.13.1</version.antlr4>
5946
<version.commons-collections>3.2.2</version.commons-collections>
60-
<version.commons-io>2.11.0</version.commons-io>
61-
<version.commons-lang3>3.12.0</version.commons-lang3>
62-
<version.jackson>2.15.1</version.jackson>
47+
<version.commons-io>2.19.0</version.commons-io>
48+
<version.commons-lang3>3.18.0</version.commons-lang3>
49+
<version.jackson>2.18.3</version.jackson>
6350
<version.jaxb-impl>4.0.4</version.jaxb-impl>
6451
<version.jool>0.9.15</version.jool>
6552
<version.junit>5.7.2</version.junit>
66-
<version.logback>1.5.3</version.logback>
53+
<version.logback>1.5.18</version.logback>
6754
<version.maven>3.8.6</version.maven>
6855
<version.ph-jaxb>11.1.3</version.ph-jaxb>
6956
<version.ph-genericode>7.1.1</version.ph-genericode>
@@ -83,7 +70,7 @@
8370
<version.source.plugin>3.2.1</version.source.plugin>
8471
<version.jar.plugin>3.3.0</version.jar.plugin>
8572
<version.surefire.plugin>3.2.5</version.surefire.plugin>
86-
<version.nexus-staging.plugin>1.6.7</version.nexus-staging.plugin>
73+
<version.central-publishing.plugin>0.8.0</version.central-publishing.plugin>
8774
</properties>
8875

8976
<dependencyManagement>
@@ -421,9 +408,9 @@
421408
<version>${version.japicmp.plugin}</version>
422409
</plugin>
423410
<plugin>
424-
<groupId>org.sonatype.plugins</groupId>
425-
<artifactId>nexus-staging-maven-plugin</artifactId>
426-
<version>${version.nexus-staging.plugin}</version>
411+
<groupId>org.sonatype.central</groupId>
412+
<artifactId>central-publishing-maven-plugin</artifactId>
413+
<version>${version.central-publishing.plugin}</version>
427414
</plugin>
428415
</plugins>
429416
</pluginManagement>
@@ -561,13 +548,12 @@
561548
</configuration>
562549
</plugin>
563550
<plugin>
564-
<groupId>org.sonatype.plugins</groupId>
565-
<artifactId>nexus-staging-maven-plugin</artifactId>
551+
<groupId>org.sonatype.central</groupId>
552+
<artifactId>central-publishing-maven-plugin</artifactId>
566553
<extensions>true</extensions>
567554
<configuration>
568-
<serverId>ossrh</serverId>
569-
<nexusUrl>https://${sonatype.server.url}/</nexusUrl>
570-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
555+
<publishingServerId>central</publishingServerId>
556+
<autoPublish>true</autoPublish>
571557
</configuration>
572558
</plugin>
573559
</plugins>

src/main/java/eu/europa/ted/eforms/xpath/XPathProcessor.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,20 @@ private static String getContextualizedXpath(Queue<XPathStep> contextQueue,
7676
// we want to use a dot step with the predicate of the path.
7777
if (!contextQueue.isEmpty() && !pathQueue.isEmpty()
7878
&& pathQueue.peek().isSameAsOrNarrowerThan(contextQueue.peek())) {
79-
contextQueue.poll(); // consume the same step from the contextQueue
79+
// Consume the same step from the contextQueue and get its predicates
80+
List<String> contextPredicates = contextQueue.poll().getPredicates();
81+
// Keep only the predicates that are not in the context.
82+
String pathPredicates = pathQueue.poll().getPredicates().stream().filter(p -> !contextPredicates.contains(p)).collect(Collectors.joining(""));
8083
if (contextQueue.isEmpty()) {
8184
// Since there are no more steps in the contextQueue, the relative xpath should
8285
// start with a dot step to provide a context for the predicate.
83-
relativeXpath += "." + pathQueue.poll().getPredicateText();
86+
relativeXpath += "." + pathPredicates;
8487
} else {
8588
// Since there are more steps in the contextQueue which we will need to navigate back to,
86-
// using back-steps, we will use a back-step to provide context of the predicate.
89+
// using back-steps, we will use a back-step to provide context for the predicate.
8790
// This avoids an output that looks like ../.[predicate] which is valid but silly.
8891
contextQueue.poll(); // consume the step from the contextQueue
89-
relativeXpath += ".." + pathQueue.poll().getPredicateText();
92+
relativeXpath += ".." + pathPredicates;
9093
}
9194
}
9295

src/test/java/eu/europa/ted/eforms/xpath/XPathProcessorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void testIdentical() {
6565

6666
@Test
6767
void testIdentical_WithPredicates() {
68-
assertEquals(".[d = e][f = g]", contextualize("/a/b/c[d = e]", "/a/b/c[d = e][f = g]"));
68+
assertEquals(".[f = g]", contextualize("/a/b/c[d = e]", "/a/b/c[d = e][f = g]"));
6969
}
7070

7171
@Test
@@ -181,7 +181,7 @@ void testPredicateDifferent() {
181181

182182
@Test
183183
void testPredicateMoreInXpath() {
184-
assertEquals("..[e][f]/c/d", contextualize("/a/b[e]/c", "/a/b[e][f]/c/d"));
184+
assertEquals("..[f]/c/d", contextualize("/a/b[e]/c", "/a/b[e][f]/c/d"));
185185
}
186186

187187
@Test

0 commit comments

Comments
 (0)