Spring注解:@Profile
1、用java解决在Window系统和Linux系统下Word转Pdf问题。
2、首先是pom.xml:


4、然后利用@Configuration注解,配置创建一Spring配置类:ProfileConfig


6、在web项目中,通过使用spring.profiles.active和spring.profiels.default来指定激活哪个profile,spring.profiles.active的优先级高,如果没有设置这两个属性,则不创建@profile对应的bean方式: 作为DispatcherServlet的初始化参数; 在集成测试类上,使用@ActiveProfiles注解设置; 作为Web应用的上下文参数; 作为JNDI条目; 作为环境变量; 作为JVM的系统属性;其实我也就明白前三种。