How to build a RPM package using Maven on Travis? - java

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.

Related

WSImport fail during maven build

I was trying build some java project, which should be work on java1.6 and maven 3.2.3. After downloading every dependencies i got error:
[ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (importWSDL) on project CRIN_V2: Cannot execute: C:\Program Files\Java\jdk1.6.0_43\bin\wsimport.exe -> [Help 1]
Is there any reason why this plugin does not work with java1.6 and maven3.2.3? some ideas?

Can't install hadoop2.8.0 correctly

I used Maven to install Hadoop 2.8.0,but it always says build failure.
Here's the error message:
[ERROR]Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:copy-resources (copy-resources) on project hadoop-build-tools: Cannot create resource output directory : ~/hadoop-build-tools/target/extra-resources -> [Help 1]
I checked help1 and it says MojoExecutionException is not generated by the Maven core itself but a plugin. It seems that the pom.xml needs to be corrected,but could you please help me how to revise it? Or any ideas how to resolve this?

Jenkins build cannot find resources but maven does

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.

Do I need to install Apache Maven on my PC first, or is it enough to install the plugin in Netbeans to run a Maven project?

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

Cannot get the branch information from the scm repository

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.*

Categories