I have a Java application that uses Spring Security via Java configuration.
What is the easiest method of switching the whole Spring Security on/off in compilation?
So something like this, but for a configuration that uses no XML.
EDIT:
After applying @Profile my code looks like:
@Configuration
@Profile("SecurityOn")
@EnableWebMvcSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
The problem is that if the profile "SecurityOn" is not activated, Spring Security uses some default configuration. Instead, how to turn Spring Security completely off in that case?