Gradle not looking into .m2 folder

Hi,

ive moved code from one system with internet connection to a offline system with only lan access, but somehow gradle can’t build the code here. I copied ~/.m2 and also the .gradle folder to my new code folder.
it also ignores the maven artifactory. Even with the exact same gradle version (7.0.2).

When running with --debug it is trying to reach https://plugins.gradle.org:443 - which is blocked, but when searching the debug log, there’s not one mention of the string .m2…why?

build.gradle' line: 31

* What went wrong:
Plugin [id: 'org.springframework.boot', version: '2.5.0'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.5.0')
  Searched in the following repositories:
    Gradle Central Plugin Repository

but the .jar exists (122kb)

"C:\Users\MYUSER\.m2\repository\org\springframework\boot\spring-boot-gradle-plugin\2.5.0\spring-boot-gradle-plugin-2.5.0.jar"
buildscript {
    ext {
        springBootVersion = '2.0.0.M1'
    }
    repositories {
        maven {
            url "https://someip:8000/artifactory/public/"
        }
        maven {
            url "https://someip:8000/artifactory/atlassian-public-cache/"
        }
        mavenLocal()
        
        
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}



plugins {
    id 'org.springframework.boot' version '2.5.0'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
    id 'eclipse'
}

group = 'com.company.testcode'
version = '1.0.0'
//sourceCompatibility = '11'
sourceCompatibility = '8'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenLocal()
    maven {
        url "https://someip:8000/artifactory/public/"
    }
}

dependencies {

    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'javax.validation:validation-api:2.0.1.Final'
    implementation 'org.webjars:bootstrap:5.0.1'
    runtimeOnly 'org.webjars.npm:bootstrap-icons:1.5.0'
    runtimeOnly 'org.webjars:jquery:3.6.0'
    runtimeOnly 'org.webjars:popper.js:2.9.2'
    runtimeOnly 'org.webjars:chartjs:3.5.1'
    runtimeOnly 'org.webjars:datatables:1.10.19'
    runtimeOnly 'com.oracle.database.jdbc:ojdbc8:21.5.0.0'
    runtimeOnly 'com.h2database:h2:1.4.200'
    implementation 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M1'
    implementation 'org.springframework.boot:spring-boot-starter-test'
    implementation 'junit:junit:4.13.2'
    developmentOnly 'org.assertj:assertj-parent-pom:2.2.8'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    annotationProcessor 'org.projectlombok:lombok'
    implementation 'info.picocli:picocli:4.6.1'
    testImplementation 'org.mockito:mockito-core:4.1.0'
    implementation 'org.apache.logging.log4j:log4j-api:2.17.0'

}

test {
    useJUnitPlatform()
}


jar {
    duplicatesStrategy = 'include'
    manifest {
    //duplicatesStrategy = 'include'
        attributes(
                'Main-Class': 'com.company.testcode.Main'
        )
    }
    from {
        //duplicatesStrategy = 'include'
        configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
    }
 }

thank you for your time

You did not configure any plugin repositories in your settings script, so the default is used, which is the Gradle Plugin Portal.