You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having issues configuring a maven tool with configuration as code. The issue seems to be that Configuration-as-Code is confused as to what configurator to use.
We've got this from the configuration:
So i started out with just trying to get it to work (Maven installations only require a name)
jenkins_1 | Caused by: java.lang.IllegalArgumentException: Invalid configuration elements for type class jenkins.mvn.GlobalMavenConfig : installations
jenkins_1 | at org.jenkinsci.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:200)
jenkins_1 | at org.jenkinsci.plugins.casc.DescriptorConfigurator.configure(DescriptorConfigurator.java:45)
jenkins_1 | at org.jenkinsci.plugins.casc.DescriptorConfigurator.configure(DescriptorConfigurator.java:12)
jenkins_1 | at org.jenkinsci.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:188)
jenkins_1 | at org.jenkinsci.plugins.casc.GlobalConfigurationCategoryConfigurator.configure(GlobalConfigurationCategoryConfigurator.java:45)
jenkins_1 | at org.jenkinsci.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:208)
jenkins_1 | ... 28 more
jenkins_1 |
Unfortunately GlobalConfiguration use the "tools" category (ToolConfigurationCategory) and as a result is listed here, while Maven task's ToolDescriptor (same "tools" category) declare @Symbol("maven").
Not sure what can be done here to disambiguate. A possible workaround would be for GlobalConfiguration to expose get/setInstallations methods to delegate to Maven. DescriptorImpl
I'm having issues configuring a maven tool with configuration as code. The issue seems to be that Configuration-as-Code is confused as to what configurator to use.
We've got this from the configuration:
![tools](https://user-images.githubusercontent.com/1484793/38492350-e12807b2-3bee-11e8-9531-2cd3d9cffab0.png)
So i started out with just trying to get it to work (Maven installations only require a name)
Which gives me:
So it seems that Confguration as code tries to configure: https://github.com/jenkinsci/jenkins/blob/08def67a18eee51de9f3f99bc2a792fee1c160e0/core/src/main/java/jenkins/mvn/GlobalMavenConfig.java
While...i think it's supposed to configure: https://github.com/jenkinsci/jenkins/blob/d688c154907d17e75ea31067c8fc2525aa679584/core/src/main/java/hudson/tasks/Maven.java#L666
@ndeloof @oleg-nenashev Are my assumption correct, in that we're configuring the wrong thing via casc?
The text was updated successfully, but these errors were encountered: