Junior — Middle
How is profile configuration performed in the system?
sobes.tech AI
Answer from AI
In Java, profile configuration is usually associated with frameworks such as the Spring Framework, where profiles allow configuring the application for different environments (development, testing, production).
Profiles are set through annotations or configuration files and enable enabling or disabling specific beans and settings.
Example of using profiles in Spring:
@Configuration
@Profile("dev")
public class DevConfig {
// Beans and settings for development
}
@Configuration
@Profile("prod")
public class ProdConfig {
// Beans and settings for production
}
You can activate a profile via a JVM parameter:
-Dspring.profiles.active=dev
Or in application.properties:
spring.profiles.active=prod
Thus, profile configuration allows flexible management of application settings depending on the runtime environment.