Skip to content

Commit 6a597d1

Browse files
authored
Migrate to OSSRH Staging API; upgrade deps (#30)
1 parent 00bf8fe commit 6a597d1

File tree

4 files changed

+64
-58
lines changed

4 files changed

+64
-58
lines changed

pom.xml

Lines changed: 25 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
<maven.compiler.release>8</maven.compiler.release>
3232
<testng.version>7.5.1</testng.version>
3333
<junit.version>5.12.1</junit.version>
34-
<logback.version>1.3.15</logback.version>
35-
<compiler-plugin.version>3.10.1</compiler-plugin.version>
36-
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
37-
<source-plugin.version>3.2.1</source-plugin.version>
38-
<javadoc-plugin.version>3.4.0</javadoc-plugin.version>
39-
<gpg-plugin.version>3.0.1</gpg-plugin.version>
40-
<staging-plugin.version>1.6.13</staging-plugin.version>
41-
<release-plugin.version>3.0.0-M6</release-plugin.version>
34+
<logback.version>1.5.13</logback.version>
35+
<compiler-plugin.version>3.14.0</compiler-plugin.version>
36+
<surefire-plugin.version>3.5.3</surefire-plugin.version>
37+
<source-plugin.version>3.3.1</source-plugin.version>
38+
<javadoc-plugin.version>3.11.2</javadoc-plugin.version>
39+
<gpg-plugin.version>3.2.8</gpg-plugin.version>
40+
<staging-plugin.version>1.7.0</staging-plugin.version>
41+
<release-plugin.version>3.1.1</release-plugin.version>
4242
<skipSigning>true</skipSigning>
4343
</properties>
4444

@@ -52,11 +52,11 @@
5252
<distributionManagement>
5353
<snapshotRepository>
5454
<id>ossrh</id>
55-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
55+
<url>https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots</url>
5656
</snapshotRepository>
5757
<repository>
5858
<id>ossrh</id>
59-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
59+
<url>https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots</url>
6060
</repository>
6161
</distributionManagement>
6262

@@ -95,57 +95,18 @@
9595
</dependencies>
9696

9797
<build>
98-
<pluginManagement>
99-
<plugins>
100-
<plugin>
101-
<groupId>org.apache.maven.plugins</groupId>
102-
<artifactId>maven-compiler-plugin</artifactId>
103-
<version>${compiler-plugin.version}</version>
104-
</plugin>
105-
<plugin>
106-
<groupId>org.apache.maven.plugins</groupId>
107-
<artifactId>maven-surefire-plugin</artifactId>
108-
<version>${surefire-plugin.version}</version>
109-
</plugin>
110-
<plugin>
111-
<groupId>org.apache.maven.plugins</groupId>
112-
<artifactId>maven-source-plugin</artifactId>
113-
<version>${source-plugin.version}</version>
114-
</plugin>
115-
<plugin>
116-
<groupId>org.apache.maven.plugins</groupId>
117-
<artifactId>maven-javadoc-plugin</artifactId>
118-
<version>${javadoc-plugin.version}</version>
119-
</plugin>
120-
<plugin>
121-
<groupId>org.apache.maven.plugins</groupId>
122-
<artifactId>maven-gpg-plugin</artifactId>
123-
<version>${gpg-plugin.version}</version>
124-
</plugin>
125-
<plugin>
126-
<groupId>org.sonatype.plugins</groupId>
127-
<artifactId>nexus-staging-maven-plugin</artifactId>
128-
<version>${staging-plugin.version}</version>
129-
</plugin>
130-
<plugin>
131-
<groupId>org.apache.maven.plugins</groupId>
132-
<artifactId>maven-release-plugin</artifactId>
133-
<version>${release-plugin.version}</version>
134-
</plugin>
135-
</plugins>
136-
</pluginManagement>
13798
<plugins>
13899
<plugin>
139-
<groupId>org.apache.maven.plugins</groupId>
140100
<artifactId>maven-compiler-plugin</artifactId>
101+
<version>${compiler-plugin.version}</version>
141102
</plugin>
142103
<plugin>
143-
<groupId>org.apache.maven.plugins</groupId>
144104
<artifactId>maven-surefire-plugin</artifactId>
105+
<version>${surefire-plugin.version}</version>
145106
</plugin>
146107
<plugin>
147-
<groupId>org.apache.maven.plugins</groupId>
148108
<artifactId>maven-source-plugin</artifactId>
109+
<version>${source-plugin.version}</version>
149110
<executions>
150111
<execution>
151112
<id>attach-sources</id>
@@ -156,8 +117,8 @@
156117
</executions>
157118
</plugin>
158119
<plugin>
159-
<groupId>org.apache.maven.plugins</groupId>
160120
<artifactId>maven-javadoc-plugin</artifactId>
121+
<version>${javadoc-plugin.version}</version>
161122
<executions>
162123
<execution>
163124
<id>attach-javadocs</id>
@@ -168,8 +129,8 @@
168129
</executions>
169130
</plugin>
170131
<plugin>
171-
<groupId>org.apache.maven.plugins</groupId>
172132
<artifactId>maven-gpg-plugin</artifactId>
133+
<version>${gpg-plugin.version}</version>
173134
<executions>
174135
<execution>
175136
<id>sign-artifacts</id>
@@ -188,16 +149,24 @@
188149
<plugin>
189150
<groupId>org.sonatype.plugins</groupId>
190151
<artifactId>nexus-staging-maven-plugin</artifactId>
152+
<version>${staging-plugin.version}</version>
191153
<extensions>true</extensions>
154+
<dependencies>
155+
<dependency>
156+
<groupId>io.github.x-stream</groupId>
157+
<artifactId>mxparser</artifactId>
158+
<version>1.2.1</version>
159+
</dependency>
160+
</dependencies>
192161
<configuration>
193162
<serverId>ossrh</serverId>
194-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
163+
<nexusUrl>https://ossrh-staging-api.central.sonatype.com/</nexusUrl>
195164
<autoReleaseAfterClose>true</autoReleaseAfterClose>
196165
</configuration>
197166
</plugin>
198167
<plugin>
199-
<groupId>org.apache.maven.plugins</groupId>
200168
<artifactId>maven-release-plugin</artifactId>
169+
<version>${release-plugin.version}</version>
201170
<configuration>
202171
<autoVersionSubmodules>true</autoVersionSubmodules>
203172
<useReleaseProfile>false</useReleaseProfile>

src/main/java/com/github/sbabcoc/logback/testng/ReporterAppender.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@
77

88
import ch.qos.logback.core.OutputStreamAppender;
99

10+
/**
11+
* This class appends log events to the <b>TestNG Reporter</b>.
12+
*
13+
* @param <E> supported log event type
14+
* @see ReporterOutputStream
15+
*/
1016
public class ReporterAppender<E> extends OutputStreamAppender<E> {
1117

1218
private static final Method getCurrentTestResult;
1319
private static final Method getOutput;
1420
private static final Method log;
1521

22+
/** {@code true} to fork output to STDOUT */
1623
protected boolean logToStdOut = false;
1724

1825
static {
@@ -36,6 +43,13 @@ public class ReporterAppender<E> extends OutputStreamAppender<E> {
3643
log = l;
3744
}
3845
}
46+
47+
/**
48+
* Default constructor
49+
*/
50+
public ReporterAppender() {
51+
super();
52+
}
3953

4054
@Override
4155
public void start() {
@@ -73,6 +87,7 @@ public String toString() {
7387

7488
/**
7589
* Specify if output should be sent to <i>STDOUT</i> in addition to the TestNG HTML report.
90+
*
7691
* @param logToStdOut {@code false} to send output only to the TestNG HTML report;
7792
* {@code true} to fork output to <i>STDOUT</i> and the TestNG HTML report.
7893
*/
@@ -86,6 +101,7 @@ public void setLogToStdOut(boolean logToStdOut) {
86101

87102
/**
88103
* Determine if output is being forked to <i>STDOUT</i> and the TestNG HTML report.
104+
*
89105
* @return {@code false} if output is being sent solely to the TestNG HTML report;
90106
* {@code true} if output is being forked to <i>STDOUT</i> and the TestNG HTML report.
91107
*/
@@ -94,7 +110,9 @@ public boolean doLogToStdOut() {
94110
}
95111

96112
/**
97-
* Log the passed string to the HTML reports. If logToStandardOut is true, the string will also be printed on standard out.
113+
* Log the passed string to the HTML reports. If logToStandardOut is true, the string will also be printed on
114+
* standard out.
115+
*
98116
* @param s The message to log
99117
* @param logToStandardOut Whether to print this string on standard out too
100118
*/
@@ -110,6 +128,7 @@ static void log(String s, boolean logToStandardOut) {
110128

111129
/**
112130
* Concatenate the elements of the specified list of strings.
131+
*
113132
* @param parts list of strings to concatenate
114133
* @return concatenated string
115134
*/

src/main/java/com/github/sbabcoc/logback/testng/ReporterOutputStream.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,29 @@
44
import java.io.IOException;
55
import java.io.OutputStream;
66

7+
/**
8+
* This class implements an {@link OutputStream} for the <b>TestNG Reporter</b>.
9+
*
10+
* @see ReporterAppender
11+
*/
712
public class ReporterOutputStream extends OutputStream {
813

914
private boolean logToStdOut = false;
1015
private ByteArrayOutputStream baos = new ByteArrayOutputStream();
16+
17+
/**
18+
* Default constructor
19+
*/
20+
public ReporterOutputStream() {
21+
super();
22+
}
1123

24+
/**
25+
* Specify if output should be sent to <i>STDOUT</i> in addition to the TestNG HTML report.
26+
*
27+
* @param logToStdOut {@code false} to send output only to the TestNG HTML report;
28+
* {@code true} to fork output to <i>STDOUT</i> and the TestNG HTML report.
29+
*/
1230
public void setLogToStdOut(boolean logToStdOut) {
1331
this.logToStdOut = logToStdOut;
1432
}

src/test/java/com/github/sbabcoc/logback/testng/ReporterAppenderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import ch.qos.logback.core.Appender;
1111
import ch.qos.logback.core.CoreConstants;
1212
import ch.qos.logback.core.appender.AbstractAppenderTest;
13-
import ch.qos.logback.core.encoder.DummyEncoder;
13+
import ch.qos.logback.core.testUtil.DummyEncoder;
1414
import ch.qos.logback.core.encoder.NopEncoder;
1515
import ch.qos.logback.core.layout.DummyLayout;
1616

0 commit comments

Comments
 (0)