Per profile you should set property like this
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
...
<dependencies>
...
</dependencies>
<profiles>
<profile>
<id>enableSchemaGeneration</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<schema.generation>
<![CDATA[
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="javax.persistence.schema-generation.scripts.action" value="drop-and-create"/>
<property name="javax.persistence.schema-generation.scripts.create-target" value="sampleCreate.ddl"/>
<property name="javax.persistence.schema-generation.scripts.drop-target" value="sampleDrop.ddl"/>
]]>
</schema.generation>
</properties>
</profile>
<profile>
<id>disableSchemaGeneration</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<schema.generation></schema.generation>
</properties>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
Now you can build it like
mvn clean install -PenableSchemaGeneration
and it will change
${schema.generation}
in persistence.xml on
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="javax.persistence.schema-generation.scripts.action" value="drop-and-create"/>
<property name="javax.persistence.schema-generation.scripts.create-target" value="sampleCreate.ddl"/>
<property name="javax.persistence.schema-generation.scripts.drop-target" value="sampleDrop.ddl"/>