开发者

How to use properties from a property file within a Maven script?

开发者 https://www.devze.com 2023-04-09 19:54 出处:网络
I want to use properties that are defined in a property file in a Maven script, in a plugin configura开发者_Python百科tion section. How can I do that?

I want to use properties that are defined in a property file in a Maven script, in a plugin configura开发者_Python百科tion section. How can I do that?

Extract from my Maven script:

...
<configuration>
    <url>${jdbc.url}</url>
</configuration>
...

And my property file (jdbc.properties) is somewhere in my classpath

jcbc.url=some.url.to.use

Thanks.


Use the properties plugin. And it's called a POM, not a script. It may seem like a trivial difference, but a POM describes a project and how it should be built, where a script is a sequence of commands saying what needs to be done.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号