Guillaume
Guillaume

Reputation: 22822

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

I want to use properties that are defined in a property file in a Maven script, in a plugin configuration 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.

Upvotes: 0

Views: 296

Answers (1)

Ryan Stewart
Ryan Stewart

Reputation: 128949

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.

Upvotes: 2

Related Questions