From ccb265ed6157a04f68657b130bf7f1a727fd1e49 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Fri, 3 May 2024 18:54:22 +0200 Subject: [PATCH] [MEJB-138] Update parent pom to 42 and dependencies --- pom.xml | 23 +++++++++---------- src/it/mejb-93/verify.groovy | 11 +++++---- .../org/apache/maven/plugins/ejb/EjbMojo.java | 21 ++++++++--------- 3 files changed, 26 insertions(+), 29 deletions(-) diff --git a/pom.xml b/pom.xml index 755bf4e..c1fe8b9 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ under the License. org.apache.maven.plugins maven-plugins - 39 + 42 @@ -50,7 +50,7 @@ under the License. Jenkins - https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven-ejb-plugin/ + https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-ejb-plugin/ @@ -61,10 +61,6 @@ under the License. 3.2.5 - 8 - 3.6.4 - 3.2.0 - 3.5.2 2022-04-18T18:55:30Z @@ -102,7 +98,7 @@ under the License. org.apache.maven maven-archiver - ${mavenArchiverVersion} + 3.6.2 org.apache.maven.plugin-tools @@ -112,27 +108,30 @@ under the License. org.apache.maven.shared maven-filtering - ${mavenFilteringVersion} + 3.3.2 org.apache.maven.shared maven-shared-utils - 3.3.4 + 3.4.2 org.codehaus.plexus plexus-utils - 3.5.1 + + + org.codehaus.plexus + plexus-xml org.codehaus.plexus plexus-archiver - 4.8.0 + 4.9.2 commons-io commons-io - 2.7 + 2.16.1 junit diff --git a/src/it/mejb-93/verify.groovy b/src/it/mejb-93/verify.groovy index 087b563..25cb297 100644 --- a/src/it/mejb-93/verify.groovy +++ b/src/it/mejb-93/verify.groovy @@ -19,6 +19,7 @@ import java.io.* import java.util.* +import groovy.xml.XmlSlurper /** * This will filter out the version of the @@ -52,17 +53,17 @@ if ( !jarFile.isFile() ) def buildLog = new File( basedir, "build.log" ).getText('UTF-8') -if (!buildLog.contains ('[INFO] --- maven-ejb-plugin:' + projectVersion + ':ejb (default-ejb) @ maven-it-mejb93 ---')) { +if (!buildLog.contains ('' + projectVersion + ':ejb (default-ejb) @ maven-it-mejb93 ---')) { println ( "default executions did not happen.") return false } -if (!buildLog.contains ('[INFO] --- maven-ejb-plugin:' + projectVersion + ':ejb (second-execution) @ maven-it-mejb93 ---')) { +if (!buildLog.contains ('' + projectVersion + ':ejb (second-execution) @ maven-it-mejb93 ---')) { println ( "second executions did not happen.") return false } -if (!buildLog.contains ('[ERROR] Failed to execute goal org.apache.maven.plugins:maven-ejb-plugin:' + projectVersion - + ':ejb (second-execution) on project maven-it-mejb93: ' - + 'You have to use a classifier to attach supplemental artifacts to the ' +if (!buildLog.contains ('[ERROR] Failed to execute goal org.apache.maven.plugins:maven-ejb-plugin:' + projectVersion + + ':ejb (second-execution) on project maven-it-mejb93: ' + + 'You have to use a classifier to attach supplemental artifacts to the ' + 'project instead of replacing them. -> [Help 1]')) { println ( "exception message does not exists or the expected content does not exist.") return false diff --git a/src/main/java/org/apache/maven/plugins/ejb/EjbMojo.java b/src/main/java/org/apache/maven/plugins/ejb/EjbMojo.java index 4c5bb4e..99dbd90 100644 --- a/src/main/java/org/apache/maven/plugins/ejb/EjbMojo.java +++ b/src/main/java/org/apache/maven/plugins/ejb/EjbMojo.java @@ -38,10 +38,10 @@ import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; +import org.apache.maven.shared.filtering.FilterWrapper; import org.apache.maven.shared.filtering.MavenFileFilter; import org.apache.maven.shared.filtering.MavenFilteringException; import org.apache.maven.shared.filtering.MavenResourcesExecution; -import org.apache.maven.shared.utils.io.FileUtils.FilterWrapper; import org.codehaus.plexus.archiver.Archiver; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.jar.JarArchiver; @@ -349,7 +349,7 @@ private File generateEjb() throws MojoExecutionException { archiver.setOutputFile(jarFile); // configure for Reproducible Builds based on outputTimestamp value - archiver.configureReproducible(outputTimestamp); + archiver.configureReproducibleBuild(outputTimestamp); File deploymentDescriptor = new File(sourceDirectory, ejbJar); @@ -357,10 +357,9 @@ private File generateEjb() throws MojoExecutionException { try { List defaultExcludes = Arrays.asList(ejbJar, "**/package.html"); - List defaultIncludes = DEFAULT_INCLUDES_LIST; IncludesExcludes ie = - new IncludesExcludes(Collections.emptyList(), excludes, defaultIncludes, defaultExcludes); + new IncludesExcludes(Collections.emptyList(), excludes, DEFAULT_INCLUDES_LIST, defaultExcludes); archiver.getArchiver().addDirectory(sourceDirectory, ie.resultingIncludes(), ie.resultingExcludes()); @@ -399,14 +398,12 @@ private File generateEjbClient() throws MojoExecutionException { clientArchiver.setOutputFile(clientJarFile); // configure for Reproducible Builds based on outputTimestamp value - clientArchiver.configureReproducible(outputTimestamp); + clientArchiver.configureReproducibleBuild(outputTimestamp); try { - List defaultExcludes = DEFAULT_CLIENT_EXCLUDES_LIST; - List defaultIncludes = DEFAULT_INCLUDES_LIST; - IncludesExcludes ie = - new IncludesExcludes(clientIncludes, clientExcludes, defaultIncludes, defaultExcludes); + IncludesExcludes ie = new IncludesExcludes( + clientIncludes, clientExcludes, DEFAULT_INCLUDES_LIST, DEFAULT_CLIENT_EXCLUDES_LIST); clientArchiver.getArchiver().addDirectory(sourceDirectory, ie.resultingIncludes(), ie.resultingExcludes()); @@ -486,9 +483,9 @@ private boolean isClientClassifierValid() { * @throws IOException if an error occurred while reading the file */ private String getEncoding(File xmlFile) throws IOException { - try (XmlStreamReader xmlReader = new XmlStreamReader(xmlFile)) { - final String encoding = xmlReader.getEncoding(); - return encoding; + try (XmlStreamReader xmlReader = + XmlStreamReader.builder().setFile(xmlFile).get()) { + return xmlReader.getEncoding(); } }