How to get logs from a Jenkins plug-in during Maven based development? - maven

I am developing a Jenkins plug-in and want to see some logging. I am using the Maven environment and running
mvn hpi:run
to launch Jenkins and my plug-in. I have enabled the Jenkins logger configuration to catch my logs - but I see no logs less severe than INFO.
So I guess that I need to configure something to drop my debugging logs into wherever (syslog?) Jenkins pulls them from (I am asking Jenkins to pull all logs).
Can someone please explain how to do this via Maven? I have seen the 'How to set jenkins log level from maven?' article and tried those techniques but this seemed to cause Jenkins to hang, with messages about console restarts.
Please be very specific as I'm a relative Java newbie and would rather you treated me like an idiot than gave me only half an answer, assuming I knew the rest ;-). Thanks!

Related

Allure plugin for TeamCity: why agent doesn't complete upgrade?

I've asked this question on Gitter, but answer directed me to the documentation I followed.
I'm administrator of TeamCity 2017.2.2 with agents running on Windows 10 (except one on 7). I installed allure-teamcity plugin version 2.6 and added allure tools in version 2.6 as described in the documentation.
The problem is the tool is propagated to the agent on upgrade, but not the plugin itself. Main server shows me the runner I can use as a build step, but once configured none of agents accept this configuration. I've checked agent directory and logs - the plugin is not there and logs doesn't indicate that there was even attempt to pull.
As a holder of commercial license I asked JetBrains technical support, but they told me I need to ask Allure authors. GitHub sends people to Gitter and here, hence the question after unlucky attempt on Gitter.
What do I need to do to get the plugin correctly pulled and working on agents?
Is allure plugin even compatible with TeamCity 2017.2.2?
The problem is that Allure TeamCity plugin looks for a tool called allure-commandline. So you need to make sure that allure-commandline.zip is present in your <TeamCity Data Directory>/plugins/.tools directory.

Exporting Jacoco*.exec files to Sonar without Maven or ANT or Jenkins

I don't know if this has been asked before; from a quick search I couldn't find anything relevant, but please do forgive me if I've missed it.
My question is we need to send the jacoco.exec output file to Sonar without using any other tool like Jenkins etc.
Below are the steps we did to configure Jenkins & Sonar
Jacoco agent code is setup and injected into our Application server (with WAS Console)
SonarQube is installed and configured in another server
When we perform manual execution on the application, jacoco is generating a Jacoco*.exec output files (File is in binary format)
Our challenge is how do we send this output file to Sonar, such that it reads and generates reports in a readable format?
PS. When integrated this with Jenkins and Maven, we are able to export this report to Sonar and see the reports properly. But, without using Jenkins and Maven, is there a way to export the Jacoco.exec file to Sonar and generate the reports??
Hope I am clear with my question. Please respond if any part of the question is not clear.
Thanks in advance for ur help!!

jenkins enable maven command line

I want to setup jenkins using the command-line only. I am successfully able to install plugins and configure jobs. So i've installed the maven-plugin using jenkins-cli but want to be able to configure it to say "Automatically install maven latest version" so that when the user triggers a build it will automatically go download maven and then use it just like it does using the GUI.
Any advice on how i can do this piece of configuration on the command-line (or scripted ideally) please?
This option is not and should never be available for the reason that it destroys the concept of reproducible builds.
Changing the maven version deliberately may break the build at some future time for no apparent reason and will definitely startle your users then.
Please avoid this situation.
Why not use maven wrapper instead, this way each project configures specifically which version of maven it needs and automatically downloads it.
https://github.com/takari/maven-wrapper
https://github.com/takari/maven-wrapper/blob/master/README.md

Intellij debug configuration with only an external tool

I am coding bukkit plugins on my Mac laptop, and to test I want to launch a jar file within the Intellij debug system (current version). If you dont know what bukkit is, all that really matters is that I am trying to execute
"java -jar craftbukkit.jar" in a certain directory.
I have figured out how to do this using a Maven configuration. Basically I created a new Maven configuration, then just ignored everything about Maven and added an external tool to the "Before Launch" section. Everything works, but there is this somewhat annoying notification whenever I close the server session. (Bukkit is the name of the configuration).
Error running Bukkit: No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system.
Basically I am wondering if
I could somehow prevent this warning from showing up as a bubble/in the event log
I could configure the Maven settings somehow such that it wouldnt do anything Maven related.
I could use another configuration method to just use the external tool I wish.
Also, for the record, I have tried setting the home directory and setting the maven directory, but while it does fix the errors, it causes the logger to try to run a maven session which quits out with another error. Basically if I try to fix the pop up the obvious way, it only leads to another error since I am not actually trying to use Maven.
Finally, you may say "its just a little balloon, who cares". True, its not a huge inconvenience, but to me it is worth at least doing some research before giving up on.

Where to observe application deployed by Jenkins?

Question from a first-time Jenkins user. So I hope you wouldn't mind if the question is too silly.
I have installed jenkins on a Ubuntu machine, and is accessible at localhost:8080. I have successfully configured it to work with Maven2 and Git as well. Next, I created a job/project (A Java/Spring application), and got it to build without error on Jenkins as well.
Now my question is, where do I see this application running? :)
Best Regards
James
To deploy : http://mojo.codehaus.org/tomcat-maven-plugin/plugin-info.html to do it with maven or https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin to do it with jenkins
You can see the console output in the running job if you click the running job and look for the link on the left hand side.
Building and deploying are two different things. Jenkins can do the latter for you too but you need to have it configured in your maven project. Typically this is accomplished (for tomcat) using the tomcat maven plugin

Resources