Maven Failed to resolve target definition and Failed to load p2 metadata repository from location http://download.eclipse.org/nebula/releases/1.2.0/

Hello Snapcraft community,

I would like to create a package for Eclipse Papyrus.

But I get this error when building:

[e[1;34mINFOe[m] Computing target platform for MavenProject: org.eclipse.papyrus:org.eclipse.papyrus.rcp:5.2.0-SNAPSHOT @ /build/eclipse-papyrus-snapcraft/parts/eclipse-papyrus-snapcraft/build/releng/rcp/org.eclipse.papyrus.rcp/pom.xml
[e[1;31mERRORe[m] Failed to resolve target definition /build/eclipse-papyrus-snapcraft/parts/eclipse-papyrus-snapcraft/build/releng/rcp/targetPlatform/org.eclipse.papyrus.rcp.targetplatform.target: Failed to load p2 metadata repository from location http://download.eclipse.org/nebula/releases/1.2.0/: Unknown Host: http://download.eclipse.org/nebula/releases/1.2.0/content.xml: Unknown host download.eclipse.org -> e[1m[Help 1]e[m
[e[1;31mERRORe[m] 
[e[1;31mERRORe[m] To see the full stack trace of the errors, re-run Maven with the e[1m-ee[m switch.
[e[1;31mERRORe[m] Re-run Maven using the e[1m-Xe[m switch to enable full debug logging.
[e[1;31mERRORe[m] 
[e[1;31mERRORe[m] For more information about the errors and possible solutions, please read the following articles:
[e[1;31mERRORe[m] e[1m[Help 1]e[m http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException
[10/Mar/2022:20:33:35 +0000] "CONNECT repo.maven.apache.org:443 HTTP/1.1" 200 3275627 "-" "Apache-HttpClient/4.5.11 (Java/11.0.14)"
[10/Mar/2022:20:33:35 +0000] "CONNECT repo.maven.apache.org:443 HTTP/1.1" 200 3353359 "-" "Apache-HttpClient/4.5.11 (Java/11.0.14)"
[10/Mar/2022:20:33:35 +0000] "CONNECT repo.maven.apache.org:443 HTTP/1.1" 200 1459501 "-" "Apache-HttpClient/4.5.11 (Java/11.0.14)"
[10/Mar/2022:20:33:35 +0000] "CONNECT repo.maven.apache.org:443 HTTP/1.1" 200 1690283 "-" "Apache-HttpClient/4.5.11 (Java/11.0.14)"
[10/Mar/2022:20:33:35 +0000] "CONNECT repo.maven.apache.org:443 HTTP/1.1" 200 14265449 "-" "Apache-HttpClient/4.5.11 (Java/11.0.14)"
Failed to run 'override-build': Exit code was 1.
Build failed

So I tested on Github Action and I don’t have an error when I compile. There is a small difference between Snapcraft.io and Github Action, which is that the former has the proxy, while the latter does not. To compile Eclipse Papyrus I use Maven and Java 11. Knowing that Java 11 is the minimum version for Eclipse Papyrus.

Here’s the difference between the Snapcraft.io version and the Github Action version.

Here is the Snapcraft.io version: snapcraft.yaml

override-build: |
    git checkout "5.2.0" -b latest
    snapcraftctl set-version "$(git describe --tags | sed 's/v//' | sed "s/-g/%/"  | cut -d "%" -f1)"
    # Gets the host and port from a proxy URL
    #   $1 = the proxy URL, such as "http://10.10.10.1:8222/"
    getproxy () {
        host=$(echo "$1" | sed -E 's|https?://([^:/]*):?[0-9]*/?|\1|')
        port=$(echo "$1" | sed -E 's|https?://[^:/]*:?([0-9]*)/?|\1|')
    }
    # Sets Java networking properties when using a proxy server
    if [ -n "${http_proxy:-}" ]; then
        getproxy "$http_proxy"
        http="-Dhttp.proxyHost=$host -Dhttp.proxyPort=$port"
    fi
    if [ -n "${https_proxy:-}" ]; then
        getproxy "$https_proxy"
        https="-Dhttps.proxyHost=$host -Dhttps.proxyPort=$port"
    fi
    # Builds Maven
    export MAVEN_OPTS="$http $https"
    mvn -f $SNAPCRAFT_PART_BUILD/releng/rcp/pom.xml -Dpapyrus.repo.main=https://download.eclipse.org/modeling/mdt/papyrus/updates/releases/2021-12/6.0.0/main/ clean verify
    tar -xf "${SNAPCRAFT_PART_BUILD}/releng/rcp/org.eclipse.papyrus.rcp.product/target/products/org.eclipse.papyrus.rcp.product-linux.gtk.x86_64.tar.gz" -C "${SNAPCRAFT_PART_INSTALL}"

Here’s the Github Action version: snapcraft.yaml

override-build: |
    git checkout "5.2.0" -b latest
    snapcraftctl set-version "$(git describe --tags | sed 's/v//' | sed "s/-g/%/"  | cut -d "%" -f1)"
    mvn -f $SNAPCRAFT_PART_BUILD/releng/rcp/pom.xml -Dpapyrus.repo.main=https://download.eclipse.org/modeling/mdt/papyrus/updates/releases/2021-12/6.0.0/main/ clean verify
    tar -xf "${SNAPCRAFT_PART_BUILD}/releng/rcp/org.eclipse.papyrus.rcp.product/target/products/org.eclipse.papyrus.rcp.product-linux.gtk.x86_64.tar.gz" -C "${SNAPCRAFT_PART_INSTALL}"

Here are the logs of the Snapcraft.io version: launchpad.net

Here are the logs of the Github Action version: github.com

Here is the repository of Eclipse Papyrus: org.eclipse.papyrus.git - modeling.mdt.papyrus project repository

Thank you for your help.

Great regards