6

I'm setting up Jenkins for the first time and running into an issue where Jenkins does not appear to even attempt to execute the Ant task I've specified.

I've defined my JDK and Ant installations under Manage Jenkins.(jenkins installations)

I've setup my Job to Invoke Ant using the Targets 'war-all'(job build)

Whether I force a build or wait for it to naturally execute after the next commit, there is nothing in the Build Console Output about attempting to execute the ant task.

Here is a sample Console Output:(console output)

Any ideas as to why it might not be executing would be appreciated. Also tips on how I can find more logging from Jenkins which might provide clues as to why it is not executing would be helpful. I'm not sure what Logger I might specify or even then where the logging information is written on the file system.

Sarah Haskins
  • 1,355
  • 2
  • 16
  • 25

5 Answers5

3

The problem was that I was selecting "Build multi-configuration project" as the type of my job. When I select "Build a free-style software project" as my job type the Ant task will execute after the SVN update.

Sarah Haskins
  • 1,355
  • 2
  • 16
  • 25
0

In my case,ant default target was not being picked up from build.xml so I had to explicitly mention the target in jenkins option. I resolved this by changing the jdk to default and then again switched to what was set earlier.This is a workaround but not sure how this resolved.

abhinav
  • 411
  • 6
  • 7
0

Looks like your svn doesn't see any changes and therefor is not re-building the module.

Try deleting the workspace and re-trigger the build, or change the check-out strategy to 'Always check out a fresh copy'.

wjans
  • 10,009
  • 5
  • 32
  • 43
0

I faced the same problem when upgraded to 1.417 from 1.413.

The combobox "Ant version" disappeared from "Invoke ant" build step. It should be here.

I just downgraded to 1.413 and continue to work.

So, the answer is - you should specify "Ant version" in project settings. But you cannot do it in 1.417.

Andrey Regentov
  • 3,687
  • 4
  • 34
  • 40
  • 1
    As voorth described in https://issues.jenkins-ci.org/browse/JENKINS-10064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=149710#comment-149710, there is a workaround - specifying Ant 1.8.2 for each "Invoke ant" element in config.xml. Not so convenient however: you should specify it each time after you press "Save" on project settings. – Andrey Regentov Jun 22 '11 at 11:15
  • I just downgraded to 1.413 and am seeing the same behavior, although I do see that now I have the in the config.xml. – Sarah Haskins Jun 22 '11 at 13:01
  • Do you see the "Ant version" field in "Invoke Ant" build step? It is located in project->Configure. You should specify your ant there instead of "(Default)". This should be the same ant that you pointed in Manage Jenkins->Configure System->Ant. – Andrey Regentov Jun 23 '11 at 08:04
  • This issue should be fixed in 1.419, according to "upcoming changes" from http://jenkins-ci.org/changelog – Andrey Regentov Jun 23 '11 at 08:19
  • I do see the "Ant version" field in "Invoke Ant". I'm a little worried that upgrading to 1.419 won't actually resolve this issue. It could be something obscure because I actually tried to install the latest Hudson build 2.0.1 and it behaved the same way. Making me wonder if it is the environment and not the product. – Sarah Haskins Jun 23 '11 at 14:37
  • Ahh, disregard this answer. I thought that you are getting "unable to execute ant" message, and it really is a regression since 1.416. But I see now from your question, you have no messages about ant at all. It's different. – Andrey Regentov Jun 28 '11 at 08:29
0

It seems like Jenkins doesn't like when you create a job before configuring JDK. If that happens, job will never work properly. So, for me the solution was:

  1. Delete job.
  2. Configure JDK
  3. Re-create job.

Probably the same problem may arise when job's JDK is deleted.

Stas
  • 1,707
  • 15
  • 25