Skip to content

Commit e45e5ef

Browse files
Try fix in plexus-xml
1 parent 44a98ff commit e45e5ef

File tree

8 files changed

+14
-75
lines changed

8 files changed

+14
-75
lines changed

pom.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,6 @@ under the License.
211211
<artifactId>maven-script-interpreter</artifactId>
212212
<version>1.6</version>
213213
</dependency>
214-
<dependency>
215-
<groupId>org.apache.commons</groupId>
216-
<artifactId>commons-text</artifactId>
217-
<version>1.12.0</version>
218-
</dependency>
219214
<dependency>
220215
<groupId>org.slf4j</groupId>
221216
<artifactId>slf4j-api</artifactId>
@@ -252,6 +247,7 @@ under the License.
252247
<dependency>
253248
<groupId>org.codehaus.plexus</groupId>
254249
<artifactId>plexus-xml</artifactId>
250+
<version>4.0.4-SNAPSHOT</version>
255251
</dependency>
256252
<dependency>
257253
<groupId>org.codehaus.plexus</groupId>

src/it/MINVOKER-351/invoker.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
invoker.goals = initialize site
18+
invoker.goals.1 = initialize
19+
invoker.buildResult.1 = failure
20+
21+
invoker.goals.2 = site

src/it/MINVOKER-351/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ under the License.
2828
<version>1.0-SNAPSHOT</version>
2929
<packaging>pom</packaging>
3030

31+
<description>Special XML chars in build-job, junit reports</description>
32+
3133
<properties>
3234
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3335
<version.maven-compiler-plugin>@version.maven-compiler-plugin@</version.maven-compiler-plugin>

src/it/MINVOKER-351/src/it/minvoker-351/pom.xml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,10 @@ under the License.
2626
<groupId>example.minvoker351</groupId>
2727
<artifactId>minvoker-351</artifactId>
2828
<version>1.0-SNAPSHOT</version>
29+
<packaging>pom</packaging>
2930

3031
<properties>
3132
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
32-
<maven.compiler.source>8</maven.compiler.source>
33-
<maven.compiler.target>8</maven.compiler.target>
3433
</properties>
3534

36-
<build>
37-
<pluginManagement>
38-
<plugins>
39-
<plugin>
40-
<groupId>org.apache.maven.plugins</groupId>
41-
<artifactId>maven-compiler-plugin</artifactId>
42-
<version>@version.maven-compiler-plugin@</version>
43-
</plugin>
44-
<plugin>
45-
<groupId>org.apache.maven.plugins</groupId>
46-
<artifactId>maven-surefire-plugin</artifactId>
47-
<version>@version.maven-surefire@</version>
48-
</plugin>
49-
</plugins>
50-
</pluginManagement>
51-
</build>
52-
<dependencies>
53-
<dependency>
54-
<groupId>org.junit.jupiter</groupId>
55-
<artifactId>junit-jupiter</artifactId>
56-
<version>5.10.2</version>
57-
<scope>test</scope>
58-
</dependency>
59-
</dependencies>
6035
</project>

src/it/MINVOKER-351/src/it/minvoker-351/src/test/java/example/minvoker351/ExampleTest.java renamed to src/it/MINVOKER-351/src/it/minvoker-351/postbuild.groovy

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,5 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package example.minvoker351;
2019

21-
import org.junit.jupiter.api.Test;
22-
23-
public class ExampleTest {
24-
@Test
25-
public void f() {
26-
new Example().printAscii();
27-
}
28-
}
20+
throw new Exception("Special chars \tcharName=" + Character.getName(7) + (char) 7 + ";")

src/it/MINVOKER-351/src/it/minvoker-351/src/main/java/example/minvoker351/Example.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/it/MINVOKER-351/verify.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
* under the License.
1818
*/
1919

20+
// we have a special chars in build.log
2021
// we have a special chars in build.log
2122
def buildLog = new File(basedir, 'target/it/minvoker-351/build.log').text
22-
buildLog.contains('\u0002 - name: START OF TEXT')
23-
buildLog.contains('\u0007 - name: BEL')
23+
buildLog.contains('Special chars \tcharName=BEL\u0007;')
2424

2525

2626
def surefireReport = new File(basedir, 'target/site/surefire-report.html').text

src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import java.util.TreeSet;
5151
import java.util.stream.Collectors;
5252

53-
import org.apache.commons.text.StringEscapeUtils;
5453
import org.apache.maven.artifact.Artifact;
5554
import org.apache.maven.execution.MavenSession;
5655
import org.apache.maven.model.Model;
@@ -99,7 +98,6 @@
9998
import org.codehaus.plexus.util.cli.CommandLineUtils;
10099
import org.codehaus.plexus.util.cli.Commandline;
101100
import org.codehaus.plexus.util.cli.StreamConsumer;
102-
import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
103101
import org.codehaus.plexus.util.xml.XmlStreamReader;
104102
import org.codehaus.plexus.util.xml.XmlStreamWriter;
105103
import org.codehaus.plexus.util.xml.Xpp3Dom;
@@ -1642,7 +1640,7 @@ private void runBuild(
16421640
}
16431641
} catch (RunFailureException e) {
16441642
buildJob.setResult(e.getType());
1645-
buildJob.setFailureMessage(StringEscapeUtils.escapeXml10(e.getMessage()));
1643+
buildJob.setFailureMessage(e.getMessage());
16461644

16471645
if (!suppressSummaries) {
16481646
getLog().info(" " + e.getMessage());
@@ -1781,7 +1779,7 @@ private void writeJunitReport(BuildJob buildJob, String safeFileName) throws Moj
17811779
if (buildLogFile != null && buildLogFile.exists()) {
17821780
getLog().debug("fileLogger:" + buildLogFile);
17831781
try {
1784-
systemOut.setValue(StringEscapeUtils.escapeXml10(FileUtils.fileRead(buildLogFile)));
1782+
systemOut.setValue(FileUtils.fileRead(buildLogFile));
17851783
} catch (IOException e) {
17861784
throw new MojoExecutionException("Failed to read logfile " + buildLogFile, e);
17871785
}
@@ -1791,7 +1789,7 @@ private void writeJunitReport(BuildJob buildJob, String safeFileName) throws Moj
17911789

17921790
try (FileOutputStream fos = new FileOutputStream(reportFile);
17931791
Writer osw = new OutputStreamWriter(fos, buildJob.getModelEncoding())) {
1794-
Xpp3DomWriter.write(new PrettyPrintXMLWriter(osw), testsuite, false);
1792+
Xpp3DomWriter.write(osw, testsuite);
17951793
} catch (IOException e) {
17961794
throw new MojoExecutionException("Failed to write JUnit build report " + reportFile, e);
17971795
}

0 commit comments

Comments
 (0)