-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Windows 7, Jenkins 1.546 and 1.532, Jenkins started as Service
-
Powered by SuggestiMate -
warnings-ng 1.0.0-beta1
The Warnings Plug-in doesn't seem to work correctly if the maven plugin is deactivated. In our case it prevented the creation of the build.xml at the end of a build. As long as Jenkins is running, all builds and their history are shown correctly, but after a restart, Jenkins can't get the necessary informations to build up the history due to missing build.xml. This results in a faulty build history (no past builds are shown).
To reproduce, follow these steps:
1. Deactivate the maven plugin
2. Make sure you have the Warnings and msbuild plugin installed
3. Create a job which contains a msbuild step (we used msbuild 4.0)
4. Create a post buildstep "Scan for compiler warnings" and use "Scan console log" with "msbulid parser"
In our case, with above setup, no build.xml was created if:
- maven was deactivated AND warnings was turned on
In other combinations (maven on/off, warnings on/off) a build.xml was created hence the problem lies within the Warnings plugin and not maven.
In Attachment you find a minimal example (no_buildXml_minExample.jpg) where you can reproduce the bug by turning maven on/off. In the example you can see that Build #2 is missing - this was done with deactivated maven.
no_buildXml_plugins.jpg shows our installed Jenkins plugins in case there are other unknown side effects.
- depends on
-
JENKINS-44957 Remove maven project dependency
-
- Resolved
-
- is duplicated by
-
JENKINS-30514 DRY and TaskScanner plugin: build.xml file is not generated when the plugin is included in a job
-
- Resolved
-
-
JENKINS-31603 "Error communicating to server! Server Error" in Delivery Pipeline IF Maven Integration disabled AND Static Analysis Utilities enabled
-
- Resolved
-
- is related to
-
JENKINS-15156 Builds disappear from build history after completion
-
- Resolved
-
[JENKINS-21268] No build.xml is created when warnings plugin is used in combination with deactivated maven plugin
@Ulli: Yes, there is in fact an exception. I attached the significant part of the error log.
Note: in the attachment the build failed but since Warnings Plugin was configured to always parse it was triggered (and no build.xml was created). If Warnings Plugin is configured not to parse on error the build.xml is correctly created (Warnings Plugin isn't triggered).
Seems that Jenkins classloader has changed and loads unrelated classes now.
Which versions are you using?
I just tried with Jenkins 1.546 and a snapshot of the warnings plug-in and that works:
Gestartet durch Benutzer anonymous Baue auf Master in workspace /Users/hafner/Development/jenkins/jobs/JENKINS-21268/workspace [WARNINGS] Parsing warnings in console log with parser MSBuild Finished: SUCCESS
@Ulli: I updated "Details/Environment" with the jenkins versions i used.
I get the same console log as you in both case (correct and faulty behaviour). In the faulty case the exception is logged in jenkins_err.log. The bug becomes only noticable to the user after Jenkins is restarted. Alternatively you can just look in the "LastSuccessfulBuild" folder for build.xml. It should be missing.
I see, the error is not reported in the console log, it i in Jenkins log. I now can reproduce the problem. I wonder why this worked before, the reference to MavenBuild is there since a couple of years. These references in AbstractResultAction are marked as deprecated for a long time now so I think it is save to remove them.
Code changed in jenkins
User: Ulli Hafner
Path:
plugin/pom.xml
plugin/src/main/java/hudson/plugins/findbugs/FindBugsPlugin.java
plugin/src/main/java/hudson/plugins/findbugs/MavenInitialization.java
http://jenkins-ci.org/commit/findbugs-plugin/04d18b8d0a6977322126739669024d40b6bd1edb
Log:
JENKINS-21268 Don't reference maven classes if plugin is deactivated.
Compare: https://github.com/jenkinsci/findbugs-plugin/compare/ccb10e46717a...04d18b8d0a69
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
src/main/java/hudson/plugins/dry/DryPlugin.java
src/main/java/hudson/plugins/dry/MavenInitialization.java
http://jenkins-ci.org/commit/dry-plugin/d53abb13ef92407a5dff51ce69dfa8a1829b4702
Log:
JENKINS-21268 Don't reference maven classes if plugin is deactivated.
Compare: https://github.com/jenkinsci/dry-plugin/compare/5c55ea42a388...d53abb13ef92
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
src/main/java/hudson/plugins/tasks/MavenInitialization.java
src/main/java/hudson/plugins/tasks/TasksPlugin.java
http://jenkins-ci.org/commit/tasks-plugin/c650bee35f2041135f373e3714c3b76992b81bca
Log:
JENKINS-21268 Don't reference maven classes if plugin is deactivated.
Compare: https://github.com/jenkinsci/tasks-plugin/compare/cf6244ec256c...c650bee35f20
I observed this issue in Jenkins 1.557 with Warnings 4.40. Builds were disappearing from project/job history list and build.xml was not created on disk. For me the workaround was to enable Maven plug-in.
I can confirm this issue has also bitten KDE and our Jenkins instance at build.kde.org.
The above commits do not correct this issue under Jenkins 1.578 with Warnings 4.41, Maven 2.6.
I disabled the Maven plugin to deal with other issues that plugin was causing, didn't expect it to cost us 2 weeks worth of build data.
As this bug causes data loss, I find a severity of "minor" unusual - please reassign it a more appropriate severity such as "critical".
There is a simple workaround: do not deactivate maven plug-in. There is currently no easy way to fix that.
drulli I can confirm the workaround, but as bcooksley said, this bug causes data loss, especially for new users, as it's really not obvious that disabling the Maven plugin will make your build history disappear the next time your server restarts (and it's quite hard to diagnose).
In order to avoid the problem, wouldn't it be appropriate to set a mandatory dependency between the warning plugin and the maven plugin ?
Actually, no data is lost, just not visible. Enabling the maven plug-in will restore everything.
But I can set the dependency to mandatory, that is quite easy.
In my case, the build.xml file was not created after re-enabling the Maven plugin and restarting Jenkins, and the affected job executions are still missing in the history.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/analysis-pom-plugin/76746c03b70fe1678da1edbfbf114fe61586894c
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/analysis-core-plugin/e51e37323f35d8a60158f781a5ec12f7a9dbf3ec
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
analysis-pom
checkstyle
dry
findbugs
warnings
http://jenkins-ci.org/commit/analysis-suite-plugin/de4d959e9912024b13c58d2e6bb4e54308c39471
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
analysis-collector
analysis-core
analysis-test
checkstyle
dry
findbugs
pmd
tasks
warnings
http://jenkins-ci.org/commit/analysis-suite-plugin/5c831929cf7e57a8546fcebd000a6945f0c79bfc
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/analysis-collector-plugin/4a69b1a27b47bedc7e2dfcd69c9be9d33cdf93b4
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/analysis-collector-plugin/0ba7f0f0e3661193d39ee5bf33119ffd6aefef12
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/dry-plugin/f6a6fbe8ea5cf0325b15117b2e7cd5387c3e655f
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/dry-plugin/936b5ad88f71d2853b3a38eede805fc283177823
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
plugin/pom.xml
http://jenkins-ci.org/commit/findbugs-plugin/c9ffe299c895857496060791fb606de80a90553f
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/pmd-plugin/e1529c573ebf1ca7461760a8754eaf00316c6f06
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
plugin/pom.xml
http://jenkins-ci.org/commit/findbugs-plugin/cf1aeabc68913d1d4dbeb9d050d7d85fb6d8781e
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/pmd-plugin/73e894936e07495ad95da89e91d2dd54b89efd16
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/analysis-test-plugin/7538b65b07021653314de09c9f0744ae96dc0ba6
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
tasks.iml
http://jenkins-ci.org/commit/tasks-plugin/f2e6822706b2c98675977b21362aeff858a840b3
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/analysis-test-plugin/149ea62632ae9af52a3d467ac43ea29807c906b1
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
tasks.iml
http://jenkins-ci.org/commit/tasks-plugin/9f10bf8c91e24db028a8c3d750f39eaa03d96e56
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/warnings-plugin/0cf405ecbd22b85773efa6f8cc03c3ae6f14968d
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/warnings-plugin/4b1cc29344b7199b56db1072948821270a648971
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/checkstyle-plugin/54384636ac114dcab6fe52fe7916b952f536199e
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Code changed in jenkins
User: Ulli Hafner
Path:
pom.xml
http://jenkins-ci.org/commit/checkstyle-plugin/2e997a90c1c07020e5f442baa1d386698802a713
Log:
JENKINS-21268 JENKINS-14727 Make maven-plugin a mandatory dependency.
Workaround for JENKINS-21268. The maven plug-in can't be optional without breaking the API. This issue needs to be adressed in 2.x release.
Is there an exception or message in the console log?