Build Error in Ant +Ivy project in Jenkins - ant

I am new to jenkins and am trying to build an Ant+Ivy project using jenkins and have configured Java_Home as C:\Program Files\Java\jdk1.6.0_21.I have pasted the console output.
09:38:47
09:38:47 BUILD FAILED
09:38:47 Target "Files" does not exist in the project "abc".
09:38:47
09:38:47 Total time: 0 seconds
09:38:47 Build step 'Invoke Ant' marked build as failure
09:38:48 Archiving artifacts
09:38:48 Finished: FAILURE
PS: I have checked that targets called are present in build.xml and also I am able to run it from the windows console.I believe the problem is the space between Program and Files(may be ant considers "files" as target).Please Help!

As I thought it was due to the space between Program and Files in the path.I gave my directory paths without spaces and it works fine now.

Related

Unable to deploy war file on to Tomcat8 in jenkins

I'm doing a project as part of DevOps certification.
I need to build a pipeline which contains around 6 steps.
In the 5th step, I need to generate a .war file (which is successful).
In the last step, i need to deploy the war file which contains artifacts on to tomcat using Jenkins.
The project keeps failing. Is that something because of incorrect configuration. Here are the attached screenshots of build, post-build actions, and the console output of project.
Build and post-build actions
console-output of the project
Where am I doing it wrong.
There's issue either while reading your dependencies from pom.xml file or there are some missing dependencies. The stack trace gives build failure in gameoflife-web module.
Try building the same module in Eclipse IDE and you'll find the same error there and you can solve this by adding proper dependencies.
This issue is not of Jenkins when the build is not successful, it will always fail.

Ant build: works in terminal, fails in Jenkins

I have a Java project developed in Eclipse. The project builds fine in Eclipse. Now I want to build it in Jenkins. From Eclipse, I have exported an Ant build.xml, which I have added to a Jenkins project.
When I run the build in Jenkins it immediately generates an error. This is the (anonymised) console output:
Started by user Admin User
Building in workspace /var/lib/jenkins/workspace/Project1
[projectname] $ ant -file build.xml class1.method1 class1.method2 Buildfile:
/home/ubuntu/eclipse-workspace/projectname/build.xml
class1.method1:
BUILD FAILED /home/ubuntu/eclipse-workspace/projectname/build.xml:91:
Could not create tempfile in /home/ubuntu/eclipse-workspace/projectname
Total time: 4 seconds Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
I copied the Ant command line from the console and ran it in a terminal window (in the folder where the build.xml exists) and it worked fine.
I am using Jenkins 2.60.2, Ant 1.9.6, Jenkins Ant plugin 1.5, Ubuntu 16.04.
I'm fairly new to working with these tools on Ubuntu but I guess it is something to do with either my Jenkins/Ant configuration or user permissions. What have I missed?

Sonarqube build for UWP-App failed

I habe a TFS-Server-Build (TFS 2017) on a Build-Agent with VS 2017. The first Buildstep (Prepare the Sonarqube analysis) and the build of the solution works fine. But i have a error at "Complete the SonarQube analysis":
2017-05-29T03:06:09.1933915Z ##[error]The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
2017-05-29T03:06:09.1933915Z ##[error]Possible causes:
2017-05-29T03:06:09.1933915Z ##[error]1. The project has not been built - the project must be built in between the begin and end steps
2017-05-29T03:06:09.1933915Z ##[error]2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported
2017-05-29T03:06:09.1933915Z ##[error]3. The begin, build or end steps have not all been launched from the same folder
2017-05-29T03:06:09.1933915Z Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
2017-05-29T03:06:09.1933915Z ##[error]05:06:09.115 Post-processing failed. Exit code: 1
Can anyone help?
Kind regards
Sebastian
I am not familiar with TFS-Server-Build,, but the possible causes are mentioned.
Check the following link for more details on how to set it up properly
Just like the error mentioned this stands for SonarQube was unable to collect the required information about your projects
Even though you have installed MSBUILD 12 or above, you should make sure the Build agent is calling the right version.
And double check if the MSBuild.SonarQube.Runner and MSBuild is running from the same working directory. At .sonarqube/out folder the sonar-project.properties is getting created or not.

build failed in hudson when building job for deploy target

Have built a simple ADF web application in jdevelper and built ant build file when i run the file all ant targets run fine however when i try to run targets in hudson all targets run fine except deploy target and the build failed and have this error
BUILD FAILED
C:\Windows\System32\config\systemprofile.hudson\jobs\sunday\workspace\ViewController\build.xml:282:
taskdef class oracle.jdeveloper.deploy.ant.OJDeployAntTask cannot be
found using the classloader AntClassLoader[] total time:0 seconds
finished: failure
In the build.properties file try to give absolute path for the variable oracle.home
It resolved the issue in my case.

building failure in jenkins as build.sh: not found

I am building a free style project in jenkins. configure setting for execute shell script as
build.sh -label $JOB_NAME -$BUILD_NUMBER -java_home $JAVA_HOME
when i try to build the project, i have a console output as build failure.
Building in workspace /var/lib/jenkins/workspace/jmxweb
[jmxweb] $ /bin/sh -xe /tmp/hudson4723307331600368596.sh
+ build.sh -label jmxweb -8 -java_home /usr/lib/jvm/java-7-oracle
/tmp/hudson4723307331600368596.sh: 2: /tmp/hudson4723307331600368596.sh: build.sh: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
According to the documentation
Builds for Non-Source Control Projects
There is sometimes a need to build a project simply for demonstration purposes or access to a SVN/CVS repository is unavailable. By choosing to configure the project as "None" under "Source Code Management" you will have to:
1 Build the Project at least once, (it will fail), but Jenkins will create the structure jenkins/workspace/PROJECTNAME/
2 Copy the project files to jenkins/workspace/PROJECTNAME/
3 Build again and configure appropriately
Try running : $WORKSPACE/build.sh -label $JOB_NAME -$BUILD_NUMBER -java_home $JAVA_HOME
The error is definitely because it can't find the file where you're looking for it. explicitly specifying the path should make sure it'll look for it in the current workspace.
Good luck!

Resources