Sergey Kryuchkov created KARAF-7327:
---------------------------------------
Summary: Cave proxy-repository download artifacts twice to the
same local repository
Key: KARAF-7327
URL: https://issues.apache.org/jira/browse/KARAF-7327
Project: Karaf
Issue Type: Bug
Components: cave
Affects Versions: cave-4.2.1
Reporter: Sergey Kryuchkov
An exception occurs during the installation of a bundle using the cave proxy
repository
{code:bash}
...
Timeout while waiting for concurrent download of
C:\Users\admin\.m2\repository\org\apache\karaf\examples\karaf-bundle-example-common\4.3.5\karaf-bundle-example-common-4.3.5.jar.part
to progress
...
{code}
Steps to reproduce:
1. Start karaf 4.2.x (karaf cave cannot be installed on karaf 4.3.x due to have
different osgi version dependence)
2. Install karaf cave and set up a proxy repository (for example, to the maven
central repository) in the karaf console
{code:bash}
feature:repo-add cave 4.2.1
feature:install cave-repository
cave:repository-create -p https://repo1.maven.org/maven2@id=central test-repo
{code}
3. Replace the following parameter in the config file
{{org.ops4j.pax.url.mvn.cfg}} with
{code:bash}
org.ops4j.pax.url.mvn.repositories=http://localhost:8181/cave/repository/test-repo@id=test-repo
{code}
4. Try to install the bundle
{code:bash}
install mvn:org.apache.karaf.examples/karaf-bundle-example-common/LATEST
{code}
Actual result: Installation error. Stacktrace contains
{code:bash}
...
Timeout while waiting for concurrent download of
C:\Users\admin\.m2\repository\org\apache\karaf\examples\karaf-bundle-example-common\4.3.5\karaf-bundle-example-common-4.3.5.jar.part
to progress
...
{code}
Expected result: Bundle installed successfully
Workarounds:
1) Set the non-default value of the {{org.ops4j.pax.url.mvn.localRepository}}
parameter in the config file {{{}org.ops4j.pax.url.mvn.cfg{}}}. Default value
is {{{}~/.m2/repository{}}}.
For example:
{code:bash}
org.ops4j.pax.url.mvn.localRepository=${karaf.data.uri}/myLocalRepository
{code}
And run the installation
{code:bash}
install mvn:org.apache.karaf.examples/karaf-bundle-example-common/LATEST
{code}
The bundle will be installed successfully. Both local repositories will contain
a copy of the bundle ({{{}${karaf.data.uri}/myLocalRepository{}}} and
{{{}~/.m2/repository{}}})
2) Or leave value of the {{org.ops4j.pax.url.mvn.localRepository}} parameter by
default ({{{}~/.m2/repository{}}}), but set the Mirror parameter for the proxy
repository to true
{code:bash}
cave:repository-proxy -m test-repo [https://repo1.maven.org/maven2@id=central]
{code}
And run the installation
{code:bash}
install mvn:org.apache.karaf.examples/karaf-bundle-example-common/LATEST
{code}
The bundle will be installed successfully. Both local repositories will contain
a copy of the bundle ({{{}~/.m2/repository{}}} and
{{{}${karaf.data.uri}/cave/repository/test-repo{}}})
--
This message was sent by Atlassian Jira
(v8.20.1#820001)