I am getting following error in building the maven project. Any idea in solving this?
[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create (default) on project pwc-em: Cannot get the branch information from the scm repository :
[ERROR] Exception while executing SCM command. Error while executing command. Error while executing process. Cannot run program "git" (in directory "C:\Users\vmasama\Documents\workspace-sts-3.7.2.RELEASE\pwc-em"): CreateProcess error=2, The system cannot find the file specified
[ERROR] ->
I solved the same issue by updating my git version. But downgrading the version of the maven plugin to 1.13 will also solve this issue.
buildnumber-maven-plugin v1.4 works with git v2.9.2 but not with v1.9.*
buildnumber-maven-plugin v1.3 works with git v1.9.*
Related
Showing an error of the sorts
Plugin org.codehaus.mojo:exec-maven-plugin:1.2.1 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.codehaus.mojo:exec-maven-plugin:jar:1.2.1:
Could not transfer artifact org.codehaus.mojo:exec-maven-plugin:pom:1.2.1 from/to central (http://repo.maven.apache.org/maven2):
Failed to transfer file:
http://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.2.1/exec-maven-plugin-1.2.1.pom. Return code is: 501 , ReasonPhrase:Not Implemented. -> [Help 1]
This might be an issue with resolving the dependency. Can you try below and get back.
Open the .m2/repository and proceed to the path org/codehaus/mojo/exec-maven-plugin/. Then delete the subdirectory 1.2.1 and the entire content. Then the maven will automatically download the dependency in the next update. Try to build the project and see.
Additionally you can try to issue below command in command prompt at the project directory.(This command will update the dependencies forcefully)
mvn clean install -U
I have a maven project and try to do a maven install.While performing the maven install, Im getting the below error.
[INFO] Compiling 403 source files to D:\\iTT_Backend\itt\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/iTT_Backend/itt/src/main/java/com/iowe/bean/Project.java:[5,27]
package com.cx.util does not exist
[ERROR]
/D:/iTT_Backend/itt/src/main/java/com/itt/controller/ScanController.java:
[21,39] package com.cx.business.to.scan does not exist
Above is the error Im getting while trying to do a clean install.The specified package in the above error message package com.cx.util is available as part of the itt.jar. That jar has been added as a dependency to this project. I dont see any errors in eclipse. Only while trying to do install, Im getting the above compilation error.
Analysis Done
Below are the analysis done
Checked for the dependency and the jar is available as part of dependency in pom.xml file.
The application does not show any dependency error in eclipse. Its able to navigate to the corresponding method in the jar file.The issue occurs while executing mvn install command.
Tried executing mvn install via command prompt. Still getting the same error as above.
Have renamed the .m2 repository folder to old repository and re executed the mvn install command. same issue exists.
Need help in getting the above issue resolved.
Any help on this is much appreciated. Thanks in Advance.
Remove from .m2 local repository and execute command mvn clean install
Try to remove and add again dependency in Pom.xml
I am trying to setup Jenkins to automate project builds and I ran to the following problem. mvn clean install works perfectly from cmd but project build from jenkins fails when maven-antrun-plugin is being used.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run
(clientgen) on project Sample:
An Ant BuildException has occured: Compile failed; see the compiler error output for
details.
[ERROR] around Ant part ...<javac fork="yes" memoryInitialSize="512m"
destdir="E:\Jenkins\workspace\Trunk Builds\Sample\target/generated-sources"
memoryMaximumSize="1024m" srcdir="E:\Jenkins\workspace\Trunk Builds\Sample\target/build"
source="1.4" classpathref="maven.plugin.classpath" executable="C:\j2sdk1.4.2_19/bin/javac"
target="1.4"/>... # 46:428 in
E:\Jenkins\workspace\Trunk Builds\Sample\target\antrun\build-main.xml
Jenkins is actually unable to check for the packages imported when I use maven-antrun-plugin.
[javac] E:/Jenkins/workspace/Trunk Builds/Sample/target/build/ClassSample.java:20:
package org.sample.package does not exist
Whenever I do not use maven-antrun-plugin Jenkin build succeeds. Any ideas why even though it works through cmd jenkins fail to build the project?
Actually I found the real problem and found a workaround. The problem is that Jenkins did not access .m2/repository for some reason so I configured Jenkins to use local to workspace repository. Now it builds normally.
I build an Apache Project in java which runs fine on my laptop, now that I try to run the same project in Netbeans on my work PC I get an error:
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project aping: Command execution failed.
With a reference to:
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The Maven plugin in Netbeans was installed by default. When I tried to find out if the Apache version in the POM file was correct I tried to check the version on my PC with mvn -version I got the error:
'mvn' is not recognized as an internal or external command,
operable program or batch file.
Does this mean that Maven is not installed on my PC and should I also install Maven on my PC first in order to use the plugin, or should just installing the plugin be enough and do I have a different problem?
The error message you see is
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project aping: Command execution failed.
This is a message from the Maven executable embedded inside Netbeans (so Maven is running), saying that a specific maven plugin (here exec-maven-plugin) failed. This is most likely trying to invoke another program on your computer that is not installed so Netbeans (and hence the embedded Maven) can see it.
If you want to run maven outside Netbeans, you must download and install a copy and invoke the "mvn" binary inside.
You Have to install Maven To run Maven on your PC - http://www.avajava.com/tutorials/lessons/what-is-maven-and-how-do-i-install-it.html see how to install maven
in linux - http://www.mkyong.com/maven/how-to-install-maven-in-ubuntu/
I mistakenly assumed that the problem had something to do with Maven, the problem seems to be something in my source code unrelated to Maven. When I change some of the code the program is build succesfully
I am trying to build my Maven project on Travis. The build process seems to work excepting the built of the RPM package.
I am using the plugin rpm-maven-plugin. The reason seems to be that the RPM binary is not available.
Is there a way to build my RPM package with Travis ?
Here is the location of my project:
https://travis-ci.org/qwazr/QWAZR
Thanks for help.
[ERROR] Failed to execute goal
org.codehaus.mojo:rpm-maven-plugin:2.1.3:rpm (generate-rpm) on project
qwazr: Unable to query for default vendor from RPM: Error while
executing process. Cannot run program "rpm": error=2, No such file or
directory -> [Help 1]
I finally found a full java implementation.
https://github.com/craigwblake/redline
I will test it and edit this response to confirm it works.