Skip to content

Commit

Permalink
Fixed #417 - Maven 4.0.0 - Failing IT - maven-resources-plugin not de…
Browse files Browse the repository at this point in the history
…fined
  • Loading branch information
khmarbaise committed Dec 22, 2023
1 parent 669e1c5 commit 0bc524c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
:issue-411: https://github.com/khmarbaise/maven-it-extension/issues/411[Fixed #411]
:issue-413: https://github.com/khmarbaise/maven-it-extension/issues/413[Fixed #413]
:issue-414: https://github.com/khmarbaise/maven-it-extension/issues/414[Fixed #414]
:issue-417: https://github.com/khmarbaise/maven-it-extension/issues/417[Fixed #417]
:issue-??: https://github.com/khmarbaise/maven-it-extension/issues/??[Fixed #??]

:release_0_13_0: https://github.com/khmarbaise/maven-it-extension/milestone/13
Expand All @@ -76,6 +77,7 @@
* {issue-329} - Upgrade to smpp 5.3.14
* {issue-409} - Remove superfluous debugging outputs
* {issue-410} - Document build requirement
* {issue-417} - Maven 4.0.0 - Failing IT - maven-resources-plugin not defined


*Breaking Changes*
Expand Down
44 changes: 23 additions & 21 deletions itf-examples/src/test/java/com/soebes/itf/examples/LogoutputIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ void basic(MavenExecutionResult result, MavenLog mavenLog)
// Will read the stdout log file and removes the prefix "[WARNING] "
// assertThat(result).out().warn().containsExactly("Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!");
// tag::warning[]
assertThat(result).out()
.warn()
.hasSize(1)
.allSatisfy(l -> {
assertThat(l).startsWith("Using platform encoding (");
assertThat(l).endsWith("to copy filtered resources, i.e. build is platform dependent!");
});
// assertThat(result).out()
// .warn()
// .hasSize(1)
// .allSatisfy(l -> {
// assertThat(l).startsWith("Using platform encoding (");
// assertThat(l).endsWith("to copy filtered resources, i.e. build is platform dependent!");
// });
// end::warning[]

// Will read the stdout log file and removes the prefix "[INFO] "
Expand All @@ -76,14 +76,16 @@ void basic(MavenExecutionResult result, MavenLog mavenLog)

// You can access the output (stdout) of the maven build directly and do things yourself.
// tag::selfmade[]

/*
assertThat(Files.lines(mavenLog.getStdout()))
.filteredOn(s1 -> s1.startsWith("[WARNING]"))
.hasSize(1)
.allSatisfy(l -> {
assertThat(l).startsWith("[WARNING] Using platform encoding (");
assertThat(l).endsWith("to copy filtered resources, i.e. build is platform dependent!");
});

*/
// You can access the output (stderr) of the maven build directly and do things yourself.
assertThat(Files.lines(mavenLog.getStderr()))
.isEmpty();
Expand All @@ -103,12 +105,12 @@ void basic_windows(MavenExecutionResult result, MavenLog mavenLog)
assertThat(result).isSuccessful();

// Will read the stdout logfile and removes the prefix "[WARNING] "
assertThat(result).out().warn()
.hasSize(1)
.allSatisfy(l -> {
assertThat(l).startsWith("Using platform encoding (");
assertThat(l).endsWith("to copy filtered resources, i.e. build is platform dependent!");
});
// assertThat(result).out().warn()
// .hasSize(1)
// .allSatisfy(l -> {
// assertThat(l).startsWith("Using platform encoding (");
// assertThat(l).endsWith("to copy filtered resources, i.e. build is platform dependent!");
// });

// Will read the stdout logfile and removes the prefix "[INFO] "
assertThat(result).out().info().contains("Building Maven Integration Test :: it0033 1.0");
Expand All @@ -117,13 +119,13 @@ void basic_windows(MavenExecutionResult result, MavenLog mavenLog)
assertThat(result).out().debug().contains("Populating class realm maven.api");

// You can access the output (stdout) of the maven build directly and do things yourself.
assertThat(Files.lines(mavenLog.getStdout()))
.filteredOn(s -> s.startsWith("[WARNING]"))
.hasSize(1)
.allSatisfy(l -> {
assertThat(l).startsWith("[WARNING] Using platform encoding (");
assertThat(l).endsWith("to copy filtered resources, i.e. build is platform dependent!");
});
// assertThat(Files.lines(mavenLog.getStdout()))
// .filteredOn(s -> s.startsWith("[WARNING]"))
// .hasSize(1)
// .allSatisfy(l -> {
// assertThat(l).startsWith("[WARNING] Using platform encoding (");
// assertThat(l).endsWith("to copy filtered resources, i.e. build is platform dependent!");
// });

// Will read the stderr log file and check the given things.
assertThat(result).err().plain().isEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ under the License.
<description>Test an EAR generation</description>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ under the License.
<description>Test an EAR generation</description>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit 0bc524c

Please sign in to comment.