Java 如何在Spring Boot中引用XML文件中的占位符属性

Java 如何在Spring Boot中引用XML文件中的占位符属性,java,spring,spring-boot,Java,Spring,Spring Boot,我试图引用Spring引导加载的xml文件中的占位符,该文件定义了一些属性。但是到目前为止我没有运气。我在xml文件中尝试了以下操作 <context:property-placeholder location="classpath:application.properties" /> <rabbit:queue name="${dummy}" durable="true" /> 即使没有这个问题,这也应该行得通。你是如何启动这个应用程序的?mvn clean spr

我试图引用Spring引导加载的xml文件中的占位符,该文件定义了一些属性。但是到目前为止我没有运气。我在xml文件中尝试了以下操作

<context:property-placeholder location="classpath:application.properties" />

<rabbit:queue name="${dummy}" durable="true" />

即使没有这个问题,这也应该行得通。你是如何启动这个应用程序的?mvn clean spring boot:runI的意思是,你是如何构建上下文的?显示您的主要方法和配置类。编辑我的帖子并从我的启动类中添加代码,假设application.properties实际位于类路径上,这一切都很好。如果它不起作用,我唯一能想到的就是名称空间不支持占位符。它在普通家庭中有效吗?
@Configuration
@EnableAutoConfiguration
@ComponentScan
@ImportResource({ "cxf-servlet.xml", "rabbit.xml" })
public class StartUp {

    public static void main(String[] args) throws Exception {

        SpringApplication.run(StartUp.class, args);
    }
}