package org.jasig.cas.authentication.handler;

import javax.validation.constraints.NotNull;

/**
 * Pass the encode/decode responsibility to a delegated Spring Security
 * password encoder.
 *
 * @author Joe McCall
 * @since 4.3
 */
public class SpringSecurityDelegatingPasswordEncoder implements PasswordEncoder {

    @NotNull
    private org.springframework.security.crypto.password.PasswordEncoder delegate;

    public void setDelegate(final org.springframework.security.crypto.password.PasswordEncoder delegate) {
        this.delegate = delegate;
    }

    @Override
    public String encode(final String password) {
        return delegate.encode(password);
    }

    @Override
    public boolean matches(final CharSequence rawPassword, final String encodedPassword) {
        return delegate.matches(rawPassword, encodedPassword);
    }
}

package org.jasig.cas.authentication.handler;

import org.springframework.stereotype.Component;

import javax.validation.constraints.NotNull;

/**
 * Pass the encode/decode responsibility to a delegated Spring Security
 * password encoder.
 *
 * @author Joe McCall
 * @since 4.3
 */
@Component("springSecurityDelegatingPasswordEncoder")
public class SpringSecurityDelegatingPasswordEncoder implements PasswordEncoder {

    @NotNull
    private org.springframework.security.crypto.password.PasswordEncoder delegate;

    public void setDelegate(final org.springframework.security.crypto.password.PasswordEncoder delegate) {
        this.delegate = delegate;
    }

    @Override
    public String encode(final String password) {
        return delegate.encode(password);
    }

    @Override
    public boolean matches(final CharSequence rawPassword, final String encodedPassword) {
        return delegate.matches(rawPassword, encodedPassword);
    }


}

--- 
+++ 
@@ -1,6 +1,4 @@
 package org.jasig.cas.authentication.handler;
-
-import org.springframework.stereotype.Component;
 
 import javax.validation.constraints.NotNull;
 
@@ -11,7 +9,6 @@
  * @author Joe McCall
  * @since 4.3
  */
-@Component("springSecurityDelegatingPasswordEncoder")
 public class SpringSecurityDelegatingPasswordEncoder implements PasswordEncoder {
 
     @NotNull
@@ -30,6 +27,4 @@
     public boolean matches(final CharSequence rawPassword, final String encodedPassword) {
         return delegate.matches(rawPassword, encodedPassword);
     }
-
-
 }
Remove @Component for optional encoder

Instantiation is optional as to avoid introducing a hard dependency on spring-security.