I got an error in Hudson console out saying the build fail because Maven release plugin cannot update POM.xml version while there are still unresolved files. The problem is caused by other people updating the POM during the build.
Can any guru teach me how to solve the problem? I am think about a P4 lock, anyone can give me more details of using P4 lock with Maven and hudson?
If people aren't allowed to edit the POM.xml during the build, p4 lock would certainly be a good solution. The only other possibility I see is enabling maven to somehow merge the changes in, but it seems like the risk of conflicts might be high.
Related
I set up a Jenkins job to run some integration tests. After testing finishes, Jenkins should look for test report in settings. However, it gives following error:
Recording test results
ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
java.lang.NoClassDefFoundError: hudson/tasks/junit/JUnitParser$ParseResultCallable
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:90)
at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:120)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:137)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:74)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1779)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Finished: FAILURE
Here is my Publish Junit result setting:
I checked the path for those xml files in workspace, they do exist. I'm not sure what could be wrong. My JUnit Plugin version is 1.5.
You have a version mismatch between the JUnit version in your build and the version that is loaded into Jenkins. https://issues.jenkins-ci.org/browse/JENKINS-24946 may provide some insight, but in general, you need to be very careful that the versions are compatible.
I think there is some configuration issue, somewhere in configuration it's not updating with latest version.
At some point of time you have to work with latest version.
Instead of downgrading just create a new branch of your project.
I created new branch of my project then build went smoothly although still it is failing with older branch. So better you work with latest version of JUNIt by creating new branch, jenkin will pick it automatically.
Also Wiping out Current Workspace may help
I was using Hudson for doing my project builds and now planning to migrate to Jenkins.
The build server time is not in sync with the developer machines, and hence svn update does not work correctly. In Hudson, I was able to set the revision policy to HEAD, whereas its missing in Jenkins.
I searched a bit and saw that a Jira is created for this issue, but did not find a working solution for the problem.
I tried to manually install the Hudson subversion plugin in Jenkins, and the Revision policy option came up, but for some reason it caused an exception while setting the svn authentication info.
If anyone knows a solution to make this change in Jenkins, kindly reply.
Figured out. Append all SVN urls with #HEAD and svn update will happen from HEAD!
The plugin doesn't offer such feature but you might find useful this jira issue. There is a patch in the comments for that purpose. See Issue 1241.
I followed the answer from this posting:
How to use Mercurial, Maven and Eclipse together?
But the "Check out Maven Projects from SCM" still does not allow me to use Mercurial SCM.
The only option I get is "svn" in the dropdown, and even if I ignore the drop down and enter in "scm:hg:http://myMercurialRepoURL"
I'm using:
Eclipse 3.6.1
m2eclipse 0.12 from http://m2eclipse.sonatype.org/sites/m2e
"Maven SCM handler for Subclipse" 0.12.0 from m2eclipse extra's site (sorry, I would give the URL, but my new account doesn't have enough rep)
MercurialEclipse 1.8.1 from http://cbes.javaforge.com/update
And I've uninstalled, and reinstall those plugins in that order.
I'm able to use Maven in projects, and use Mercurial separately in Eclipse - it's just this one Wizard that seems to be broken, which leads me to believe that if I try to Materialize an Artifact from a Mercurial repo that it will also fail.
Has anyone had any luck with this Wizard? Perhaps on earlier versions? Is this a new bug?
Thanks
As far my search went, I didn't get to find a suitable connector for mercurial and m2eclipse (in terms of only using IDE). However, I did an experiment wherein I cloned a copy of the source from outside the IDE. (via TortoiseHg specifically)
Afterwards, assuming you have already m2e installed in Eclipse:
Go to File > import > maven > existing maven projects, then select the folder where you've originally pulled/cloned your source code.
I believe by doing so, you'll see the m2e commands in the project's context menu (via run as), and effective use mercurial commands. (via team context menu)
At least for now, this is better not using m2e and mercurial at the same time.
If anyone has a more streamlined approach, I'm also curious. :D
I was wondering which steps are the best to upgrade hudson and the plugins.
I'm running 1.347 at the moment. I once tried to update which resulted into a mess because some plugins were incompatible.
Also i want to delete some plugins is it appropriate to just delete the hpi file? It would be nice to know how other people do this step and in which order.
Should i first upgrade hudson and then plugin by plugin?
And if a plugin breaks something downgrade it again? It seems to be a lot of work.
Or is there any easy way?
Also is it enough to save all the xml configuration files in case something breaks that i can recover?
Thanks in advance.
My solution is overkill, but I was burned twice (once by a Hudson bug and once by plugin incompatibilities) and learned my lesson.
I have Hudson installed on a VM with the same plugins as my production instance and a couple of simple builds. When I feel it's time to upgrade, or want to check out the latest release, I upgrade Hudson on the VM and verify that it starts up and can do builds. I only upgrade the production system that all of our developers use after I've upgraded my test system. I generally don't do exhaustive tests on my test system; it's enough to make sure the combination of upgraded Hudson and plugins starts up properly.
When upgrading either the VM or the main system, I upgrade all the plugins, then upgrade Hudson itself and restart. (Since I have a test system, I'm not particularly worried about doing things step by step.)
I came up with my process before Hudson introduced downgrade support. I still use this process because it's important to me to have confidence that an upgrade is not going to break the system that other developers use. This setup also allows me to have an experimental setup that's separate from the main Hudson system, which I find useful.
I usually update Hudson first, then the plugins.
The recent versions of Hudson have some support for this process:
the Hudson 1.376 added downgrade support for the core and plugins.
That means after upgrading a plugin, you have a button which allows you to downgrade to the previous installed version if needed.
the Hudson 1.369 Avoid error with invalid or null primary view, such as in upgrade from older Hudson
And the upcoming Hudson 1.387 will avoid littering HUDSON_HOME with atomic *.xml files, which should make the backup process of critical config files that much easier.
(Currently, with an Hudson 1.386, I see under HUDSON_HOME:
com.mtvi.plateng.hudson.ldap.LdapMailAddressResolver.xml
config.xml hudson.scm.SubversionSCM.xml
de.fspengler.hudson.pview.PViewProjectProperty.xml hudson.tasks.Ant.xml
hudson.maven.MavenModuleSet.xml hudson.tasks.Mailer.xml
hudson.model.UpdateCenter.xml hudson.tasks.Maven.xml
hudson.plugins.clearcase.ClearCaseInstallation.xml hudson.tasks.Shell.xml
hudson.plugins.clearcase.ClearCaseSCM.xml hudson.triggers.SCMTrigger.xml
hudson.plugins.git.GitTool.xml nodeMonitors.xml
hudson.plugins.sonar.SonarPublisher.xml proxy.xml
hudson.scm.CVSSCM.xml
)
It is possible to take the source code directly from a svn repository and analyze it with sonar? Or configure sonar just to run a Checkstyle or pmd plugin for certain sources?
I need to do this on non-maven projects.
Sonar can run without maven entirely. Now there's sonar-runner
Yes, you just need to write a maven or ant script to check out the latest from SVN first, then run the sonar:sonar command.
It looks like Sonar forces you to create a pom.xml file and install maven2, even for a non-mavenized project: http://docs.sonarqube.org/display/SONAR/Analyzing+Source+Code
(fyi - Sonar is dead easy with a mavenized project, but in any setup the key will be in getting in the habit of looking at and using the results of Sonar to improve development. That's the hard part.)