Hi Jason,

yes, I remember stumbling over this as well.

Partially I have actually uses a workaround for that compilation failure: 
However, I am not sure it is worth it – because it is based on using 
reflection, e.g.:

def instance = Jenkins.getInstance()
…
    // LDAPSecurityRealm class depends on "LDAP" plugin => use reflection for 
creation:
    def ldapSecurityRealmClass = 
this.class.classLoader.loadClass('hudson.security.LDAPSecurityRealm')
    SecurityRealm ldapRealm = ldapSecurityRealmClass.newInstance(server, 
rootDN, userSearchBase, userSearch, groupSearchBase, managerDN, 
managerPassword, inhibitInferRootDN)
    instance.setSecurityRealm(ldapRealm)
    instance.save()


And later on, IIRC, I mostly “only” relied on the init scripts (one for each 
responsibility “area”) checking whether or not a restart due to plugin 
installation/updates is still pending based on a kind of marker file (and 
ignoring compilation failures):

def restartFile = new File(instance.getRootDir(), "JenkinsRestartByInitScript")
if (restartFile.exists()) {
  println "--> Jenkins restart is pending: skipping this hook script"
  return
}
// Here follows the logic like setting up the LDAP security realm…


HTH -- although this is not a real solution,
                Reinhold

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/AM4P190MB00677F1A1C76C862343A189EF70F0%40AM4P190MB0067.EURP190.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.

Reply via email to