This is an automated email from the ASF dual-hosted git repository. rec pushed a commit to branch refactoring/325-Update-dependencies in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git
commit 5db3c81bb8a9ffef29230368fff9d7a76cf6ef0d Author: Richard Eckart de Castilho <r...@apache.org> AuthorDate: Thu Aug 3 11:55:59 2023 +0200 Issue #325: Update dependencies - junit4 -> 4.13.2 (needed for Maven plugin test harness...) - maven-plugin-testing-harness 2.0 -> 3.3.0 - maven-plugin-tools-javadoc 2.9 -> 3.5.2 - maven-compat -> 3.2.5 --- jcasgen-maven-plugin/pom.xml | 37 ++++++++++------- .../uima/tools/jcasgen/maven/JCasGenMojoTest.java | 13 ++++-- uimaj-parent/pom.xml | 47 ++++++++++++++++++++-- 3 files changed, 76 insertions(+), 21 deletions(-) diff --git a/jcasgen-maven-plugin/pom.xml b/jcasgen-maven-plugin/pom.xml index 8d8f6e69b..40f639908 100644 --- a/jcasgen-maven-plugin/pom.xml +++ b/jcasgen-maven-plugin/pom.xml @@ -16,7 +16,9 @@ specific language governing permissions and limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.uima</groupId> @@ -24,17 +26,20 @@ <version>3.5.0-SNAPSHOT</version> <relativePath>../uimaj-parent/pom.xml</relativePath> </parent> - - <!-- This artifact name follows the conventions described http://books.sonatype.com/mvnref-book/reference/writing-plugins-sect-custom-plugin.html - where patterns like xxx-maven-plugin and maven-xxx-plugin can be invoked just using xxx if the right settings are in place --> + + <!-- This artifact name follows the conventions described + http://books.sonatype.com/mvnref-book/reference/writing-plugins-sect-custom-plugin.html + where patterns like xxx-maven-plugin and maven-xxx-plugin can be invoked just + using xxx if the right settings are in place --> <artifactId>jcasgen-maven-plugin</artifactId> <packaging>maven-plugin</packaging> <name>Apache UIMA Maven: ${project.artifactId}</name> - <description>A Maven Plugin for using JCasGen to generate Java classes from XML type system descriptions</description> + <description>A Maven Plugin for using JCasGen to generate Java classes from + XML type system descriptions</description> <prerequisites> - <maven>3.0</maven> + <maven>${maven.version}</maven> </prerequisites> <dependencies> @@ -84,23 +89,26 @@ <dependency> <groupId>org.sonatype.plexus</groupId> <artifactId>plexus-build-api</artifactId> - <version>0.0.7</version> </dependency> <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-engine</artifactId> + <groupId>junit</groupId> + <artifactId>junit</artifactId> <scope>test</scope> </dependency> <dependency> - <groupId>org.junit.vintage</groupId> - <artifactId>junit-vintage-engine</artifactId> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.maven.plugin-testing</groupId> <artifactId>maven-plugin-testing-harness</artifactId> - <version>2.0</version> <scope>test</scope> </dependency> <dependency> @@ -120,7 +128,7 @@ <tagletArtifact> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-tools-javadoc</artifactId> - <version>2.9</version> + <version>3.5.2</version> </tagletArtifact> </tagletArtifacts> </configuration> @@ -145,7 +153,8 @@ <goal>package</goal> <goal>integration-test</goal> </goals> - <!-- change this next line by toggling the "!" character to include / exclude the long-running m2e test + <!-- change this next line by toggling the "!" character to include / + exclude the long-running m2e test It is normally excluded --> <invokerTest>classpath,multimodule,simple,!m2e</invokerTest> </configuration> diff --git a/jcasgen-maven-plugin/src/test/java/org/apache/uima/tools/jcasgen/maven/JCasGenMojoTest.java b/jcasgen-maven-plugin/src/test/java/org/apache/uima/tools/jcasgen/maven/JCasGenMojoTest.java index 7dce50176..8f99a76e0 100644 --- a/jcasgen-maven-plugin/src/test/java/org/apache/uima/tools/jcasgen/maven/JCasGenMojoTest.java +++ b/jcasgen-maven-plugin/src/test/java/org/apache/uima/tools/jcasgen/maven/JCasGenMojoTest.java @@ -18,6 +18,8 @@ */ package org.apache.uima.tools.jcasgen.maven; +import static org.assertj.core.api.Assertions.assertThat; + import java.io.File; import java.util.ArrayList; import java.util.List; @@ -28,9 +30,10 @@ import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.FileUtils; -import org.junit.Assert; +import org.eclipse.aether.RepositorySystemSession; import org.junit.Test; public class JCasGenMojoTest extends AbstractMojoTestCase { @@ -83,8 +86,10 @@ public class JCasGenMojoTest extends AbstractMojoTestCase { assertTrue(pomFile.exists()); // create the MavenProject from the pom.xml file + RepositorySystemSession session = MavenRepositorySystemUtils.newSession(); MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); ProjectBuildingRequest buildingRequest = executionRequest.getProjectBuildingRequest(); + buildingRequest.setRepositorySession(session); ProjectBuilder projectBuilder = this.lookup(ProjectBuilder.class); MavenProject project = projectBuilder.build(pomFile, buildingRequest).getProject(); assertNotNull(project); @@ -123,7 +128,7 @@ public class JCasGenMojoTest extends AbstractMojoTestCase { // no _type files in v3 // File typeFile = new File(jCasGenDirectory + "/" + type.replace('.', '/') + "_Type.java"); - Assert.assertTrue(files.contains(wrapperFile)); + assertThat(files).contains(wrapperFile); // no _type files in v3 // Assert.assertTrue(files.contains(typeFile)); @@ -132,9 +137,9 @@ public class JCasGenMojoTest extends AbstractMojoTestCase { } // check that no extra files were generated - Assert.assertTrue(files.isEmpty()); + assertThat(files).isEmpty(); // check that the generated sources are on the compile path - Assert.assertTrue(project.getCompileSourceRoots().contains(jCasGenDirectory.getAbsolutePath())); + assertThat(project.getCompileSourceRoots()).contains(jCasGenDirectory.getAbsolutePath()); } } diff --git a/uimaj-parent/pom.xml b/uimaj-parent/pom.xml index 0cd9709b9..7e5f4688b 100644 --- a/uimaj-parent/pom.xml +++ b/uimaj-parent/pom.xml @@ -145,6 +145,7 @@ <commons-csv-version>1.10.0</commons-csv-version> <jackson-version>2.15.2</jackson-version> <junit-version>5.9.3</junit-version> + <junit-vintage-version>4.13.2</junit-vintage-version> <mockito-version>4.11.0</mockito-version> <assertj-version>3.24.2</assertj-version> <xmlunit-version>2.9.1</xmlunit-version> @@ -180,6 +181,11 @@ <type>pom</type> <scope>import</scope> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit-vintage-version}</version> + </dependency> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> @@ -237,6 +243,31 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-build-api</artifactId> + <version>0.0.7</version> + </dependency> + <dependency> + <groupId>org.apache.maven.plugin-testing</groupId> + <artifactId>maven-plugin-testing-harness</artifactId> + <version>3.3.0</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>${maven.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + <version>${maven.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> + <version>${maven.version}</version> + </dependency> </dependencies> </dependencyManagement> @@ -255,10 +286,20 @@ <pluginManagement> <plugins> <plugin> - <!-- Can be removed after updating to the UIMA Parent POM 16 or higher --> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-plugin-plugin</artifactId> - <version>3.6.4</version> + <artifactId>maven-surefire-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-engine</artifactId> + <version>${junit-version}</version> + </dependency> + <dependency> + <groupId>org.junit.vintage</groupId> + <artifactId>junit-vintage-engine</artifactId> + <version>${junit-version}</version> + </dependency> + </dependencies> </plugin> </plugins> </pluginManagement>