Reputation: 9222
Using maven, I would like to get the my project version within spring but without filtering. I tried it like this
@PropertySource("classpath:META-INF/maven/groupId/artifactId/pom.properties")
as proposed here: Access maven project version in Spring config files
As written there it is not possible with test or jetty:run. maven is generating the META-INF only in the packaged archive. Is there a way to instruct maven to generate META-INF before so you can start jetty:run, let spring read the project version from manifest without getting an error?
Upvotes: 1
Views: 298
Reputation: 4483
You can maintain the version number in a project.properties
file also and then access the version number from the project.properties file in the java code. Hope this helps you.
Upvotes: 0
Reputation: 16060
If it's just for test purposes, you could just create a pom.properties
sample file in the src/webapp/META-INF/..../
directory in your source tree?
Cheers,
Upvotes: 1