The example here for scp (secured copy) using ant in maven. One of the tip for this example you declare your dependency inside the plugin tag.
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>1.8</version>
<executions>
<execution>
<id>get-ear-from-nexus</id>
<phase>validate|clean|package|</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<scp file="file_name"
todir=" "
verbose="true" password=" " trust="true"
/>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.54</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>1.8</version>
<executions>
<execution>
<id>get-ear-from-nexus</id>
<phase>validate|clean|package|</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<scp file="file_name"
todir=" "
verbose="true" password=" " trust="true"
/>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.54</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
</plugin>