maven error while running sonar from jenkins job - maven

I am trying to implement Sonar in Jenkins CI using maven build tool.I am using Linux machine to build maven with Sonar.
maven is successfully installed. I have tried to configure maven path in Jenkins Configuration,
maven is installed .
whenever I run the job getting below error.
java.io.IOException: Cannot run program "mvn" (in directory
\"/directorypath"): java.io.IOException: error=2, No such file or directory""
as I understood from error that its unable to find out maven in Job directory. what configuration should needed so job can take by default maven path where is installed.
I have searched lot on internet, but could not helped.

Try without mvn in the commands
Eg clean install package

Related

Jenkins build error FATAL: Couldn’t find any executable in C:\apache-maven-3.5.0\bin

I started using Jenkins 2.73.1 on Windows 7.
I also have Apache Maven 3.5.0 installed at C:\apache-maven-3.5.0\bin.
In Manage Jenkins -> Global Tool Configuration, I defined the maven installation.
I defined MAVEN_HOME as C:\apache-maven-3.5.0\bin, but it gives me a warning message
"C:\apache-maven-3.5.0\bin doesn’t look like a Maven directory".
I leave the setting as is because that is the correct maven install directory.
Should the path be something else?
I proceed with the project build and I get this error.
FATAL: Couldn’t find any executable in C:\apache-maven-3.5.0\bin
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
What doesn't make sense is that I believe I have the correctly configured the Maven install so I don't know why I get the warning message and the error.
After searching online some seems to indicate that it is looking for mvn.cmd or mvn.bat so I made a copy to have both files in the directory but doesn't work for me.
I found my answer.
I defined MAVEN_HOME as C:\apache-maven-3.5.0\bin, but it should be MAVEN_HOME as C:\apache-maven-3.5.0.
This worked for me.
ikask

Is there an Docker Maven Plugin in jar file?

Just a quick inquiry to see if there are any .jar files for docker - maven plugin that can be directly installed in Apache Maven using the mvn install command.
I was trying to run a docker-maven plugin using a pom file on windows but was getting the following error:
[ERROR] Failed to parse plugin descriptor for
org.codehaus.plexus:plexus-compone nt-metadata:1.6
(C:\Users\user2.m2\repository\org\codehaus\plexus\plexus-com
ponent-metadata\1.6\plexus-component-metadata-1.6.jar): error in
opening zip file -> [Help 1]
I have installed plexus-component-metadata-1.6.jar and plexus-component-metadata-1.6.pom but it is not working..
Any help please..??
This error can occur when your connection gets interrupted during your dependencies are being downloaded last time.
Delete the relevant repository folder and run mvn clean install command again to download a fresh copy of corrupted file.

Build Jenkins Sonar-ruby-plugin

I am trying to build sonar-ruby-plugin for jenkins i.e, to create a .hpi file every time I run the command:
mvn package
it creates a target folder but there is no .hpi file.
https://github.com/GoDaddy-Hosting/ruby-sonar-plugin
This is a plugin for SonarQube server, not Jenkins.
You should:
build the plugin by mvn package
copy to SONARQUBE_HOME/extensions/plugins directory
restart SonarQube
run analysis (you can execute SonarQube in Jenkins; read more on SonarQube wiki)

protobuf-maven-plugin, jenkins build fail

I am new for Jenkins building jobs.
Currently, i am trying to build a project which has protobuf-maven-plugin init for compile .proto file to generate required java file from it.
In local machine, able to do maven install build from STS by specifying protoc.exe path in Path environment variables. Where as in Jenkins it is failing to locate protoc, by stating below error
[ERROR] Failed to execute goal com.github.igor-petruk.protobuf:protobuf-maven-plugin:0.6.5:run (default) on project betstream-proto:
Cannot execute 'protoc': Cannot run program "protoc": error=2, No such file or directory -> [Help 1]
Where as Jenkins is already deployed in Dev environment of my company.
Please any one help me to resolve this issue. Thanks in advance.

cloudbees jenkins maven installation missing

I am getting following error when building a project in jenkins:
ERROR: A Maven installation needs to be available for this project to be built.Either your server has no Maven installations defined, or the requested Maven version does not exist.
[cloudbees-deployer] Skipping deployment as build result is FAILURE
Finished: FAILURE
In Jenkins settings, I tried both options: automatic installation from apache as well as use pre-installed maven on dev#cloud.
What might be missing?

Resources