我该如何解决这个问题:蚂蚁不能"找不到文件"当试图建立在詹金斯Java Web应用程序? [英] How do I fix this: Ant cannot "find file" when trying to build a Java web application on Jenkins?

查看:273
本文介绍了我该如何解决这个问题:蚂蚁不能"找不到文件"当试图建立在詹金斯Java Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个自动生成系统与詹金斯CI为NetBeans多层Web应用程序项目。这NetBeans项目包含一个EJB项目(用于Web应用程序的业务层)和一个WAR项目(应用程序的Web层)。我目前停留在让Ant来编译该项目。

I am trying to set up an automatic build system with Jenkins CI for a NetBeans multitiered web application project. This NetBeans project contains an EJB-project (for the business layer of the web application) and a WAR-project (for the web layer of the application). I'm currently stuck on getting Ant to compile the project.

我使用Windows 8在NetBeans IDE 8.0开发。詹金斯还运行于Windows 8。

I am using Windows 8 to develop in NetBeans IDE 8.0. Jenkins also runs on Windows 8.

目前,我正在找人谁明白如何构建EJB-项目,詹金斯和Ant。

I'm currently looking for someone who understands how to build EJB-projects with Jenkins and Ant.

什么我迄今所做的:


  • 我已经成立了一个NetBeans项目(如上所述)

  • 我已经成立了一个Git仓库项目

  • 我已经设置了詹金斯CI

  • 我能够从詹金斯CI
  • Git仓库拿到项目
  • 我能做出詹金斯使用Ant来清洁它检索到的项目
    从Git仓库

  • I've set up a NetBeans project (as described above)
  • I've set up a git repository for the project
  • I've set up Jenkins CI
  • I am able to get the project from the git repository with Jenkins CI
  • I am able to make Jenkins use Ant to clean the project it retrieved from the git repository

我卡住:

是成功的,执行后的清洁的使用Ant命令我想使的调试的指挥工作。对于这个项目需要进行编译。这里是哪里出了问题。

After being succesful to execute the clean command with Ant I want to make the debug command work. For this the project needs to be compiled. Here is where it goes wrong.

我进入以下属性在属性字段中蚂蚁援引詹金斯:

I entered the following properties in the Properties field for the Ant Invoke in Jenkins:

libs.CopyLibs.classpath=C:/Program Files/NetBeans 8.0/java/ant/extra/org-netbeans-modules-java-j2seproject-copylibstask.jar
j2ee.server.home=C:/Program Files/wildfly-8.1.0.Final

在我的詹金斯的输出打造我看到了下面的命令:

In the output of my Jenkins build I see the following command:

[PGB的webapp] $的cmd.exe / c'C:\\ Program Files文件(x86)的\\詹金斯\\工具\\ hudson.tasks.Ant_AntInstallation \\ Apache_Ant \\ BIN \\ ant.bat-Dlibs。 CopyLibs.classpath = C:/ Program Files文件/ 8.0的NetBeans / JAVA / ANT /额外/ ORG-的NetBeans模块-java的j2seproject-copylibstask.jar-Dj2ee.server.home = C:/ Program Files文件/ wildfly-8.1 .0.Final清洁调试和放大器;&安培;出口%% ERRORLEVEL %%

这是我输出的最后一部分(这似乎对我最重要的部分)

And this is the last part of my output: (the part that seems most important to me)

init:

-init-cos:

-deps-module-jar:

-deps-ear-jar:

deps-jar:

-pre-pre-compile:
    [mkdir] Created dir: C:\Program Files (x86)\Jenkins\workspace\PGB Webapp\pgb-ejb\build\classes

-pre-compile:

-copy-meta-inf:
     [copy] Copying 2 files to C:\Program Files (x86)\Jenkins\workspace\PGB Webapp\pgb-ejb\build\classes\META-INF

-do-compile:
    [mkdir] Created dir: C:\Program Files (x86)\Jenkins\workspace\PGB Webapp\pgb-ejb\build\empty
    [mkdir] Created dir: C:\Program Files (x86)\Jenkins\workspace\PGB Webapp\pgb-ejb\build\generated-sources\ap-source-output
    [javac] Compiling 5 source files to C:\Program Files (x86)\Jenkins\workspace\PGB Webapp\pgb-ejb\build\classes

-post-compile:

compile:

-pre-dist:

library-inclusion-in-manifest:

BUILD FAILED
C:\Program Files (x86)\Jenkins\workspace\PGB Webapp\nbproject\build-impl.xml:204: The following error occurred while executing this line:
C:\Program Files (x86)\Jenkins\workspace\PGB Webapp\pgb-ejb\nbproject\build-impl.xml:806: Warning: Could not find file C:\Program Files (x86)\Jenkins\workspace\PGB Webapp\pgb-ejb\${libs.MySQLDriver.classpath} to copy.

Total time: 1 second
Build step 'Start Ant' marked build as failure
Finished: FAILURE

因此​​,在这种输出我看到了以下警告:

So in this output I see the following warning:

警告:找不到文件C:\\ Program Files文件(x86)的\\詹金斯\\工作区\\ PGB的webapp \\ PGB-EJB \\ $ {} libs.MySQLDriver.classpath复制

现在,对我来说这似乎是因为我几乎可以找到任何关于它在互联网上难得一见的问题我已经搜索在谷歌,这里SO和DuckDuckGo(或我使用了错误的搜索词?),我只能找到以下(pretty没用)线索,以我的问题:(pretty无用的,因为我得到的警告有提及,但背景是不同的。)

Now, to me this seems to be a rare issue as I can find almost nothing about it on the internet (or am I using the wrong search term?) I've searched on Google, here on SO, and DuckDuckGo, and I could only find the following (pretty useless) clues to my problem: (pretty useless because the warning I get is mentioned there, but the context is different..)

https://netbeans.org/bugzilla/show_bug.cgi?id=128505 和错误与数据库

任何帮助AP preciated因为我仍然pretty新的持续集成系统,开发Web应用程序和构建工具。

Any help is appreciated as I am still pretty new to continuous integration systems, developing web applications and build tools.

另外,我没有看过太多到Maven的或尚未摇篮作为替代。所以,也许解决问题的方法很可能会成为切换到另一个构建工具..?

Also, I haven't looked much into Maven or Gradle yet as alternatives. So maybe the solution to the problem might as well be to switch to another build tool..?

推荐答案

在我看来,如果财产libs.MySQLDriver.classpath没有定义。
当蚂蚁无法解析的属性,它使用属性名在输出中。

It seems to me as if the property libs.MySQLDriver.classpath is not defined. When Ant cannot resolve a property, it uses the property name in the output.

尝试定义

libs.MySQLDriver.classpath

在詹金斯的属性字段,您还定义了另外两个属性。

in the properties field in Jenkins where you also defined the other two properties.

您需要把它指向你的MySQL JDBC驱动程序。

You need to point it to your MySQL JDBC driver.

这篇关于我该如何解决这个问题:蚂蚁不能"找不到文件"当试图建立在詹金斯Java Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆