pom.xml

 <?xml version="1.0" encoding="UTF-8"?>

<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>

  <groupId>com.example</groupId>

  <artifactId>MyMavenApp</artifactId>

  <version>1.0-SNAPSHOT</version>

  <packaging>jar</packaging>


  <properties>

    <!-- Java version -->

    <maven.compiler.source>17</maven.compiler.source>

    <maven.compiler.target>17</maven.compiler.target>


    <!-- JUnit and Surefire versions -->

    <junit.jupiter.version>5.10.1</junit.jupiter.version>

    <surefire.plugin.version>3.0.0-M7</surefire.plugin.version>

  </properties>


  <dependencies>

    <!-- JUnit 5 API for writing tests -->

    <dependency>

      <groupId>org.junit.jupiter</groupId>

      <artifactId>junit-jupiter-api</artifactId>

      <version>${junit.jupiter.version}</version>

      <scope>test</scope>

    </dependency>


    <!-- JUnit 5 Engine for running tests -->

    <dependency>

      <groupId>org.junit.jupiter</groupId>

      <artifactId>junit-jupiter-engine</artifactId>

      <version>${junit.jupiter.version}</version>

      <scope>test</scope>

    </dependency>

  </dependencies>


  <build>

    <plugins>

      <!-- Compiler plugin for Java 17 -->

      <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-compiler-plugin</artifactId>

        <version>3.8.1</version>

        <configuration>

          <source>${maven.compiler.source}</source>

          <target>${maven.compiler.target}</target>

        </configuration>

      </plugin>


      <!-- Surefire plugin to run JUnit 5 tests -->

      <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-surefire-plugin</artifactId>

        <version>${surefire.plugin.version}</version>

        <configuration>

          <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>

        </configuration>

      </plugin>

    </plugins>

  </build>


</project>

Comments

Popular posts from this blog

exp 6

exp 5