-
Feature Request
-
Resolution: Won't Do
-
Minor
-
None
-
None
-
None
I want to configure the wildfly plugin based on environment specific properties read from a file during initialization phase. Therefore I use the properties-maven-plugin and configured two profiles to read a configuration file bases on the environment name.
Here is the content of the dev configuration file:
wildfly.hostname=localhost wildfly.port=8081 wildfly.management.port=9991 wildfly.username=admin wildfly.password=admin
Here is the plugin configuration:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.0.0</version> <executions> <execution> <phase>initialize</phase> <goals> <goal>read-project-properties</goal> </goals> <configuration> <files> <file>config/wildfly-${environment}.properties</file> </files> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <version>1.1.0.Beta1</version> <configuration> <hostname>${wildfly.hostname}</hostname> <port>${wildfly.management.port}</port> <username>${wildfly.username}</username> <password>${wildfly.password}</password> </configuration> </plugin>
Here is the profile configuration:
<profiles> <profile> <id>dev</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <environment>dev</environment> </properties> </profile> <profile> <id>staging</id> <properties> <environment>staging</environment> </properties> </profile> </profiles>
When I run mvn wildfly:deploy the configuration cannot access the properties read from the file and the default values are used.
Running mvn initialize wildfly:deploy it works as expected.
There is a stackoverflow question which describes the same behavior.
Is it possible to run the initialize phase before wildfly:deploy without explicitly calling it on the command line?