Skip to content

Commit 33e2e3c

Browse files
committed
Merge branch 'develop'
2 parents c9fef53 + c20d2d6 commit 33e2e3c

File tree

10 files changed

+162
-16
lines changed

10 files changed

+162
-16
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,19 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [1.0.1] - 2025-05-13
11+
12+
### Fixed
13+
14+
- Fix limits default value in mojos
15+
- Fix sourceBinding default value in mojos
16+
- Fix empty label in MarkdownFormat
17+
- Fix missing BOM module
18+
1019
## [1.0.0] - 2025-05-12
1120

1221
Initial release.
1322

14-
[Unreleased]: https://github.com/nbbrd/nbbrd-maven-tools/compare/v1.0.0...HEAD
23+
[Unreleased]: https://github.com/nbbrd/nbbrd-maven-tools/compare/v1.0.1...HEAD
24+
[1.0.1]: https://github.com/nbbrd/nbbrd-maven-tools/compare/v1.0.0...v1.0.1
1525
[1.0.0]: https://github.com/nbbrd/nbbrd-maven-tools/compare/develop...v1.0.0

compatibility-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.github.nbbrd.nbbrd-maven-tools</groupId>
99
<artifactId>nbbrd-maven-tools</artifactId>
10-
<version>1.0.0</version>
10+
<version>1.0.1</version>
1111
</parent>
1212

1313
<artifactId>compatibility-api</artifactId>

compatibility-api/src/main/java/internal/compatibility/spi/CommandLineBuild.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import nbbrd.compatibility.Ref;
77
import nbbrd.compatibility.Version;
88
import nbbrd.compatibility.spi.Build;
9+
import nbbrd.design.MightBePromoted;
910
import nbbrd.design.VisibleForTesting;
1011
import nbbrd.io.sys.EndOfProcessException;
1112
import nbbrd.io.text.TextParser;
@@ -172,14 +173,17 @@ public void clone(@NonNull URI from, @NonNull Path to) throws IOException {
172173
public void close() {
173174
}
174175

176+
@MightBePromoted
175177
private static <X> Collector<X, ?, Optional<X>> toFirst() {
176178
return reducing((first, ignore) -> first);
177179
}
178180

179-
private static <X> Collector<X, ?, Optional<X>> toLast() {
181+
@MightBePromoted
182+
static <X> Collector<X, ?, Optional<X>> toLast() {
180183
return reducing((ignore, second) -> second);
181184
}
182185

186+
@MightBePromoted
183187
private static <X> Collector<X, ?, Optional<X>> toSingle() {
184188
return collectingAndThen(toList(), list -> list.size() == 1 ? Optional.of(list.get(0)) : Optional.empty());
185189
}

compatibility-api/src/main/java/internal/compatibility/spi/MarkdownFormat.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,12 @@ static class Header {
138138
RefVersion version;
139139

140140
String toProjectLabel() {
141-
String path = uri.getPath();
141+
String path = uri.normalize().getPath();
142142
if (path != null) {
143-
int index = path.lastIndexOf('/');
144-
return index != -1 ? path.substring(index + 1) : path;
143+
return Stream.of(path.split("/", -1))
144+
.filter(item -> !item.isEmpty())
145+
.collect(CommandLineBuild.toLast())
146+
.orElse(path);
145147
}
146148
return uri.toString();
147149
}

compatibility-api/src/test/java/internal/compatibility/spi/MarkdownFormatTest.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package internal.compatibility.spi;
22

33
import nbbrd.compatibility.Job;
4+
import nbbrd.compatibility.RefVersion;
45
import nbbrd.compatibility.Report;
56
import nbbrd.compatibility.ReportItem;
67
import nbbrd.io.text.Formatter;
@@ -82,16 +83,26 @@ void testGetFormatFileFilter(@TempDir Path tmp) throws IOException {
8283

8384
@Test
8485
void testToProjectLabel() {
85-
assertThat(new MarkdownFormat.Header(URI.create(""), localOf("1.2.3")).toProjectLabel())
86+
RefVersion local = localOf("1.2.3");
87+
88+
assertThat(new MarkdownFormat.Header(URI.create(""), local).toProjectLabel())
8689
.isEqualTo("");
8790

88-
assertThat(new MarkdownFormat.Header(URI.create("https://github.com/nbbrd/jdplus-sdmx"), localOf("1.2.3")).toProjectLabel())
91+
assertThat(new MarkdownFormat.Header(URI.create("https://github.com/nbbrd/jdplus-sdmx"), local).toProjectLabel())
92+
.isEqualTo("jdplus-sdmx");
93+
94+
assertThat(new MarkdownFormat.Header(URI.create("file:///C:/nbbrd/jdplus-sdmx/jdplus-sdmx-bom//../"), local).toProjectLabel())
8995
.isEqualTo("jdplus-sdmx");
9096

91-
assertThat(new MarkdownFormat.Header(URI.create(""), remoteOf("1.2.3")).toProjectLabel())
97+
RefVersion remote = remoteOf("1.2.3");
98+
99+
assertThat(new MarkdownFormat.Header(URI.create(""), remote).toProjectLabel())
92100
.isEqualTo("");
93101

94-
assertThat(new MarkdownFormat.Header(URI.create("https://github.com/nbbrd/jdplus-sdmx"), remoteOf("1.2.3")).toProjectLabel())
102+
assertThat(new MarkdownFormat.Header(URI.create("https://github.com/nbbrd/jdplus-sdmx"), remote).toProjectLabel())
103+
.isEqualTo("jdplus-sdmx");
104+
105+
assertThat(new MarkdownFormat.Header(URI.create("file:///C:/nbbrd/jdplus-sdmx/jdplus-sdmx-bom//../"), remote).toProjectLabel())
95106
.isEqualTo("jdplus-sdmx");
96107
}
97108

compatibility-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.github.nbbrd.nbbrd-maven-tools</groupId>
99
<artifactId>nbbrd-maven-tools</artifactId>
10-
<version>1.0.0</version>
10+
<version>1.0.1</version>
1111
</parent>
1212

1313
<artifactId>compatibility-maven-plugin</artifactId>

compatibility-maven-plugin/src/main/java/nbbrd/compatibility/maven/plugin/CheckDownstreamMojo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public final class CheckDownstreamMojo extends AbstractCheckStreamMojo {
2323
@Parameter(property = "compatibility.source", required = true, defaultValue = "${project.baseUri}")
2424
private URI source;
2525

26-
@Parameter(property = "compatibility.sourceBinding", required = true)
26+
@Parameter(property = "compatibility.sourceBinding", required = true, defaultValue = "${project.groupId}")
2727
private String sourceBinding;
2828

2929
@Parameter(property = "compatibility.sourceVersioning", defaultValue = Source.DEFAULT_VERSIONING)
@@ -53,7 +53,7 @@ public final class CheckDownstreamMojo extends AbstractCheckStreamMojo {
5353
@Parameter(property = "compatibility.targetTos")
5454
private List<String> targetTos;
5555

56-
@Parameter(property = "compatibility.targetLimits", defaultValue = NO_LIMIT)
56+
@Parameter(property = "compatibility.targetLimits")
5757
private List<Integer> targetLimits;
5858

5959
@ParameterParsing

compatibility-maven-plugin/src/main/java/nbbrd/compatibility/maven/plugin/CheckUpstreamMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public final class CheckUpstreamMojo extends AbstractCheckStreamMojo {
3838
@Parameter(property = "compatibility.sourceTos")
3939
private List<String> sourceTos;
4040

41-
@Parameter(property = "compatibility.sourceLimits", defaultValue = NO_LIMIT)
41+
@Parameter(property = "compatibility.sourceLimits")
4242
private List<Integer> sourceLimits;
4343

4444
@Parameter(property = "compatibility.target", required = true, defaultValue = "${project.baseUri}")

nbbrd-maven-bom/pom.xml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>com.github.nbbrd.nbbrd-maven-tools</groupId>
9+
<artifactId>nbbrd-maven-tools</artifactId>
10+
<version>1.0.1</version>
11+
</parent>
12+
13+
<artifactId>nbbrd-maven-bom</artifactId>
14+
<packaging>pom</packaging>
15+
16+
<name>nbbrd-maven-bom</name>
17+
<description>NBBRD Maven BOM</description>
18+
<url>https://github.com/nbbrd/nbbrd-maven-tools</url>
19+
20+
<dependencyManagement>
21+
<dependencies>
22+
<dependency>
23+
<groupId>${project.groupId}</groupId>
24+
<artifactId>compatibility-api</artifactId>
25+
<version>${project.version}</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>${project.groupId}</groupId>
29+
<artifactId>compatibility-maven-plugin</artifactId>
30+
<version>${project.version}</version>
31+
</dependency>
32+
</dependencies>
33+
</dependencyManagement>
34+
35+
<build>
36+
<plugins>
37+
<plugin>
38+
<groupId>org.codehaus.mojo</groupId>
39+
<artifactId>flatten-maven-plugin</artifactId>
40+
<version>1.7.0</version>
41+
<configuration>
42+
<flattenMode>bom</flattenMode>
43+
<outputDirectory>${project.build.directory}</outputDirectory>
44+
</configuration>
45+
<executions>
46+
<execution>
47+
<id>flatten</id>
48+
<phase>process-resources</phase>
49+
<goals>
50+
<goal>flatten</goal>
51+
</goals>
52+
</execution>
53+
</executions>
54+
</plugin>
55+
</plugins>
56+
</build>
57+
58+
<profiles>
59+
<!-- Release binaries on GitHub -->
60+
<!-- Note that all plugins are run on 'install' phase -->
61+
<profile>
62+
<id>full-release</id>
63+
<build>
64+
<plugins>
65+
<!-- Extract changelog -->
66+
<plugin>
67+
<groupId>com.github.nbbrd.heylogs</groupId>
68+
<artifactId>heylogs-maven-plugin</artifactId>
69+
<executions>
70+
<execution>
71+
<id>extract-changelog</id>
72+
<phase>install</phase>
73+
<goals>
74+
<goal>extract</goal>
75+
</goals>
76+
<configuration>
77+
<inputFile>${project.parent.basedir}/CHANGELOG.md</inputFile>
78+
</configuration>
79+
</execution>
80+
</executions>
81+
</plugin>
82+
83+
<!-- Release assets -->
84+
<plugin>
85+
<groupId>org.jreleaser</groupId>
86+
<artifactId>jreleaser-maven-plugin</artifactId>
87+
<executions>
88+
<execution>
89+
<id>release-assets</id>
90+
<phase>install</phase>
91+
<goals>
92+
<goal>full-release</goal>
93+
</goals>
94+
<configuration>
95+
<jreleaser>
96+
<release>
97+
<github>
98+
<skipTag>true</skipTag>
99+
<changelog>
100+
<external>${project.build.directory}/CHANGELOG.md</external>
101+
</changelog>
102+
</github>
103+
</release>
104+
<signing>
105+
<active>ALWAYS</active>
106+
<!-- Fix default value -->
107+
<armored>true</armored>
108+
</signing>
109+
</jreleaser>
110+
</configuration>
111+
</execution>
112+
</executions>
113+
</plugin>
114+
</plugins>
115+
</build>
116+
</profile>
117+
</profiles>
118+
</project>

pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.github.nbbrd.nbbrd-maven-tools</groupId>
88
<artifactId>nbbrd-maven-tools</artifactId>
9-
<version>1.0.0</version>
9+
<version>1.0.1</version>
1010
<packaging>pom</packaging>
1111

1212
<name>nbbrd-maven-tools</name>
@@ -39,7 +39,7 @@
3939
<properties>
4040
<!-- Java 8+ config -->
4141
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
42-
<project.build.outputTimestamp>2025-05-12T12:48:13Z</project.build.outputTimestamp>
42+
<project.build.outputTimestamp>2025-05-13T10:01:06Z</project.build.outputTimestamp>
4343
<maven.compiler.target>1.8</maven.compiler.target>
4444
<maven.compiler.source>1.8</maven.compiler.source>
4545

@@ -251,6 +251,7 @@
251251
<modules>
252252
<module>compatibility-api</module>
253253
<module>compatibility-maven-plugin</module>
254+
<module>nbbrd-maven-bom</module>
254255
</modules>
255256

256257
<profiles>

0 commit comments

Comments
 (0)