Vaadin Gradle 插件:任务 vaadinBuildFrontend 因依赖项错误而失败

Vaadin Gradle plugin: Task vaadinBuildFrontend fails with dependency error

我的应用程序基于 Spring Boot 2.2.5,包括 Vaadin 14。该项目是使用 Gradle 5.6.4 使用 Vaadin Gradle Plugin 0.6.0

构建的

Jenkins 构建管道失败并出现以下错误:

Welcome to Gradle 5.6.4!

Here are the highlights of this release:
 - Incremental Groovy compilation
 - Groovy compile avoidance
 - Test fixtures for Java projects
 - Manage plugin versions via settings script

For more details see https://docs.gradle.org/5.6.4/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :clean
> Task :nodeSetup
> Task :vaadinPrepareNode
> Task :compileJava
> Task :vaadinPrepareFrontend
> Task :processResources
> Task :classes

> Task :vaadinBuildFrontend FAILED
Command `/var/lib/jenkins/workspace/build-mokka-app/gradle/node/node /var/lib/jenkins/workspace/build-mokka-app/gradle/node/node_modules/npm/bin/npm-cli.js --no-update-notifier install` failed:

>>> Dependency ERROR. Check that all required dependencies are deployed in npm repositories.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':vaadinBuildFrontend'.
> com.vaadin.flow.server.ExecutionFailedException: Npm install has exited with non zero status. Some dependencies are not installed. Check npm command output

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

这是我的手工艺品...

build.gradle

plugins {
    id 'org.springframework.boot' version '2.2.5.RELEASE'
    id 'io.spring.dependency-management' version '1.0.9.RELEASE'
    id 'org.siouan.frontend' version '1.3.1'
    id 'com.vaadin' version '0.6.0'
    id 'java'
}

group = 'mygroup'
version = '1.4.0-rc.1'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

ext {
    commonsLangVersion = '3.9'
    vaadinVersion = '14.1.18'
}

repositories {
    mavenCentral()
    maven { url 'https://maven.vaadin.com/vaadin-addons' }
}

dependencyManagement {
    imports {
        mavenBom "com.vaadin:vaadin-bom:${vaadinVersion}"
    }
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'com.vaadin:vaadin-spring-boot-starter'
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
    compile "org.apache.commons:commons-lang3:${commonsLangVersion}"
}

test {
    useJUnitPlatform()
}

詹金斯文件

pipeline {
    agent any

    triggers { pollSCM('H/5 * * * *') }

    environment {
        APP_NAME = 'MyApp'

        // Gradle settings
        GRADLE_DOCKER_IMAGE = 'gradle:5.6.4-jdk8'
        GRADLE_DOCKER_ARGS = '-v ${HOME}/.m2:/maven/.m2'
        GRADLE_DEPENDENCY_PATH = 'build/dependency'    
    }

    stages {
        stage('Compile') {
            steps {
                script {
                    docker.image(GRADLE_DOCKER_IMAGE).inside("${GRADLE_DOCKER_ARGS}") {
                        sh './gradlew clean vaadinPrepareNode build -Pvaadin.productionMode'
                        sh "mkdir -p ${GRADLE_DEPENDENCY_PATH} && (cd ${GRADLE_DEPENDENCY_PATH}; jar -xf ../libs/*.jar)"
                    }
                }
            }
        }
    }
}   

谢谢,已在 https://github.com/vaadin/vaadin-gradle-plugin/issues/54 打开错误报告;请让我们在那里继续讨论。