Cannot download dependencies artifacts from FTP Maven Repository using the FTP protocol

StackOverflow https://stackoverflow.com/questions/14146368

  •  12-01-2022
  •  | 
  •  

Question

I have the following problem: I use for tests purposes a FTP server as repository. All works fine to deploy (Upload) the different artifacts. As soon as I need to resolve and download artifacts dependencies previously uploaded on that repo, I get the following WARN:
[WARN] myrepo (ftp://ftp.myftpadress.fr/dev/M2Repo/, releases+snapshots) ignored (only S3, HTTP/S, and FILE are supported).
I cannot access the repository with the HTTP protocol. So does wagon support the FTP protocol for downloading needed artifacts?

Here is my POM "Wagon" Section:

...
    <extensions>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ftp</artifactId>
            <!-- I tried with older versions also-->
            <version>2.2</version>
        </extension>
    </extensions>
</build>
<repositories>
    <repository>
        <id>myrepo</id>
        <name>my Maven Repository</name>
        <url>ftp://ftp.myftpadress.fr/dev/M2Repo/</url>
        <layout>default</layout>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>
<distributionManagement>
    <repository>
        <id>myrepo</id>
        <name>my Maven Repository</name>
        <url>ftp://ftp.myftpadress.fr/dev/M2Repo/</url>
        <uniqueVersion>false</uniqueVersion>
    </repository>
    <snapshotRepository>
        <id>myrepo</id>
        <name>my Maven Repository</name>
        <url>ftp://ftp.myftpadress.fr/dev/M2Repo/</url>
        <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>
</distributionManagement>

I have also the needed infos in the settings.xml, it is OK because the artifact deployment works.

<servers>
    <server>
        <id>myrepo</id>
        <username>myuser</username>
        <password>mypassword</password>
    </server>
</servers>

I use the following maven & Java versions:
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: D:\maven\apache-maven-3.0.4\bin..
Java version: 1.7.0_09, vendor: Oracle Corporation
Java home: D:\Java\jdk1.7.0_09\jre
Default locale: fr_CA, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

THANKS A LOT IN ADVANCE! And happy new year...

Was it helpful?

Solution

I don't quite think you can do that. Maven resolves it's dependencies via HTTP. You can upload them via different protocols such as FTP, SCP, HTTP and DAV, but it resolves them via HTTP/HTTPS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top