protobuf-maven-plugin, jenkins build fail - maven

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.

Related

How to build orekit from maven?

I am having issues building orekit. I am following this guide below:
https://www.orekit.org/site-orekit-latest/building.html
I have installed jdk and installed java (version 14.0.2) to the path as well as incorporated the necessary users paths (JAVA_HOME, M2_HOME, and MAVEN_HOME). I also installed the latest version of maven version 3.6.3). I tried running "mvn package" and it came up with a build failure:
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users####). Please verify you invoked Maven from the correct directory. -> [Help 1]
I am not very technically proficient using the command prompt. I assume I need something relating to orekit in the same directory. I have a folder labeled orekit which I got from github in the same directory but I still get the error.
Help please.

How to solve Exception: basedir doesnot exist

I am trying to dockerize a springboot project using maven.
So i ran a command
mvn package -Pdocker '-Dmaven.test.skip=true' docker:build
Below is the image of how the file structure of the project is
image and below is the error
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default-cli) on project poplar: Exception caught: basedir C:...\server\target does not exist -> [Help 1]
I am trying to find out how i can solve the problem because from the project structure there is no target folder for the root project poplar though the subprojects have target folders in them.
An easy fix is to create the target directory in the base project directory. For more details about the issue see here. The error is reproduced here
I would suggest you change the project structure and add a maven sub-module responsible for building the docker container.

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.

maven error while running sonar from jenkins job

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

Resources