Jenkins构建失败:包org.eclipse.swt不存在

时间:2019-10-24 19:53:33

标签: java jenkins swt eclipse-rcp rcp

我正在尝试在Jenkins中使用以下配置构建RCP产品:maven:3.0.5和Java 1.7。它正在本地构建,但在Jenkins中失败,并出现以下错误。


int main() {
    double a, b, c, max, min;
    printf("Type number a\n");
    scanf_s("%lf", &a);
    printf("Type number b\n");
    scanf_s("%lf", &b);
    printf("Type number c\n");
    scanf_s("%lf", &c);
    printf("Yours numbers %lf/%lf/%lf\n", a, b, c);


    if (a > b) {
        max = a;
        min = b;
    }
    else (a < b); {
        max = b;
        min = a;
    }
    if (c > max) {
        max = c;

    }
    else (c < min); {
        min = c;
    }
    printf("Yours largest number is: %lf\n", max);
    printf("Yours smallest number is %lf\n", min);

    printf("Sum of yours numbers %lf\n", a + b + c);
}

POM中还存在以下依赖项:

 Started calculate disk usage of build
 Finished Calculation of disk usage of build in 0 seconds
 Started calculate disk usage of workspace
 Finished Calculation of disk usage of workspace in 0 seconds
 [INFO] [1m------------------------------------------------------------------------[m
 [INFO] [1;31mBUILD FAILURE[m
 [INFO] [1m------------------------------------------------------------------------[m
 [INFO] Total time: 7.360 s
 [INFO] Finished at: 2019-10-24T13:55:12-05:00
 [INFO] [1m------------------------------------------------------------------------[m
 Waiting for Jenkins to finish collecting data
 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project myrcp-app: Compilation failure: Compilation failure:
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[8,23] package org.eclipse.swt does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[9,30] package org.eclipse.swt.events does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[10,30] package org.eclipse.swt.events does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[11,32] package org.eclipse.swt.graphics does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[12,30] package org.eclipse.swt.layout does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[13,30] package org.eclipse.swt.layout does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/com/company/myrcp/app/internal/handlers/AboutHandler.java:[14,30] package org.eclipse.swt.layout does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[15,31] package org.eclipse.swt.widgets does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[16,31] package org.eclipse.swt.widgets does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[17,31] package org.eclipse.swt.widgets does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[18,31] package org.eclipse.swt.widgets does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[19,31] package org.eclipse.swt.widgets does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[20,31] package org.eclipse.swt.widgets does not exist
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[45,39] cannot find symbol
 [ERROR] symbol:   class Dialog
 [ERROR] location: class com.company.myrcp.app.internal.handlers.AboutHandler
 [ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/nternal/handlers/AboutHandler.java:[47,34] cannot find symbol
 [ERROR] symbol:   class Shell
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR] 

不确定我是否必须添加任何插件才能使其在Jenkins中运行?

1 个答案:

答案 0 :(得分:0)

如果您正在使用Maven,请指定版本。成功内置本地版本后,便可以调查所有依赖项是否可用。如果您尝试在内部运行eclipse,请了解依赖关系并帮助您在本地构建。

幸运的是,如果您正在另一台计算机上运行Jenkins来从仓库中构建代码,则必须指定版本,然后maven下载依赖项并进行构建。

可以通过内部维护远程存储库来消除它。如果您有内部仓库,请考虑检查仓库的可用性。