<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>
   <artifactId>weld-junit-parent</artifactId>
   <packaging>pom</packaging>
   <version>5.0.1.Final</version>

   <name>Weld JUnit Extensions</name>
   <description>Set of JUnit extensions to enhance the testing of CDI components.</description>

   <parent>
      <groupId>org.jboss.weld</groupId>
      <artifactId>weld-parent</artifactId>
      <version>56</version>
   </parent>

   <url>http://weld.cdi-spec.org</url>
   <licenses>
      <license>
         <name>Apache License, Version 2.0</name>
         <distribution>repo</distribution>
         <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      </license>
   </licenses>

   <scm>
      <connection>scm:git:git://github.com:weld/weld-junit.git</connection>
      <developerConnection>scm:git:git@github.com:weld/weld-junit.git</developerConnection>
      <url>https://github.com/weld/weld-junit</url>
     <tag>5.0.1.Final</tag>
  </scm>

   <developers>
      <developer>
         <name>Weld committers</name>
      </developer>
   </developers>

   <properties>
       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

       <!-- Maven Compiler plugin configuration defined in Weld Parent -->
       <maven.compiler.argument.source>17</maven.compiler.argument.source>
       <maven.compiler.argument.target>17</maven.compiler.argument.target>
       <maven.compiler.argument.testSource>17</maven.compiler.argument.testSource>
       <maven.compiler.argument.testTarget>17</maven.compiler.argument.testTarget>

       <!-- Javadoc source version -->
       <javadoc.source>17</javadoc.source>
       
       <!-- Versions -->
      <version.junit4>4.13.2</version.junit4>
      <version.junit.jupiter>5.12.2</version.junit.jupiter>
      <!-- version.spock and version.junit.platform should be upgraded together -->
      <!-- see https://github.com/weld/weld-testing/pull/184#issuecomment-2024300488 -->
      <version.spock>2.4-M6-groovy-4.0</version.spock>
      <version.junit.platform>1.12.2</version.junit.platform>
      <version.groovy>3.0.24</version.groovy>
      <version.weld>6.0.3.Final</version.weld>
      <version.mockito>5.17.0</version.mockito>
      <version.jakarta.ejb.api>4.0.1</version.jakarta.ejb.api>
      <version.jakarta.inject>2.0.1</version.jakarta.inject>
      <version.jakarta.cdi>4.0.1</version.jakarta.cdi>
      <version.jpa-api>3.1.0</version.jpa-api>
      <version.log4j>2.24.3</version.log4j>
      <!-- SpotBugs properties -->
      <version.spotbugs>4.9.3</version.spotbugs>
      <version.spotbugs.plugin>4.9.3.0</version.spotbugs.plugin>
      <spotbugs.failOnError>false</spotbugs.failOnError>
      <spotbugs.threshold>Low</spotbugs.threshold>
   </properties>

   <modules>
      <module>junit4</module>
      <module>junit5</module>
      <module>spock</module>
      <module>junit-common</module>
   </modules>

   <dependencyManagement>

      <dependencies>

         <dependency>
            <groupId>org.jboss.weld.se</groupId>
            <artifactId>weld-se-core</artifactId>
            <version>${version.weld}</version>
         </dependency>

         <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${version.junit4}</version>
         </dependency>

         <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${version.junit.jupiter}</version>
         </dependency>

          <dependency>
              <groupId>org.junit.jupiter</groupId>
              <artifactId>junit-jupiter-params</artifactId>
              <version>${version.junit.jupiter}</version>
          </dependency>

         <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${version.junit.jupiter}</version>
         </dependency>

         <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>${version.spock}</version>
         </dependency>

         <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-testkit</artifactId>
            <version>${version.junit.platform}</version>
            <scope>test</scope>
         </dependency>

         <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>${version.groovy}</version>
         </dependency>

         <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${version.mockito}</version>
            <scope>test</scope>
         </dependency>

         <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-junit-common</artifactId>
            <version>${project.version}</version>
         </dependency>

         <dependency>
            <groupId>jakarta.ejb</groupId>
            <artifactId>jakarta.ejb-api</artifactId>
            <version>${version.jakarta.ejb.api}</version>
            <scope>test</scope>
         </dependency>

         <dependency>
            <groupId>jakarta.persistence</groupId>
            <artifactId>jakarta.persistence-api</artifactId>
            <version>${version.jpa-api}</version>
            <optional>true</optional>
         </dependency>

         <dependency>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-annotations</artifactId>
            <version>${version.spotbugs}</version>
         </dependency>

         <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${version.log4j}</version>
            <scope>test</scope>
         </dependency>

         <dependency>
            <groupId>org.jboss.weld.module</groupId>
            <artifactId>weld-ejb</artifactId>
            <version>${version.weld}</version>
            <scope>test</scope>
         </dependency>
      </dependencies>

   </dependencyManagement>

   <profiles>
       <profile>
           <id>spotbugs</id>
           <activation>
               <activeByDefault>false</activeByDefault>
               <property>
                   <name>env.WELD_JUNIT_DEBUG</name>
                   <value>spotbugs</value>
               </property>
           </activation>
           <build>
               <plugins>
                   <plugin>
                       <groupId>com.github.spotbugs</groupId>
                       <artifactId>spotbugs-maven-plugin</artifactId>
                       <version>${version.spotbugs.plugin}</version>
                       <configuration>
                           <effort>Max</effort>
                           <xmlOutput>true</xmlOutput>
                           <threshold>${spotbugs.threshold}</threshold>
                           <failOnError>${spotbugs.failOnError}</failOnError>
                           <excludeFilterFile>${spotbugs.excludeFilterFile}</excludeFilterFile>
                       </configuration>
                       <executions>
                           <execution>
                               <goals>
                                   <goal>check</goal>
                               </goals>
                           </execution>
                       </executions>
                   </plugin>
               </plugins>
           </build>
       </profile>
   </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <systemPropertyVariables>
                            <java.util.logging.config.file>${project.build.testOutputDirectory}/logging.properties</java.util.logging.config.file>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>addTestSources</goal>
                                <goal>compileTests</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <links>
                            <link>https://static.javadoc.io/org.jboss.weld.se/weld-se-core/${version.weld}/</link>
                            <link>https://static.javadoc.io/jakarta.inject/jakarta.inject-api/${version.jakarta.inject}/</link>
                            <link>https://static.javadoc.io/jakarta.enterprise/jakarta.enterprise.cdi-api/${version.jakarta.cdi}/</link>
                            <link>https://static.javadoc.io/org.jboss.weld.environment/weld-environment-common/${version.weld}/</link>
                            <link>https://static.javadoc.io/org.spockframework/spock-core/${version.spock}/</link>
                        </links>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <!-- Needed to download org.apache.maven.plugins:maven-compiler-plugin:jar -->
    <pluginRepositories>
        <pluginRepository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Repository Group</name>
            <url>https://repository.jboss.org/nexus/content/groups/public</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

</project>
