I would like to upload the builded jar with all dependencies via SFTP to my Raspberry Pi. Therefore I tried to use maven-deploy-plugin.
My configuration looks like:
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>Raspberry Pi</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<pomFile>pom.xml</pomFile>
<file>target/${project.name}.jar</file>
<url>sftp://[email protected]/home/</url>
</configuration>
</execution>
</executions>
</plugin>
As you can already see, the uploaded jar is a shaded jar which is renamed by <finalName>${project.name}</finalName>
Furthermore I included the wagon-ssh extension and defined the Raspberry Pi:
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.8</version>
</extension>
</extensions>
<distributionManagement>
<repository>
<id>Raspberry Pi</id>
<url>sftp://192.168.2.108/home</url>
</repository>
</distributionManagement>
However, if I execute mvn:deploy, maven will only upload the original-jar to the Raspberry Pi to the file path of groupId, artifactId and version.
What can I do to only upload a single jar without a directory.