Help: How to access build.gradle test information via system.getPropperty() in main.java file

My build.gradle contains

plugins {
    id 'java'
}

group 'tlsattacks'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

test {
    useJUnitPlatform()
    testLogging {
        events "passed", "skipped", "failed"
    }
}
tasks.withType(JavaCompile) {
    options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
    options.deprecation = true
}

test {
    systemProperty "host", System.getProperty("host")
    systemProperty "port", System.getProperty("port")
}

dependencies {
    testImplementation(platform('org.junit:junit-bom:5.7.1'))
    testImplementation('org.junit.jupiter:junit-jupiter')
    implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1'
    compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.3'
    compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.3'
    compile fileTree(include: ['*.jar'], dir: 'lib')
    implementation group: 'org.json', name: 'json', version: '20210307'
}

src/main/java/ex/main.java contains

package ex;

public class main {
    public void main(String[] args){
        System.out.println("Recieved ip is:"+System.getProperty("host"));
        System.out.println("Recieved Port is:"+System.getProperty("port"));
    }
}

Received ip is: null
Recieved Port is: null

How to access these values .

Thanks in advance