You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by "Rabe, Jens" <je...@iwes.fraunhofer.de> on 2022/11/01 13:57:15 UTC
Cannot download artifacts from a package repository on Gitlab
Hello,
I am trying to get artifacts from a Maven-style package repository using our company Gitlab.
I put together my ivy-settings.xml like this:
<ivysettings>
<settings defaultResolver="default"/>
<include url="${ivy.default.settings.dir}/ivysettings-public.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-local.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
<credentials host="my.company.com" realm="gitlab-maven" username="Private-Token" passwd="XXXXXXX..." />
<resolvers>
<ibiblio name="repo0"
m2compatible="true"
useMavenMetadata="true"
usepoms="true"
root="https://my.company.com/api/v4/projects/1337/packages/maven"
pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" />
<chain name="default" returnFirst="true" checkmodified="true">
<resolver ref="local" />
<resolver ref="shared" />
<resolver ref="public" />
<resolver ref="repo0" />
</chain>
</resolvers>
</ivysettings>
When Ivy now tries to download the package, these are the errors I get:
:: loading settings :: file = /opt/spark/conf/ivy-settings.xml
:: loading settings :: url = jar:file:/opt/spark/jars/ivy-2.5.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
Ivy Default Cache set to: /home/spark/.ivy2/cache
The jars for the packages stored in: /home/spark/.ivy2/jars
com.company.my#some-artifact added as a dependency
:: resolving dependencies :: org.apache.spark#spark-submit-parent-3bb84be4-4bc7-41c7-8a74-3d16ffaa584b;1.0
confs: [default]
:: resolution report :: resolve 520ms :: artifacts dl 0ms
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 1 | 0 | 0 | 0 || 0 | 0 |
---------------------------------------------------------------------
:: problems summary ::
:::: WARNINGS
module not found: com.company.my#some-artifact;1.2.3
==== local: tried
/home/spark/.ivy2/local/com.company.my/some-artifact/1.2.3/ivys/ivy.xml
-- artifact com.company.my#some-artifact;1.2.3!some-artifact.jar:
/home/spark/.ivy2/local/com.company.my/some-artifact/1.2.3/jars/some-artifact.jar
==== shared: tried
/home/spark/.ivy2/shared/com.company.my/some-artifact/1.2.3/ivys/ivy.xml
-- artifact com.company.my#some-artifact;1.2.3!some-artifact.jar:
/home/spark/.ivy2/shared/com.company.my/some-artifact/1.2.3/jars/some-artifact.jar
==== public: tried
https://repo1.maven.org/maven2/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.pom
-- artifact com.company.my#some-artifact;1.2.3!some-artifact.jar:
https://repo1.maven.org/maven2/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.jar
==== repo0: tried
https://my.company.com/api/v4/projects/1337/packages/maven/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.pom
-- artifact com.company.my#some-artifact;1.2.3!some-artifact.jar:
https://my.company.com/api/v4/projects/1337/packages/maven/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: com.company.my#some-artifact;1.2.3: not found
::::::::::::::::::::::::::::::::::::::::::::::
Does Ivy not support Maven-style repositories on Gitlab or did I miss anything? Because, when I paste one of the URLs in my browser, the artifact downloads fine.
Best regards
Jens
RE: Cannot download artifacts from a package repository on Gitlab
Posted by "Rabe, Jens" <je...@iwes.fraunhofer.de>.
Hello,
since this happens in Docker containers freshly spun up (as it is invoked from Apache Spark on k8s) there is no ~/.ivy2 at start. Plus, the output before is all I get.
-----Original Message-----
From: Archie Cobbs <ar...@dellroad.org>
Sent: Tuesday, November 1, 2022 15:02
To: ivy-user@ant.apache.org
Subject: Re: Cannot download artifacts from a package repository on Gitlab
Not sure if this is the problem, but sometimes after fixing things you need to rm -rf ~/.ivy2/cache/com.company.my to make ivy forget the earlier invalid state.
If that doesn't fix it, then there should be an error/exception displayed when ivy tries to download it.
On Tue, Nov 1, 2022 at 8:57 AM Rabe, Jens <je...@iwes.fraunhofer.de>
wrote:
> Hello,
>
> I am trying to get artifacts from a Maven-style package repository
> using our company Gitlab.
>
> I put together my ivy-settings.xml like this:
>
> <ivysettings>
>
> <settings defaultResolver="default"/>
>
> <include url="${ivy.default.settings.dir}/ivysettings-public.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-local.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
> <include
> url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
>
> <credentials host="my.company.com" realm="gitlab-maven"
> username="Private-Token" passwd="XXXXXXX..." />
>
> <resolvers>
> <ibiblio name="repo0"
> m2compatible="true"
> useMavenMetadata="true"
> usepoms="true"
> root="
> https://my.company.com/api/v4/projects/1337/packages/maven"
>
> pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
> />
> <chain name="default" returnFirst="true" checkmodified="true">
> <resolver ref="local" />
> <resolver ref="shared" />
> <resolver ref="public" />
> <resolver ref="repo0" />
> </chain>
> </resolvers>
> </ivysettings>
>
> When Ivy now tries to download the package, these are the errors I get:
>
> :: loading settings :: file = /opt/spark/conf/ivy-settings.xml
> :: loading settings :: url =
> jar:file:/opt/spark/jars/ivy-2.5.0.jar!/org/apache/ivy/core/settings/i
> vysettings.xml Ivy Default Cache set to: /home/spark/.ivy2/cache The
> jars for the packages stored in: /home/spark/.ivy2/jars
> com.company.my#some-artifact added as a dependency
> :: resolving dependencies ::
> org.apache.spark#spark-submit-parent-3bb84be4-4bc7-41c7-8a74-3d16ffaa584b;1.0
> confs: [default]
> :: resolution report :: resolve 520ms :: artifacts dl 0ms
>
> ---------------------------------------------------------------------
> | | modules || artifacts
> |
> | conf | number| search|dwnlded|evicted||
> number|dwnlded|
>
> ---------------------------------------------------------------------
> | default | 1 | 0 | 0 | 0 || 0 | 0
> |
>
> ---------------------------------------------------------------------
>
> :: problems summary ::
> :::: WARNINGS
> module not found: com.company.my#some-artifact;1.2.3
>
> ==== local: tried
> /home/spark/.ivy2/local/
> com.company.my/some-artifact/1.2.3/ivys/ivy.xml
> -- artifact
> com.company.my#some-artifact;1.2.3!some-artifact.jar
> :
> /home/spark/.ivy2/local/
> com.company.my/some-artifact/1.2.3/jars/some-artifact.jar
>
> ==== shared: tried
> /home/spark/.ivy2/shared/
> com.company.my/some-artifact/1.2.3/ivys/ivy.xml
> -- artifact
> com.company.my#some-artifact;1.2.3!some-artifact.jar
> :
> /home/spark/.ivy2/shared/
> com.company.my/some-artifact/1.2.3/jars/some-artifact.jar
>
> ==== public: tried
>
> https://repo1.maven.org/maven2/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.pom
> -- artifact
> com.company.my#some-artifact;1.2.3!some-artifact.jar
> :
>
> https://repo1.maven.org/maven2/de/fraunhofer/iwes/some-artifact/1.2.3/
> some-artifact-1.2.3.jar
>
> ==== repo0: tried
>
> https://my.company.com/api/v4/projects/1337/packages/maven/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.pom
> -- artifact
> com.company.my#some-artifact;1.2.3!some-artifact.jar
> :
>
> https://my.company.com/api/v4/projects/1337/packages/maven/de/fraunhof
> er/iwes/some-artifact/1.2.3/some-artifact-1.2.3.jar
>
> ::::::::::::::::::::::::::::::::::::::::::::::
> :: UNRESOLVED DEPENDENCIES ::
> ::::::::::::::::::::::::::::::::::::::::::::::
> :: com.company.my#some-artifact;1.2.3: not found
> ::::::::::::::::::::::::::::::::::::::::::::::
>
> Does Ivy not support Maven-style repositories on Gitlab or did I miss
> anything? Because, when I paste one of the URLs in my browser, the
> artifact downloads fine.
>
> Best regards
> Jens
>
--
Archie L. Cobbs
Re: Cannot download artifacts from a package repository on Gitlab
Posted by Archie Cobbs <ar...@dellroad.org>.
Not sure if this is the problem, but sometimes after fixing things you need
to rm -rf ~/.ivy2/cache/com.company.my to make ivy forget the earlier
invalid state.
If that doesn't fix it, then there should be an error/exception displayed
when ivy tries to download it.
On Tue, Nov 1, 2022 at 8:57 AM Rabe, Jens <je...@iwes.fraunhofer.de>
wrote:
> Hello,
>
> I am trying to get artifacts from a Maven-style package repository using
> our company Gitlab.
>
> I put together my ivy-settings.xml like this:
>
> <ivysettings>
>
> <settings defaultResolver="default"/>
>
> <include url="${ivy.default.settings.dir}/ivysettings-public.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-local.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
> <include
> url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
>
> <credentials host="my.company.com" realm="gitlab-maven"
> username="Private-Token" passwd="XXXXXXX..." />
>
> <resolvers>
> <ibiblio name="repo0"
> m2compatible="true"
> useMavenMetadata="true"
> usepoms="true"
> root="
> https://my.company.com/api/v4/projects/1337/packages/maven"
>
> pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
> />
> <chain name="default" returnFirst="true" checkmodified="true">
> <resolver ref="local" />
> <resolver ref="shared" />
> <resolver ref="public" />
> <resolver ref="repo0" />
> </chain>
> </resolvers>
> </ivysettings>
>
> When Ivy now tries to download the package, these are the errors I get:
>
> :: loading settings :: file = /opt/spark/conf/ivy-settings.xml
> :: loading settings :: url =
> jar:file:/opt/spark/jars/ivy-2.5.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
> Ivy Default Cache set to: /home/spark/.ivy2/cache
> The jars for the packages stored in: /home/spark/.ivy2/jars
> com.company.my#some-artifact added as a dependency
> :: resolving dependencies ::
> org.apache.spark#spark-submit-parent-3bb84be4-4bc7-41c7-8a74-3d16ffaa584b;1.0
> confs: [default]
> :: resolution report :: resolve 520ms :: artifacts dl 0ms
>
> ---------------------------------------------------------------------
> | | modules || artifacts
> |
> | conf | number| search|dwnlded|evicted||
> number|dwnlded|
>
> ---------------------------------------------------------------------
> | default | 1 | 0 | 0 | 0 || 0 | 0
> |
>
> ---------------------------------------------------------------------
>
> :: problems summary ::
> :::: WARNINGS
> module not found: com.company.my#some-artifact;1.2.3
>
> ==== local: tried
> /home/spark/.ivy2/local/
> com.company.my/some-artifact/1.2.3/ivys/ivy.xml
> -- artifact com.company.my#some-artifact;1.2.3!some-artifact.jar
> :
> /home/spark/.ivy2/local/
> com.company.my/some-artifact/1.2.3/jars/some-artifact.jar
>
> ==== shared: tried
> /home/spark/.ivy2/shared/
> com.company.my/some-artifact/1.2.3/ivys/ivy.xml
> -- artifact com.company.my#some-artifact;1.2.3!some-artifact.jar
> :
> /home/spark/.ivy2/shared/
> com.company.my/some-artifact/1.2.3/jars/some-artifact.jar
>
> ==== public: tried
>
> https://repo1.maven.org/maven2/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.pom
> -- artifact com.company.my#some-artifact;1.2.3!some-artifact.jar
> :
>
> https://repo1.maven.org/maven2/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.jar
>
> ==== repo0: tried
>
> https://my.company.com/api/v4/projects/1337/packages/maven/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.pom
> -- artifact com.company.my#some-artifact;1.2.3!some-artifact.jar
> :
>
> https://my.company.com/api/v4/projects/1337/packages/maven/de/fraunhofer/iwes/some-artifact/1.2.3/some-artifact-1.2.3.jar
>
> ::::::::::::::::::::::::::::::::::::::::::::::
> :: UNRESOLVED DEPENDENCIES ::
> ::::::::::::::::::::::::::::::::::::::::::::::
> :: com.company.my#some-artifact;1.2.3: not found
> ::::::::::::::::::::::::::::::::::::::::::::::
>
> Does Ivy not support Maven-style repositories on Gitlab or did I miss
> anything? Because, when I paste one of the URLs in my browser, the artifact
> downloads fine.
>
> Best regards
> Jens
>
--
Archie L. Cobbs