1

For the past couple of hours, I have been unable to solve this issue. Note that I have tried looking for solutions with no avail.

Anyway, my issue is that I am unable to create a directory with the Maven Wagon plugin. Here is an snip of the error for reference.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project spigotsite: Failed to deploy artifacts: Could not transfer artifact be.maximvdw:spigotsite:jar:0.0.12-20160523.053812-1 from/to public (ftp://***.***.***.***): Unable to create directory be -> [Help 1]

Snip of pom.xml

<distributionManagement>
    <repository>
        <uniqueVersion>false</uniqueVersion>
        <id>public</id>
        <name>Repository</name>
        <url>ftp://***.***.***.***</url>
    </repository>
</distributionManagement>

Snip of settings.xml

<servers>
   <server>
       <id>public</id>
       <username>***</username>
       <password>***</password>
   </server>
</servers>

I have verified that I am able to log onto the FTP and create a directory. I gave the FTP user full write permission to the folder as well as tested writing to the folder itself. I seem to be overlooking something and I appreciate if anyone could point out my mistake. Thank you in advance.

Bart
  • 59
  • 1
  • 1
  • 8
  • 1
    If you like to deploy artifacts to a repository you shouldn't go via FTP better is to use a repository manager and make the default http/https instead. Apart from that have you configured the wagon plugin as extension in your build? Otherwise ftp/ssh will never work. – khmarbaise May 24 '16 at 15:48
  • @khmarbaise Hello, thank you for the reply. Yes, I do have the extension. The error is an issue with directory creation which is puzzling. Still unable to solve this issue but i'll try to work an alternative solution with a repository manager. – Bart May 25 '16 at 04:28
  • Which version of wagon do you use? – khmarbaise May 25 '16 at 08:43
  • I was using v2.4 wagon FTP. I currently switched an HTTP repository manager and it is working fine. Thank you for the alternative solution. – Bart May 25 '16 at 20:26
  • Outch 2.4 is a little bit outdated...current version is 2.10 See http://maven.apache.org/wagon/... – khmarbaise May 25 '16 at 21:50

1 Answers1

1

It worked for me:

POM.xml

<build>
    ...
    <extensions>
        <!-- Enabling the use of FTP -->
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ftp</artifactId>
            <version>3.0.0</version>
        </extension>
   </extensions>
</build>
<distributionManagement>
    <repository>
        <id>ftp-repository</id>
        <url>ftp://...myhost.../srv/ftp/</url> <!-- repository location -->
    </repository>
</distributionManagement>

SETTINGS.xml

<servers>
    <server>
        <id>ftp-repository</id>
        <username>myusername</username>
        <password>mypassword</password>
        <configuration>
            <endpointChecking>false</endpointChecking>
        </configuration>
    </server>
    ...
</servers>
dariobronx
  • 375
  • 1
  • 3
  • 10