I am calling a script located at my server using maven. Before doing this change, the build was running successfully but after introducing this change, it pauses and does not continue the build after executing my changes I made in the pom. It basically freezes.
The script consists of me looping through number of files in a folder and just getting their name. Nothing to heavy or drastic.
This is part of my POM that has my change.
<plugin>
<!-- Step to copy the unit tests to designated destination -->
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>Deploy Unit tests onto Server</id>
<phase>process-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Copy files to the remote integration test server -->
<!-- Transferring unit tests -->
<scp failonerror="true" todir="${scp.user}:${scp.password}@${scp.host}:/${scp.dirCopyToUnit}" trust="true">
<fileset dir="${scp.UnitTest.api.dir}">
<include name="*"></include>
</fileset>
</scp>
<!-- transferring resources files -->
<scp failonerror="true" todir="${scp.user}:${scp.password}@${scp.host}:/${scp.dirCopyToUnitResources}" trust="true">
<fileset dir="${scp.UnitTest.api.dirResources}">
<include name="*"></include>
</fileset>
</scp>
<!-- transferring spec_helper.lua -->
<scp failonerror="true" todir="${scp.user}:${scp.password}@${scp.host}:/${scp.dirCopySpec_Helpers}" trust="true">
<fileset dir="${scp.UnitTest.api.dirSpec_Helpers}">
<include name="*"></include>
</fileset>
</scp>
<sshexec command="sh /tmp/unitTestMaven.sh" host="${scp.host}" password="${scp.password}" trust="yes" username="${scp.user}"></sshexec>
<!-- SSH -->
<taskdef classname="org.apache.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="maven.plugin.classpath" name="sshexec"></taskdef>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-commons-net</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.42</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
</plugin>
I followed an answer from this as this helped my initial problem: Run remote command via ssh using Maven3
EDIT: I've noticed that sshexec hides the rest of the maven output. I've came across this but this didn't help: maven antrun ssh or scp hides the output