Jenkins JUnit Attachments Plugin throws 404 for attached files - jenkins

Currently I'm running a Maven 3 build with Selenium/WebDriver tests. Whenever a test fails, it will snap a screenshot and save it to the correct folder (for the plugin). When the job finishes, I can see all the attachments listed. I can also copy the attachments off of the Jenkins server and view them.
However, whenever I try to view them in Jenkins, I'm seeing a 404 file not found exception. I've double checked the permissions of all the files involved, tried using both .jpg and .png extensions. I've commented on the JUnit Attachments Plugin wiki page. I'm thinking that it might be a bug at this point, but wanted to see if anyone has had it work with Maven builds.
n.b. I'm using version 1.3 of the plugin, version 1.540 of Jenkins, and the correct dependency for JQuery.
Edit: This is not specific to images. I attempted this with a text file, and still get a 404.

Related

Jenkins Pipeline S3 Upload: missing file

I'm in the process of migrating all our Jenkins jobs into pipelines and, using a JenkinsFile for better control (committed to CodeCommit, AWS' GIT).
One of the steps in our jobs is the Post Build Action that uploads files to S3, which works correctly in the Jenkins' jobs, but haven't been able to correctly replicate it in the JenkinsFile. I think I've tried every possible combination provided in the documentation but, despite the process says that "worked", no file appears in S3 console.
Since our target file gets named based on version number extracted from pom.xml, I need to use wildcards to get it's name using the following syntax:
s3Upload(bucket:"myBucket", path:'path/to/targetFolder/', includePathPattern:'**/*.war', workingDir:'target')
The 'path/to/targetFolder/' gets created and the log shows:
Uploading
file:/var/lib/jenkins/workspace/mailer%20pipeline/target/mailer%23%231.3.2.war to s3://myBucket/path/to/targetFolder/
Finished: Uploading to myBucket/path/to/targetFolder/
Upload complete
But no file gets into the target folder.
What could I be missing?
There was indeed an error in the plugin. I reported it to GitHub and a contributor released a fix.

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.

Archiva search doesn't show anything

I just wanted to give Archiva a try, but stumpled over some behaviour very quickly.
So, I downloaded the current release (1.3.6) on my Kubuntu machine, extracted it, started it via ./archiva console, put the archiva repository into the mirrors section in mavens settings.xml and made a maven build.
Everything seemed fine so far, I was able to browse the Archiva repository and saw all the artifacts of my build.
But when I type anything in the search box, I don't get results. For example I see the artifact with the id junit, but when I type junit in the search, it tells me that no results were found.
The documentation states that files are indexed after download, so what else may I have done wrong?
Does junit is an artifact of your build ?
It was probably already locally in your repository so no need to download tru Archiva that's why it's not here.
Note last version 1.4* download index from central repository and display result for search.
The 1.4-M4 (not yet released but I hope soon) will download the artifact too to show more details.

Getting output from remote hudson builds

I have recently added several Hudson agent machines to a working controller.
Some of the builds have result files (Doxygen output, Boost unit test results, cppcheck) which are published using the relevant plugins.
If these builds run on the controller, the output files are published successfully, but if they run on an agent, the build fails because the files cannot be found.
The plugins seem to be looking for the output files on the controller, when of course, they are on the agent.
Is there a way to fix this?
Plugins used:
- Jenkins Cppcheck Plug-in V1.2
- Doxygen Plugin V0.9
- HTML Publisher plugin V0.6
Edit:
Tried archiving suggestion, but I can't get it to work. cppcheck.xml is archived correctly and exists in the relative directory ../lastSuccessful/archive/cppcheck.xml
Hudson log:
Archiving artifacts
[Cppcheck] Starting the cppcheck analysis.
[Cppcheck] No cppcheck test report file(s) were found with the pattern
'../lastSuccessful/archive/cppcheck.xml' relative to
'/home/hudson/.hudson/jobs/1.11-IntegrationDebug/workspace'.
Did you enter a pattern relative to the correct directory?
Did you generate the XML report(s) for Cppcheck?
[Cppcheck] Parsing throws exceptions. No cppcheck test report file(s) were
found with the pattern '../lastSuccessful/archive/cppcheck.xml' relative to
'/home/hudson/.hudson/jobs/1.11-IntegrationDebug/workspace'.
Workaround: copy artifacts into your workspace and publish from there.

Hudson/Jenkins PMD Configuration

I am new to Jenkins and just started configuring it. This is what i have done till now:
Installed and configured Jenkins to display the home page. Added PMD plugin.
Set the HUDSON_HOME to a specific directory > C:\Work\Jenkins
Configured a test build to run a simple do-nothing ant script. It runs successfully
Written an independent pmdbuild.xml to run checks on a set of files in C:\myview (I am using clearcase). This xml also copies the output pmd_results.xml to the workspace directory in $HUDSON_HOME/[job-name]/workspace
Now I added the pmdbuild.xml as a step in my primary build. So my build has 2 steps:
a. Run a simple script, do-nothing.
b. Run pmdbuild.xml which generate pmd_results.xml and place it in $HUDSON_HOME/[job-name]/workspace (HARD-CODED as Jenkins PMD plugin expects the file there)
Jenkins picks up the pmd_results.xml automatically with the plugin and displays warnings and everything.
Now the problem:
If I click on a filename in the PMD results, it gives a filenotfound exception as it is looking for the source file in $HUDSON_HOME/[job-name]/workspace.
My java code files are placed in C:\myview (a clearcase snapshot view)
My question is, do I need all my code files to be present inside $HUDSON_HOME/[job-name]/workspace ?? Meaning can't I tell Jenkins to look for the PMD input files in C:\myview or any other directory instead of $HUDSON_HOME/[job-name]/workspace ??
Sorry for the extremely long description.
Jenkins expects that all the code is in the workspace. Usually Jenkins is used to check out a copy of the code into the workspace, and then runs all build steps on the Sources in the Workspace.
Might seem restraining at first, but it saves you a lot of trouble if you need to move Jenkins to another server, or create a slave instance.
So I would suggest you let Jenkins check out your code (there should be a clearcase plugin) into the workspace, and run the analysis on the checked out code.
If there are compelling reasons why your code has to stay where it is (C:\myview in your case) you can still set the workspace of your build to that directory (find this in the job configuration page, you need to click on the 'extended' button to see the option).

Resources