- Call target from pom.xml
1
2
3
4
5
6
7
<configuration>
<target>
<ant antfile="${basedir}/build.xml">
<target name="deploy" />
</ant>
</target>
</configuration>
- Setup profile and list server for that environment
1
2
3
4
5
6
7
<profile>
<id>dev</id>
<properties>
<classifier.type>DEV</classifier.type>
<server.hostname>localhost</server.hostname>
</properties>
</profile>
- Ant ssh and execute commands on remote
1
2
3
4
5
6
7
<sshexec
host="${node}"
username="server"
password="${server.password}"
command=". .bash_profile;
./server.sh restart;"
trust="true" />