【发布时间】:2012-10-19 10:10:06
【问题描述】:
使用 maven,我想在 spring 中获取我的项目版本,但不进行过滤。我是这样试的
@PropertySource("classpath:META-INF/maven/groupId/artifactId/pom.properties")
这里建议:Access maven project version in Spring config files
正如那里所写,使用 test 或 jetty:run 是不可能的。 maven 仅在打包的存档中生成 META-INF。有没有办法让 maven 在之前生成 META-INF,这样你就可以启动 jetty:run,让 spring 从 manifest 中读取项目版本而不会出错?
【问题讨论】: