[ 
https://issues.jenkins-ci.org/browse/JENKINS-13662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=162333#comment-162333
 ] 

Eugene Gligalov commented on JENKINS-13662:
-------------------------------------------

Hi,

Basically I need that to change Maven version in Pre Steps, the thing is, it 
can't be redefined because the variable responsible for Maven is read only that 
why I need to recreate collection of Pre Steps from scratch, if you could 
provide any other alternative how I could change Maven in Pre Steps that would 
be nice as well.

Thanks
Eugene
                
> Maven job Pre Step properties are not getting right
> ---------------------------------------------------
>
>                 Key: JENKINS-13662
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-13662
>             Project: Jenkins
>          Issue Type: Bug
>          Components: core, script-realm
>    Affects Versions: current
>            Reporter: Eugene Gligalov
>            Assignee: Kohsuke Kawaguchi
>         Attachments: properties.png
>
>
> Hi,
>   I have defined Pre Steps for Maven job as on picture, and made the script 
> which can read all information from Pre Steps, everything is OK except method 
> which had to return Pre Step properties, there are 2 problems: it returns not 
> string as described in 
> javadoc(http://javadoc.jenkins-ci.org/hudson/tasks/Maven.html#properties) it 
> returns Map, and even worse it doesn't return Pre Step properties at all, it 
> returns Map of other objects, with following script you can reproduce it:
> {code}
> import hudson.maven.MavenModuleSet
> import hudson.model.Hudson
> for (item in Hudson.instance.items) {
>     if (item instanceof MavenModuleSet) {
>         if (item.name == "some_job_name") {
>             for (prebuilder in item.prebuilders) {
>                   println("Targets $prebuilder.targets")
>                   println("Pom $prebuilder.pom")
>                   println("jvm $prebuilder.jvmOptions")
>                   println("Private repo $prebuilder.usePrivateRepository")
>                   println("properties " + prebuilder.properties)
>             }
>         }
>     }
> }
> {code}
> and output which I'm getting:
> {code}
> Targets install
> Pom pom.xml
> jvm null
> Private repo false
> properties [class:class hudson.tasks.Maven, 
> maven:hudson.tasks.Maven$MavenInstallation@5b2bb4c5, 
> usePrivateRepository:false, 
> descriptor:hudson.tasks.Maven$DescriptorImpl@33c5dd1b, targets:install, 
> requiredMonitorService:NONE]
> {code}
> Thanks
> Eugene

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to