Jenkins Build - Unable o find build.xml - jenkins

I am new to Jenkins and I am having trouble to solve the following problem (lack of knowledge). When I make a change in my Git Repo, Jenkins makes a new build with the following ERROR MESSAGE:
ERROR: Unable to find build script at /var/lib/jenkins/jobs/toolxy/workspace/build.xml
Whereby the Name toolxy is the the name of the gitRepo itself. So my question is what I have to do to make the build successful? Where does this build.xml come from? Do I have to create the file manually? What for?
Do I need ant to have a successful build?

Related

Build step 'Execute shell' marked build as failure The project should have the name

I am new to working with Jenkins and faced the following problem: I need to add a Java project to SVN-repository, then this project is automatically loaded into the jenkins account to which I was given access.
Jenkins is hosted on the remote server and I can't change any configuration there but only run builds and so on.
After I add a project to the repository, it appears in Jenkins with "failed" status.
The console output is as follows:
Project structure in SVN-repository:
In Jenkins has structure:
Tell me, please, what could be the problem and how can I fix it.
The problem is:
+ /var/lib/jenkins/scripts/jtl/checkProjectName.sh Practice1
The project should have the name Practice1
Currently you're checking out in workspace directory. Try to checkout your repository from workspace/Practice1 directory.

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.

How to collect report from copy artifact plugin

I use Jenkins to build complicated project from different sources. Last build copy artifact from previous builds and create product. I want to get report what exactly were copied(build name, build number, changelog of source build, etc)
Final build have no upstreams and started manualy or by commit into own git repo.
I think groovy postbuild step can help me. But i do not understand how to get access to CopyArtifactPlugin Property.
I find this workaround by parsing build log.
You can see gist here

Creating artifacts in jenkins

I have been tasked with looking into using Jenkins as a build server. So far I have managed to pull a project from git, restore the Nuget packages, build the project and run the unit tests. However I am struggling to find out how to generate the artifact.
The way the business would like to have the build server generate a zip file to a directory on the build server or a remote server for the systems team then to pick up and deploy to the relevant location. E.g. given a windows service project the built bin directory would be zipped up and put in the relevant artifact directory.
I thought that in order to do this I add an archive the artifacts post-build action. However I am getting the below error:
‘Watchdog.WinService.Monitor/bin/Release/*.zip’ doesn’t match anything:
‘Watchdog.WinService.Monitor’ exists but not
‘Watchdog.WinService.Monitor/bin/Release/*.zip’
If I look in the workspace for this project I can browse to the bin directory and see all the files so I unsure what I have done wrong.
Can someone please let me know if what I am trying to accomplish is possible, and also if our approach to using Jenkins is correct?
The problem is that you try to create the artifact using the archive artifatcs step.
But the step is to collect artifacts and show them on the job page.
That means you need to create the artifact first e.g. using a shell or batch script.
You can combine this with the Flexible Publish Plugin.
When you select this as post build step you can create a conditional action that runs the artifact archive task and as condition executes the script that creates the zip file.
So if that fails the task won't be executed. Also it may causes your job to 'fail' but that may not be the case in your job.

wildfly:deploy-artifact with downloaded artifact from command line

I am trying to deploy a downloaded war file using the deploy-artifact goal in Wildfly. I would like to do this from the command line.
I am getting the following error
deploy-artifact must specify the artifactId
I have added the wildfly details to the pom.xml and tried to run following command:
mvn wildfly:deploy-artifact -DtargetDir=${project.build.directory}
-DartifactId=artifact-name
I think this goal is not intended to be used from the command line since it requires the artifact to be a dependency of the project. The goal documentation doesn't state any user property for the artifactId or groupId parameters so these are only settable in the configuration section of the plugin. I'm also struggling with our test setup and deployment of artifacts from our maven repo. But if you have already downloaded the artifact why don't you just use the cli to deploy it?

Resources