This question has been asked before at Mule 4: Is there a way to refer Maven POM properties from a Mule Flow? and probably others.
I'll repeat my answer here because Stackoverflow doesn't allow me to mark this one as a duplicate.
That's because Maven properties do not exists anymore when the application is executed.
You can use some Maven plugins to replace values in a properties files, that can be used inside the application. For example the Maven Resources plugin . Be careful of not override properties inside other files, like the XML Mule configurations of the application.
Update: I have created an example:
Assume that you have a properties file called config.properties in which you want to put the value of Maven property name
:
a=1
b=${some.property}
Then you can enable Maven property filtering in just that file with:
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>config.properties</include>
</includes>
</resource>
</resources>
...
My blog has a longer explanation of this example: https://medium.com/@adobni/using-maven-properties-as-mule-properties-3f1d0db62c43
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.