首页 > 解决方案 > Jenkins Job-Gradle 构建

问题描述

我有 gradle 的 java 项目。在本地我可以创建 jar,但是当我使用 jenkins 运行作业时,它会给出以下错误。

Started by user admin
Running as SYSTEM
Building in workspace C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Local Project
[Gradle] - Launching build.
[Local Project] $ cmd.exe /C "C:\gradle-5.0\bin\gradle.bat makeDeploymentJar-Pcmm -b C:\OUP\oup-aps\build.gradle && exit %%ERRORLEVEL%%"
Starting a Gradle Daemon, 1 busy and 3 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.

* Where:
Build file 'C:\OUP\oup-aps\build.gradle' line: 25

* What went wrong:
Plugin [id: 'io.github.http-builder-ng.http-plugin', version: '0.1.1'] 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 'io.github.http-builder-ng.http-plugin:io.github.http-builder-ng.http-plugin.gradle.plugin:0.1.1')
  Searched in the following repositories:
    Gradle Central Plugin Repository

* 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.

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

BUILD FAILED in 2m 25s
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE


------------------------------------------------
build.gradle line: 25

plugins {
    // Apply the java-library plugin to add support for Java Library
    id 'java-library'
    id 'maven'
    id 'eclipse'
    id "io.github.http-builder-ng.http-plugin" version "0.1.1"
}

标签: jenkinsgradlebuild.gradle

解决方案


推荐阅读