Skip to content

Task :nodeSetup fails #124

Closed
Closed
@mwelsch

Description

@mwelsch

I'm aware of #88 but the issue seems to be closed/ignored.
Running gradle appInstall --info gives me the following error:

Initialized native services in: /home/gradle/.gradle/native
The client will now receive all logging from the daemon (pid: 45). The daemon log file: /home/gradle/.gradle/daemon/6.0.1/daemon-45.out.log
Starting 9th build in daemon [uptime: 16 mins 37.088 secs, performance: 100%, non-heap usage: 47% of 268.4 MB]
Using 8 worker leases.
Starting Build
Settings evaluated using settings file '/easylist/WebService/settings.gradle.kts'.
Projects loaded. Root project using build file '/easylist/WebService/build.gradle.kts'.
Included projects: [root project 'web']

> Configure project :
Evaluating root project 'web' using build file '/easylist/WebService/build.gradle.kts'.
Applying dependency management to configuration 'bootArchives' in project 'web'
Applying dependency management to configuration 'kotlinCompilerClasspath' in project 'web'
Applying dependency management to configuration 'kotlinCompilerPluginClasspath' in project 'web'
Applying dependency management to configuration 'kotlinNativeCompilerPluginClasspath' in project 'web'
Applying dependency management to configuration 'archives' in project 'web'
Applying dependency management to configuration 'default' in project 'web'
Applying dependency management to configuration 'compile' in project 'web'
Applying dependency management to configuration 'implementation' in project 'web'
Applying dependency management to configuration 'runtime' in project 'web'
Applying dependency management to configuration 'compileOnly' in project 'web'
Applying dependency management to configuration 'compileClasspath' in project 'web'
Applying dependency management to configuration 'annotationProcessor' in project 'web'
Applying dependency management to configuration 'runtimeOnly' in project 'web'
Applying dependency management to configuration 'runtimeClasspath' in project 'web'
Applying dependency management to configuration 'testCompile' in project 'web'
Applying dependency management to configuration 'testImplementation' in project 'web'
Applying dependency management to configuration 'testRuntime' in project 'web'
Applying dependency management to configuration 'testCompileOnly' in project 'web'
Applying dependency management to configuration 'testCompileClasspath' in project 'web'
Applying dependency management to configuration 'testAnnotationProcessor' in project 'web'
Applying dependency management to configuration 'testRuntimeOnly' in project 'web'
Applying dependency management to configuration 'testRuntimeClasspath' in project 'web'
Applying dependency management to configuration 'apiElements' in project 'web'
Applying dependency management to configuration 'runtimeElements' in project 'web'
Applying dependency management to configuration 'api' in project 'web'
Applying dependency management to configuration 'apiDependenciesMetadata' in project 'web'
Applying dependency management to configuration 'implementationDependenciesMetadata' in project 'web'
Applying dependency management to configuration 'compileOnlyDependenciesMetadata' in project 'web'
Applying dependency management to configuration 'runtimeOnlyDependenciesMetadata' in project 'web'
Applying dependency management to configuration 'testApi' in project 'web'
Applying dependency management to configuration 'testApiDependenciesMetadata' in project 'web'
Applying dependency management to configuration 'testImplementationDependenciesMetadata' in project 'web'
Applying dependency management to configuration 'testCompileOnlyDependenciesMetadata' in project 'web'
Applying dependency management to configuration 'testRuntimeOnlyDependenciesMetadata' in project 'web'
Applying dependency management to configuration 'kotlinScriptDef' in project 'web'
kotlin scripting plugin: created the scripting discovery configuration: kotlinScriptDef
Applying dependency management to configuration 'kotlinScriptDefExtensions' in project 'web'
Applying dependency management to configuration 'testKotlinScriptDef' in project 'web'
kotlin scripting plugin: created the scripting discovery configuration: testKotlinScriptDef
Applying dependency management to configuration 'testKotlinScriptDefExtensions' in project 'web'
Applying dependency management to configuration 'sourceArtifacts' in project 'web'
Applying dependency management to configuration 'developmentOnly' in project 'web'
Applying dependency management to configuration '-api' in project 'web'
Applying dependency management to configuration '-runtime' in project 'web'
All projects evaluated.
Selected primary task 'appInstall' from project :
Tasks to be executed: [task ':nodeSetup', task ':npmSetup', task ':appInstall']
:nodeSetup (Thread[Execution worker for ':',5,main]) started.

> Task :nodeSetup FAILED
Caching disabled for task ':nodeSetup' because:
  Build cache is disabled
Task ':nodeSetup' is not up-to-date because:
  Task has failed previously.
Resource missing. [HTTP GET: https://nodejs.org/dist/v12.12.0/ivy.xml]
:nodeSetup (Thread[Execution worker for ':',5,main]) completed. Took 0.228 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':nodeSetup'.
> Could not resolve all files for configuration ':detachedConfiguration3'.
   > Could not find org.nodejs:node:12.12.0.
     Searched in the following locations:
       - https://nodejs.org/dist/v12.12.0/ivy.xml
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 823ms
1 actionable task: 1 executed

The location the task has been looking for: https://nodejs.org/dist/v12.12.0/ivy.xml returns a 404 error.
My build.gradle.kts:

import com.moowork.gradle.node.npm.NpmTask
import com.moowork.gradle.node.yarn.YarnTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    id("org.springframework.boot") version "2.2.0.RELEASE"
    id("io.spring.dependency-management") version "1.0.8.RELEASE"
    id("com.moowork.node") version "1.3.1"
    kotlin("jvm") version "1.3.50"
    kotlin("plugin.spring") version "1.3.50"
}

node {
    // Version of node to use.
    version = "12.12.0"
    // Version of npm to use.
    npmVersion = "6.11.3"
    // Version of Yarn to use.
    yarnVersion = "1.19.1"
    // Base URL for fetching node distributions (change if you have a mirror).
    distBaseUrl = "https://nodejs.org/dist"
    // If true, it will download node using above parameters.
    // If false, it will try to use globally installed node.
    download = true
    // Set the work directory for unpacking node
    workDir = file("${project.buildDir}/src/main/app")
    // Set the work directory for NPM
    npmWorkDir = file("${project.buildDir}/src/main/app")
    // Set the work directory for Yarn
    yarnWorkDir = file("${project.buildDir}/src/main/app")
    // Set the work directory where node_modules should be located
    nodeModulesDir = file("${project.projectDir}/src/main/app")
}

group = "dev.easypass"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_1_8

val developmentOnly by configurations.creating
configurations {
    runtimeClasspath {
        extendsFrom(developmentOnly)
    }
}

repositories {
    mavenCentral()
    maven { url = uri("https://repo.spring.io/milestone") }
}

extra["springCloudVersion"] = "Hoxton.M3"

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-security")
    implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
    implementation("org.springframework.boot:spring-boot-starter-web")
    implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
    implementation("org.jetbrains.kotlin:kotlin-reflect")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    implementation("org.springframework.cloud:spring-cloud-starter-netflix-eureka-client")
    developmentOnly("org.springframework.boot:spring-boot-devtools")
    testImplementation("org.springframework.boot:spring-boot-starter-test") {
        exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
    }
    testImplementation("org.springframework.security:spring-security-test")
}

dependencyManagement {
    imports {
        mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
    }
}

tasks.withType<Test> {
    useJUnitPlatform()
}

tasks.withType<KotlinCompile> {
    kotlinOptions {
        freeCompilerArgs = listOf("-Xjsr305=strict")
        jvmTarget = "1.8"
    }
}

task<NpmTask>("appInstall") {
    group = "easypass"
    description = "Installs all dependencies from package.json"
    setWorkingDir(file("${project.projectDir}/src/main/app"))
    setArgs(listOf("install"))
}

task<NpmTask>("appBuild") {
    group = "easypass"
    description = "Builds production version of the webapp"
    setWorkingDir(file("${project.projectDir}/src/main/app"))
    setArgs(listOf("run", "build"))
}

task<NpmTask>("appTest") {
    group = "easypass"
    description = "Runs all tests of the webapp"
    setWorkingDir(file("${project.projectDir}/src/main/app"))
    setArgs(listOf("test"))
}

task("appCopy") {
    group = "easypass"
    copy {
        from("src/main/app/build")
        into("out/production/resources/main/static/")
        exclude("index.html")
    }
    copy {
        from("src/main/app/build")
        into("build/resources/main/static/")
        exclude("index.html")
    }
    copy {
        from("src/main/app/build")
        into("src/main/resources/static/")
        exclude("index.html")
    }
    copy {
        from(File("src/main/app/build/index.html"))
        into("out/production/resources/main/templates")
    }
    copy {
        from(File("src/main/app/build/index.html"))
        into("build/resources/main/templates")
    }

    copy {
        from(File("src/main/app/build/index.html"))
        into("src/main/resources/templates")
    }
}

task("appCopyProduction") {
    group = "easypass"
    copy {
        from("src/main/app/build")
        into("out/production/resources/main/static/")
        exclude("index.html", "backendtest.html")
    }
    copy {
        from("src/main/app/build")
        into("build/resources/main/static/")
        exclude("index.html", "backendtest.html")
    }
    copy {
        from("src/main/app/build")
        into("src/main/resources/static/")
        exclude("index.html", "backendtest.html")
    }
    copy {
        from(File("src/main/app/build/index.html"))
        into("out/production/resources/main/templates")
    }
    copy {
        from(File("src/main/app/build/backendtest.html"))
        into("out/production/resources/main/templates")
    }
    copy {
        from(File("src/main/app/build/index.html"))
        into("build/resources/main/templates")
    }
    copy {
        from(File("src/main/app/build/backendtest.html"))
        into("build/resources/main/templates")
    }
    copy {
        from(File("src/main/app/build/index.html"))
        into("src/main/resources/templates")
    }
    copy {
        from(File("src/main/app/build/backendtest.html"))
        into("src/main/resources/templates")
    }
}

task<Exec>("wasmBuild") {
    group = "easypass"
    workingDir = File("src/main/rust")
    commandLine = if (System.getProperty("os.name").toLowerCase().contains("windows")) {
        listOf("cmd", "/c", "wasm-pack", "build", "--release", "--no-typescript")
    } else {
        listOf("wasm-pack", "build", "--release", "--no-typescript")
    }
}

Running the build locally works. I checked my version which is 5.1 so I tried to change the docker tag to 5.1.1-jdk-slim. It didn't work and I wasn't expecting it because the error message doesn't look like it's version specific

Any help would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions