When you bind a plugin to a phase, the plugin runs AFTER the specified
phase is completed. I suggest you bind your plugin to the test phase
which is before the package phase.
Also, I think there is a better way to do that. You can use the
<resources> and <testResources> in your pom.xml to accomplish the same
thing without creating a copy plugin.
You can put the production files in <resources> and the test files in
<testResources>.
Both the <resources> and <testResources> are copied into the
target/test-classes and since resources are copied first, the
testResources files will overwrite the ones from resources. However,
only resources are copied into target/classes so you'll only have the
production files in there when the jar plugin runs and packages the
contents of target/classes.
Hope that helps.
^_^
Jacob Hoeflaken wrote:
In our jar project we've got 2 property files. One for testing and one for
production. The one for productions is called spring.properties.production
and the one for testing spring.properties.
If the environment/system property env is set to "production" I want to copy
spring.properties.production to spring.properties before the project is
packaged, but after the project is tested. So during the test phase the
original test spring.properties is used, but at the package time
spring.properties.production should be renamed and included as
spring.properties.
Any thoughts on how to do this?
I've tried putting a copy plugin bound to the packageing phase before the
jar plugin, but the jar plugin still gets called first, ignoring my copy.
How do you set priority of plugins within a phase?
--
View this message in context:
http://www.nabble.com/m2%3A+renaming+file+before+including+in+jar-t1699650.html#a4612430
Sent from the Maven - Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]