【发布时间】:2020-10-20 19:27:48
【问题描述】:
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.ImportResource;
@SpringBootApplication
@EnableAutoConfiguration(exclude={file1.class, file2.class})
@ImportResource(locations = {"classpath*:applicationContext.xml"})
public class Trans{
public static void main(String[] args) {
SpringApplication.run(Trans.class, args);
}
}
当 jar 中存在 XML 时,它可以正常工作并读取 XML。我希望将 XML 从 jar 中删除到机器上的现有文件夹中。 执行此操作时,不会读取 XML。如何从机器文件系统而不是 jar 中读取 XML?
提前致谢!
【问题讨论】:
标签: java spring spring-boot