you can pass the api key using command line variables similar to how you are passing env.
mvn test -PSmokeTests -Denv=QA -DapiKey="keyvalue123"
You can ccess api key inside your java project using the following command
String apiKey = System.getProperty("apiKey");
Answer from user2391218 on Stack OverflowMaven Repository
mvnrepository.com βΊ artifact βΊ io.rest-assured βΊ rest-assured
Maven Repository: io.rest-assured Β» rest-assured
January 16, 2026 - Rest-Assured is a Java library for testing REST services. ... aar android apache api arm assets build build-system bundle client clojure cloud config cran data database eclipse example extension framework github gradle groovy io ios javascript jvm kotlin library logging maven mobile module ...
Maven Central
central.sonatype.com βΊ artifact βΊ io.rest-assured βΊ rest-assured
Maven Central: io.rest-assured:rest-assured
--> <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> <properties> <httpclient.version>4.5.13</httpclient.version> </properties> <parent> <groupId>io.rest-assured</groupId> <artifactId>rest-assured-parent</artifactId> <version>6.0.0</version> </parent> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <version>6.0.0</version> <packaging>bundle</packaging> <name>REST Assured</name> <de
Videos
06:46
5. API Testing | RestAssured | How to Configure Rest Assured Maven ...
10:02
#3. |Rest Assured Framework|Creating Maven Project With Rest Assured ...
Rest Assured API automation framework development | Setup Rest ...
14:54
Set Up Rest Assured Maven Project in Eclipse | Add Dependencies ...
3. API Testing | RestAssured | Configuring Rest Assured ...
#4 Adding RestAssured maven dependency to the project - YouTube
Rest-assured
rest-assured.io
REST Assured
2025-12-12: REST Assured 6.0.0 is released. It raises the baseline to Java 17+, upgrades to Groovy 5, adds Spring 7 + Jackson 3 support (and bumps minimum versions for Spring/Yasson/Johnzon).
GitHub
github.com βΊ rest-assured βΊ rest-assured βΊ wiki βΊ gettingstarted
GettingStarted Β· rest-assured/rest-assured Wiki Β· GitHub
Standalone JsonPath (included if you depend on the rest-assured artifact). Makes it easy to parse JSON documents. Note that this JsonPath implementation uses Groovy's GPath syntax and is not to be confused with Kalle Stenflo's JsonPath implementation. Maven: <dependency> <groupId>io.rest-assured</groupId> <artifactId>json-path</artifactId> <version>6.0.0</version> <scope>test</scope> </dependency> Gradle: testImplementation 'io.rest-assured:json-path:6.0.0' Stand-alone XmlPath (included if you depend on the rest-assured artifact).
Author Β rest-assured
Medium
medium.com βΊ @reddy.lavi29 βΊ what-is-rest-assured-and-how-to-create-simple-rest-assured-api-automation-framework-b23a64b950f0
What is Rest Assured and How to Create Simple rest-assured API Automation Framework? | by Lavanya Reddy | Medium
January 12, 2024 - Here are the primary uses of RestAssured dependencies in a Maven project: ... <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>7.5</version> <scope>test</scope> </dependency> ... Create a test class in the src/test/java directory. For example, create a class named API_Test_Code.Java ... Creating a test case for a REST API using Rest Assured involves defining the request, sending it to the server, and then validating the response.
Maven Repository
mvnrepository.com βΊ artifact βΊ io.rest-assured
Maven Repository: io.rest-assured
Rest-Assured is a Java library for testing REST services. ... aar android apache api arm assets build build-system bundle client clojure cloud config cran data database eclipse example extension framework github gradle groovy io ios javascript jvm kotlin library logging maven mobile module ...
Maven Repository
mvnrepository.com βΊ artifact βΊ io.qameta.allure βΊ allure-rest-assured
Maven Repository: io.qameta.allure Β» allure-rest-assured
December 12, 2025 - Module allure-rest-assured of Allure Framework. ... aar android apache api arm assets build build-system bundle client clojure cloud config cran data database eclipse example extension framework github gradle groovy io ios javascript jvm kotlin library logging maven mobile module npm osgi ...
GitHub
github.com βΊ rest-assured βΊ rest-assured
GitHub - rest-assured/rest-assured: Java DSL for easy testing of REST services Β· GitHub
2025-12-12: REST Assured 6.0.0 is released. It raises the baseline to Java 17+, upgrades to Groovy 5, adds Spring 7 + Jackson 3 support (and bumps minimum versions for Spring/Yasson/Johnzon).
Starred by 7.1K users
Forked by 1.9K users
Languages Β Java 85.6% | Groovy 12.9%
Blazemeter
blazemeter.com βΊ blog βΊ rest-assured-api-testing
REST Assured API Testing: Complete Guide With Serenity | Perforce BlazeMeter
In our example, the Serenity framework will be used as a wrapper around the REST Assured API tests. We will learn how to set up a project structure to use Serenityβs important features. The main thing we will try to cover is how you can avoid code duplication by creating reusable methods and specifications.Back to top Β· Letβs start with the project creation. All you need in the first step is to create a Maven project with a basic structure in your favorite development environment (as for me, I prefer IntelliJ IDEA):
Stackademic
blog.stackademic.com βΊ set-up-robust-api-automation-framework-with-rest-assured-using-maven-22a88de8ccce
Set up Robust API Automation Framework with Rest Assured using Maven | by Chandan Kumar | Stackademic
March 17, 2025 - RestAssuredFramework βββ src/main/java # Main framework utilities β βββ base # Base classes (setup, config) β β βββ BaseTest.java β β βββ ConfigReader.java β βββ utils # Utility classes β β βββ APIUtils.java β β βββ JsonHelper.java βββ src/test/java # Test cases β βββ testcases # API Test cases β β βββ GetAPITests.java β β βββ PostAPITests.java β βββ data # Test data β β βββ testData.json βββ src/test/resources # Configuration files β βββ config.properties βββ pom.xml # Maven dependencies βββ testng.xml # Test execution configuration
Allure Report
allurereport.org βΊ docs βΊ restassured
Allure Report Docs β REST Assured
Add the Allure REST Assured integration to your project's dependencies. MavenGradle (Kotlin)Gradle (Groovy) xml Β·
Maven Central
central.sonatype.com βΊ artifact βΊ io.rest-assured βΊ rest-assured βΊ 4.1.1
Maven Central: io.rest-assured:rest-assured:4.1.1
--> <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> <properties> <httpclient.version>4.5.3</httpclient.version> </properties> <parent> <groupId>io.rest-assured</groupId> <artifactId>rest-assured-parent</artifactId> <version>4.1.1</version> </parent> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <version>4.1.1</version> <packaging>bundle</packaging> <name>REST Assured</name> <des
Naukri
naukri.com βΊ code360 βΊ library βΊ setup-a-basic-rest-assured-maven-project-in-eclipse-ide
Setup a Basic REST Assured Maven Project in Eclipse IDE
March 27, 2024 - Almost there... just a few more seconds
Medium
naodeng.medium.com βΊ rest-assured-tutorial-building-a-rest-assured-interface-automation-test-program-from-0-to-1-aa8c3f98c6d2
REST Assured Tutorial: Building a REST Assured API Automation Test Program from 0 to 1 | by Nao | Medium
January 4, 2024 - Initialization complete: After completing the wizard, Maven will create a new project directory and a basic Maven project structure Β· Add the following to the pom.xml file in your project Β· You can copy the contents of the pom.xml file in this project. For more information on configuration, please refer to the official documentation. <!-- dependencies config --> <dependencies> <!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured --> <dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <version>5.3.1</version> <scope>test</scope> </dependency>
Google Groups
groups.google.com βΊ g βΊ rest-assured βΊ c βΊ opulYbQFfIY
Maven issue with REST Assured, and how I fixed it
If your project uses some of the same libraries that rest-assured uses, it could cause conflicts if there are different versions. I also had to include this right after the above dependency: <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.1</version> <scope>test</scope> </dependency> Maven was for some reason unable to resolve this one on its own.