| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one |
| ~ or more contributor license agreements. See the NOTICE file |
| ~ distributed with this work for additional information |
| ~ regarding copyright ownership. The ASF licenses this file |
| ~ to you under the Apache License, Version 2.0 (the |
| ~ "License"); you may not use this file except in compliance |
| ~ with the License. You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, |
| ~ software distributed under the License is distributed on an |
| ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ~ KIND, either express or implied. See the License for the |
| ~ 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"> |
| <modelVersion>4.0.0</modelVersion> |
| |
| <groupId>org.example</groupId> |
| <artifactId>testng-junit5</artifactId> |
| <version>1.0-SNAPSHOT</version> |
| |
| <description>Project with mixed TestNG and JUnit5 tests.</description> |
| |
| <properties> |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| <maven.compiler.source>${java.specification.version}</maven.compiler.source> |
| <maven.compiler.target>${java.specification.version}</maven.compiler.target> |
| </properties> |
| |
| <dependencies> |
| <dependency> |
| <groupId>org.testng</groupId> |
| <artifactId>testng</artifactId> |
| <version>7.5.1</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.junit.support</groupId> |
| <artifactId>testng-engine</artifactId> |
| <version>1.0.4</version> |
| <scope>test</scope> |
| </dependency> |
| </dependencies> |
| |
| <build> |
| <pluginManagement> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-surefire-plugin</artifactId> |
| <version>${surefire.version}</version> |
| </plugin> |
| </plugins> |
| </pluginManagement> |
| </build> |
| |
| <profiles> |
| <profile> |
| <id>testng-only</id> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <configuration> |
| <testIncludes> |
| <!-- JUnit5Test.java ignored - Jupiter does not exist in dependencies. --> |
| <testInclude>**/TestNGTest.java</testInclude> |
| </testIncludes> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <profile> |
| <id>junit5-engine</id> |
| <dependencies> |
| <dependency> |
| <groupId>org.junit.jupiter</groupId> |
| <artifactId>junit-jupiter-engine</artifactId> |
| <!-- TODO check with next version of testng-engine --> |
| <!-- we have old junit-platform-commons:1.7.2 in dependency tree --> |
| <version>5.7.2</version> |
| <scope>test</scope> |
| </dependency> |
| </dependencies> |
| </profile> |
| <profile> |
| <id>junit5-api</id> |
| <!-- |
| This exclusion avoids inconsistent versions combination: junit-platform-engine:1.7.2 and junit-jupiter-api:5.8.2. |
| The surefire would add artifacts to the class path: junit-platform-*, junit-jupiter-engine, etc. |
| --> |
| <dependencyManagement> |
| <dependencies> |
| <dependency> |
| <groupId>org.junit.support</groupId> |
| <artifactId>testng-engine</artifactId> |
| <exclusions> |
| <exclusion> |
| <groupId>org.junit.platform</groupId> |
| <artifactId>junit-platform-engine</artifactId> |
| </exclusion> |
| </exclusions> |
| </dependency> |
| </dependencies> |
| </dependencyManagement> |
| <dependencies> |
| <dependency> |
| <groupId>org.junit.jupiter</groupId> |
| <artifactId>junit-jupiter-api</artifactId> |
| <!-- junit-jupiter-api has junit-platform-commons as nearest definition --> |
| <!-- so junit-platform-commons:1.8.2 wins ;-) --> |
| <version>5.8.2</version> |
| <scope>test</scope> |
| </dependency> |
| </dependencies> |
| </profile> |
| </profiles> |
| |
| </project> |