JBOSS/WILDFLY maven plugin para deploy LOCALHOST/REMOTE server
07 July 2014
Coloque as propriedades do seu server no arquivo settings.xml do maven (encontrado no diretório .m2 ) como esse:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<profiles> | |
<profile> | |
<id>wildfly-remote</id> | |
<properties> | |
<wildfly-hostname>192.168.0.123</wildfly-hostname> | |
<wildfly-port>9990</wildfly-port> | |
<wildfly-username>remoteuser</wildfly-username> | |
<wildfly-password>remotepassword</wildfly-password> | |
</properties> | |
</profile> | |
<profile> | |
<id>wildfly-local</id> | |
<properties> | |
<wildfly-home>${env.WILDFLY_HOME}</wildfly-home> | |
<wildfly-hostname>127.0.0.1</wildfly-hostname> | |
<wildfly-port>9990</wildfly-port> | |
<wildfly-username>clairton</wildfly-username> | |
<wildfly-password>localpassword</wildfly-password> | |
</properties> | |
</profile> | |
</profiles> | |
<activeProfiles> | |
<activeProfile>wildfly-local</activeProfile> | |
<activeProfile>wildfly-remote</activeProfile> | |
</activeProfiles> | |
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.wildfly.plugins</groupId> | |
<artifactId>wildfly-maven-plugin</artifactId> | |
<version>1.0.2.Final</version> | |
<configuration> | |
<hostname>${wildfly-hostname}</hostname> | |
<port>${wildfly-port}</port> | |
<username>${wildfly-username}</username> | |
<password>${wildfly-password}</password> | |
</configuration> | |
<executions> | |
<execution> | |
<!--<phase>package</phase> --> | |
<!--<goals> --> | |
<!--<goal>deploy</goal> --> | |
<!--</goals> --> | |
</execution> | |
</executions> | |
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Para deploy no servidor localhost executar o seguinte comando: | |
wildfly:deploy -P wildfly-local | |
# Para deploy no servidor remoto executar: | |
wildfly:deploy -P wildfly-remote |