I am trying to transfer a bunch of .txt from a remote server to my local machine as part of my maven build. I am using the maven-ant-run plugin here. I've noticed that I can only transfer one file as opposed to using a fileSet
and the number of .txt files on the remote server does increase/decrease dynamincally so there are no set amount of .txt files so I simply cant hardcode it. Any suggestions?
So I've tried giving wagon plugin a go. This is my pom config for it:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>execute-test-commands</id>
<phase>process-test-class</phase>
<goals>
<goal>download</goal>
</goals>
<configuration>
<url>scp://${scp.user}:${scp.password}@${scp.host}</url>
<fromDir>testOutput</fromDir>
<includes>*.txt</includes>
<toDir>src/test/resources/unit</toDir>
</configuration>
</execution>
</executions>
</plugin>
And this is my output:
[INFO] Downloading scp://*.*.net/testOutput/JOSE.txt to
C:\Users\Hello\Desktop\AANewMaven\Access\src\test\resources\lua\kong\plugins\JOSE.txt ...
Executing command: scp -p -f "/testOutput/JOSE.txt"
Remote file permissions: 0664
Remote file size: 399
Remote filename: JOSE.txt
attempting to create parent directories for destination: JOSE.txt
Downloading: testOutput/JOSE.txt from scp://*.*.net
#
(I've place *
for confidential reasons)