user1449507
user1449507

Reputation: 21

Maven Property file plugin replaces whole content of property file while writing

I am using Maven Property file plugin ( goal write-project-properties ) to write project properties into a Property file of my Java project. However my property file contains some more properties apart from the one that I want to update.

For eg. contents of my prop file are

a=123
b=345
c=567

I want to update just b and c values using property file plugin. My POM.xml contains

<properties>
   <b>789</b>
   <c>890</c> 
</properties>

However while running mvn properties:write-project-properties it updates b & c values and removes "a". Is there a way i can retain a and just update b & c values?

Thanks

Upvotes: 0

Views: 176

Answers (1)

gizmo
gizmo

Reputation: 11909

This is not the proper plugin to use if you want to replace some values in a file.

You better use the resources plugin by placing placeholders in your property file that will be replaced by the corresponding defined properties in your pom file.

Upvotes: 1

Related Questions