No agent could be found with the following capabilities:Maven - tfs

No agent could be found with the following capabilities:Maven Note:- I am able to build in TFS without maven. but when i am adding maven as a build step then I am getting this issue while building. Could anyone please help to resolve this issue?

There is no "maven" listed in your screenshot, make sure the Maven is installed and can run successfully on the build agent. And restart the build service after the Maven is installed. Attached my capabilities for your reference:
If you are sure that the Maven is installed and can works but the capabilities list still does not show it, you can add it to the capabilities list manually:

On the machine running agent, adding system variable with name 'maven' fixes it.
Restarting agent service needed after adding environment variable.

If your agent can't discover the capability maven, follow these steps to fix the issue:
Remove the registered agent
Go to the environment variables on your server in 'System'
Add two variables "MAVEN_HOME" and "M2_HOME" with both as value the installation directory of maven. In my case is this: "C:\Program Files\Java\apache-maven-3.3.9"
Restart server
Register agent again and voila, the agent should have the capability: "MAVEN_HOME", "M2_HOME" and "maven"

The Maven build step requires the build agent to have Maven installed. The build agent your using must have a capability defined for "Maven".
FYI - The default hosted agent in VSTS has maven installed.
Read the following blog post for more information on adding capabilities:
http://donovanbrown.com/post/how-to-register-capabilities-on-your-build-and-release-management-agents

Related

run sonarQube via jenkins Task 'my-task' does not exist. Please use 'list' task to see all available tasks

I've got a server in work which has sonarQube, Gitlab and jenkins running side by side with Maven also on the box. I have also a project on this box i wish to test with sonarqube (located on this same box in /home/{user}/live/{sitename}/htdocs). I created a job in sonarqube, the only options i had where to call it something and I've no idea how this links to the actual project or where it is expecting to find the project to scan. in jenkins I added build step for sonarqube, again no option on where to find the code. i ran it anyway and to no surprise it failed asking me to use list to see all available, not being funny but where do i do this?
So I have 2 questions really:
where is sonarQube looking for this code, i presume symbolic links are good in this location to the actual code right?
where do i find and use this list command? is this in jenkins or sonarqube?
sonarqube jankins and gitlab are all accessible on our intranet with different default ports (8080, 8008 and 9000) i have the sonarqube scanner plugin on jenkins and it is using maven? Does anyone know of any good tutorials to setup this kind of scenario?
thanks
Craig
Configure your current Job and set below.
Under Build->Execute SonarQube Scanner
Task to run : leave it blank
Path to project properties: Specify your sonar project properties file
path
Before doing above changes make sure that below configurations are set
Jenkins->Manage Jenkins->Sonar Servers
Name:Sonarqube
Server URL: http://localhost:9000/sonarqube
Server authentication token: Generate in SonarQube in specify here
Jenkins->Manage Jenkins->Global Tool Configuration->SonarQube Scanner
SonarQube Scanner installations:
Name: SonarScanner
Install automatically: Tick checkbox
Install from Maven Center: Choose compatible SonarScanner version
I was able to get this working in the end but after upgrading sonarqube we decided to use the new pipelines feature, this took a while to configure but we are now able to do code analysis on our builds, see this link for details

TFS 2015:No agent could be found with the following capabilities: msbuild, visualstudio, vstest

We have recently upgraded to TFS 2015 Update 4. When I tried to do a build, I am getting the following error:
There are issues with the request or definition that may prevent the build from running:No agent could be found with the following capabilities: msbuild, visualstudio, vstest Queue the build anyway?
I tried the workaround mentioned in this link, but still couldn't figure out.
I have installed VS 2017 Enterprise in the Build Machine. Note, that since this is a POC I have installed Build Agent on the TFS Server itself.
Should anything extra be need to be installed? Please help.
TIA
You could double check if you are missing some capabilities such as VSTEST_15.0 for the build agent.
Settings- Agent Queues- Agent Pool - Agent- Capabilities
If the test related capabilities are missing, you could try to reregister the build agent. Or manually add the capabilitie by select +.
Recently I had the same issue: installed VS2017, configured build agent, visualstudio and msbuild capabilities missing.
Try installing VS2015 next to VS2017. Re-configure the build agent after this (in my case, I completely removed all the old _diag, _work and settings.json data as well). This fixed the issue for me, the missing capabilities were now recognized.
I was getting the same error out of the blue and it was running fine the previous week.
Restarting the build agent service resolved the error for me

Jenkins Automation help required

I have been assigned a task to do build automation using jenkins which should perform checkout, compile & build automatically.
Existing set up - Currently we have PVCS installed in one of our AIX server where build process(checkout,compile,build) is automated using ant script.
I have installed jenkins in my windows server.
How do i get the code into my windows server from PVCS which resides in AIX server to perform build through jenkins.
Thanks in advance.
As I posted on CodeRanch where you posted the same question, you need to install the PVCS plugin for Jenkins.

Restore nuget package Jenkins

When I tried to use Jenkins as our CI environment to build ASP.NET MVC5 project, I set up to use MSBuild.exe to build project.
But when the cmd run into restore nuget packages, it stucked. The error message is as below:
WARNING: Unable to connect to the remote server
Unable to find version '3.4.1.9004' of package 'Antlr'.
Build step 'Execute Windows batch command' marked build as failure
But if I use windows command line to run the msbuild, it is working and could download the pkg from nuget.org. Error only happened when try to build in Jenkins. And my network is fine, but behind a company proxy/firewall, I am not sure what it is. And I have set to auto restore nuget package in VS2013.
Any idea is much more appreciated.
I finally found out the root cause, it is the Jenkins service has not enough access right. Open windows services and right click on the Jenkins service, in the security tab, change the default user to whom that has enough access right to the Internet.

Jenkins not able to use SVN credentials or download new plugins/new versions

Can anyone suggest how to fix the two issues?
- Can't upgrade Jenkins and SVN plugin
- Can't connect to svn
I am setting up Jenkins on a Windows 64 bit machine. It's configured to run as a windows service.
We are running this on Windows 7 64 bit OS
Jenkins 1.482
I am able to do an SVN update/checkout from my user account on the machine.
When I attempt to set up a job on jenkins I get the following when trying to add svn credentials
FAILED: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /svn/client/trunk failed
More details are:
FAILED: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /svn/client/trunk failed
org.tmatesoft.svn.core.SVNException: svn: OPTIONS /svn/client/trunk failed
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:298)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:283)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:271)
at ...
I stopped the service and ran Jenkins from command line and tried the same thing - with the same result.
I am able to connect to the svn server with a tortoise client and via firefox with the same credentials.
In researching the issue I saw a few posts about similar problems and the only one that seems to claim to fix it is rolling back to Jenkins svn plugin version.
I then tried to install the latest jenkins and Plugin for svn. The downloads failed. Aha, I thought - obviously a firewall issue. So I disable the firewall.
Still no good. I can't automatically download or get the new Jenkins or SVN plugin.
Try starting jenkins with this option:
-Dsvnkit.http.sslProtocols="SSLv3"
Or, if Jenkins is starting svn plugin in a separate JVM, try adding the line to wherever the svn plugin run configuration is.
It's a known problem with svnkit, which is used by Jenkins' svn plugin:
http://issues.tmatesoft.com/issue/SVNKIT-176
Also, this answer can be helpful with regards to upgrading your svn plugin.
To change your Windows service commandline:
open a command line window cmd.exe
sc qc "JenkinsSlave" (if that's what your service name is)
select and copy the BINARY_PATH_NAME value
change it, adding -Dsvnkit.http.sslProtocols=""SSLv3"" after the jar path - mind the double quote
sc config "JenkinsSlave" binPath= <paste the changed value copied earlier>
Replace JenkinsSlave with your service name.
Windows 7 x64 has some automatic firewall settings. You may need to open a firewall port to allow the connection.
You should be able to verify or eliminate this as a cause by trying to run your svn client outside Jenkins.
bit late topic, but did you try the following solution?
http://www.daangemist.nl/2014/03/03/jenkins-reports-sslv3-error-on-svn-update
that one worked out for me, in my case I wanted to use -Dsvnkit.http.sslProtocols="TLSv1"
What about running Jenkins service with your account?

Resources