karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grzegorz Grzybek (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-6005) Resolve of bundle with version range in a feature only works with ".m2" and not with "system" directory
Date Mon, 19 Nov 2018 14:08:00 GMT

    [ https://issues.apache.org/jira/browse/KARAF-6005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16691732#comment-16691732
] 

Grzegorz Grzybek commented on KARAF-6005:
-----------------------------------------

[~valthaus] I did one test.
I created artificial:
* ~/.m2/repository/commons-io/commons-io2/2.6/commons-io2-2.6.pom
* ~/.m2/repository/commons-io/commons-io2/2.6/commons-io2-2.6.jar

(note - there's no {{commons-io2}} artifact anywhere in the world).

With only this, I wasn't able to resolve such artifact:
{noformat}
karaf@root()> install 'mvn:commons-io/commons-io2/[2.5,2.7)'
Bundle IDs: 
Error executing command: Error installing bundles:
	Unable to install bundle mvn:commons-io/commons-io2/[2.5,2.7): org.osgi.framework.BundleException:
Unable to cache bundle: mvn:commons-io/commons-io2/[2.5,2.7)
{noformat}

But after I created:
* ~/.m2/repository/commons-io/commons-io2/maven-metadata-local.xml

With:
{code:xml}
<metadata>
  <groupId>commons-io</groupId>
  <artifactId>commons-io2</artifactId>
  <versioning>
    <versions>
      <version>2.6</version>
    </versions>
    <lastUpdated>20171211134705</lastUpdated>
  </versioning>
</metadata>
{code}

I was able to resolve such artifact:
{noformat}
karaf@root()> install 'mvn:commons-io/commons-io2/[2.5,2.7)'                          
                                                                                         
                                                              
Bundle ID: 48
{noformat}

In logs (after uncomenting the section "# help with identification of maven-related problems
with pax-url-aether"), I saw:
{noformat}
2018-11-19T15:00:39,750 | DEBUG | pipe-install 'mvn:commons-io/commons-io2/[2.5,2.7)' | Connection
                      | 4 - org.ops4j.pax.url.mvn - 2.5.4 | Resolving [mvn:commons-io/commons-io2/[2.5,2.7)]
2018-11-19T15:00:39,754 | DEBUG | DefaultMetadataResolver-3-0 | DefaultTransporterProvider
      | 4 - org.ops4j.pax.url.mvn - 2.5.4 | Using transporter WagonTransporter with priority
-1.0 for http://repo1.maven.org/maven2/
2018-11-19T15:00:39,755 | DEBUG | DefaultMetadataResolver-3-2 | DefaultTransporterProvider
      | 4 - org.ops4j.pax.url.mvn - 2.5.4 | Using transporter WagonTransporter with priority
-1.0 for https://oss.sonatype.org/content/repositories/ops4j-snapshots/
2018-11-19T15:00:39,755 | DEBUG | DefaultMetadataResolver-3-1 | DefaultTransporterProvider
      | 4 - org.ops4j.pax.url.mvn - 2.5.4 | Using transporter WagonTransporter with priority
-1.0 for http://repository.apache.org/content/groups/snapshots-group/
2018-11-19T15:00:39,756 | DEBUG | DefaultMetadataResolver-3-0 | DefaultRepositoryConnectorProvider
| 4 - org.ops4j.pax.url.mvn - 2.5.4 | Using connector BasicRepositoryConnector with priority
0.0 for http://repo1.maven.org/maven2/
2018-11-19T15:00:39,757 | DEBUG | DefaultMetadataResolver-3-1 | DefaultRepositoryConnectorProvider
| 4 - org.ops4j.pax.url.mvn - 2.5.4 | Using connector BasicRepositoryConnector with priority
0.0 for http://repository.apache.org/content/groups/snapshots-group/
2018-11-19T15:00:39,757 | DEBUG | DefaultMetadataResolver-3-2 | DefaultRepositoryConnectorProvider
| 4 - org.ops4j.pax.url.mvn - 2.5.4 | Using connector BasicRepositoryConnector with priority
0.0 for https://oss.sonatype.org/content/repositories/ops4j-snapshots/
2018-11-19T15:00:39,854 | DEBUG | DefaultMetadataResolver-3-0 | headers                  
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | http-outgoing-13 >> GET /maven2/commons-io/commons-io2/maven-metadata.xml
HTTP/1.1
...
2018-11-19T15:00:39,859 | DEBUG | DefaultMetadataResolver-3-0 | headers                  
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | http-outgoing-13 >> Host: repo1.maven.org
...
2018-11-19T15:00:39,912 | DEBUG | DefaultMetadataResolver-3-0 | headers                  
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | http-outgoing-13 << HTTP/1.1 404 Not Found
...
2018-11-19T15:00:39,925 | DEBUG | DefaultMetadataResolver-3-0 | DefaultUpdateCheckManager
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | Writing tracking file /home/ggrzybek/.m2/repository/commons-io/commons-io2/resolver-status.properties
2018-11-19T15:00:39,947 | DEBUG | DefaultMetadataResolver-3-1 | headers                  
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | http-outgoing-14 >> GET /content/groups/snapshots-group/commons-io/commons-io2/maven-metadata.xml
HTTP/1.1
...
2018-11-19T15:00:39,949 | DEBUG | DefaultMetadataResolver-3-1 | headers                  
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | http-outgoing-14 >> Host: repository.apache.org
...
2018-11-19T15:00:40,102 | DEBUG | DefaultMetadataResolver-3-1 | headers                  
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | http-outgoing-14 << HTTP/1.1 404 Not Found
...
2018-11-19T15:00:40,110 | DEBUG | DefaultMetadataResolver-3-1 | DefaultUpdateCheckManager
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | Writing tracking file /home/ggrzybek/.m2/repository/commons-io/commons-io2/resolver-status.properties
2018-11-19T15:00:40,271 | DEBUG | DefaultMetadataResolver-3-2 | headers                  
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | http-outgoing-15 >> GET /content/repositories/ops4j-snapshots/commons-io/commons-io2/maven-metadata.xml
HTTP/1.1
...
2018-11-19T15:00:40,276 | DEBUG | DefaultMetadataResolver-3-2 | headers                  
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | http-outgoing-15 >> Host: oss.sonatype.org
...
2018-11-19T15:00:45,301 | DEBUG | DefaultMetadataResolver-3-2 | headers                  
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | http-outgoing-15 << HTTP/1.1 404 Not Found
...
2018-11-19T15:00:45,309 | DEBUG | DefaultMetadataResolver-3-2 | DefaultUpdateCheckManager
       | 4 - org.ops4j.pax.url.mvn - 2.5.4 | Writing tracking file /home/ggrzybek/.m2/repository/commons-io/commons-io2/resolver-status.properties
2018-11-19T15:00:45,313 | DEBUG | pipe-install 'mvn:commons-io/commons-io2/[2.5,2.7)' | AetherBasedResolver
             | 4 - org.ops4j.pax.url.mvn - 2.5.4 | Resolved (commons-io:commons-io2:jar:[2.5,2.7))
as /home/ggrzybek/.m2/repository/commons-io/commons-io2/2.6/commons-io2-2.6.jar
{noformat}

The answer is - it works with {{~/.m2/repository}} because of maven-metadata-\*.xml file -
there's no such metadata in {{system/}}.

I would _won't fix_ it.

> Resolve of bundle with version range in a feature only works with ".m2" and not with
"system" directory
> -------------------------------------------------------------------------------------------------------
>
>                 Key: KARAF-6005
>                 URL: https://issues.apache.org/jira/browse/KARAF-6005
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.2.1
>            Reporter: Volker Althaus
>            Priority: Critical
>
> I defined a feature with a ranged bundle version:
> <feature name="some.api" version="1.0.0">
> 	<bundle>mvn:de.some.api/api/[1,2)</bundle>
> </feature>
> If a bundle within that range lies within the global/user Maven repo ".m2", the bundle
gets resolved.
> If it resides only within the "system" folder of Karaf I get an exception:
> {noformat}
> karaf@root()> org.apache.karaf.features.internal.util.MultiException: Error:
>         Error downloading mvn:de.some.api/api/[1,2)
>         at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:91)
>         at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72)
>         at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:457)
>         at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:452)
>         at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:224)
>         at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:388)
>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025)
>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
>         Suppressed: java.io.IOException: Error downloading mvn:de.some.api/api/[1,2)
>                 at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77)
>                 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>                 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>                 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
>                 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>                 ... 3 more
>         Caused by: java.io.IOException: Error resolving artifact de.some.api:api:[1,2)
>                 at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:729)
>                 at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:659)
>                 at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:600)
>                 at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:567)
>                 at org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:47)
>                 at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60)
>                 ... 7 more
>         Caused by: shaded.org.eclipse.aether.resolution.VersionRangeResolutionException:
No highest version found for de.some.api:api:[1,2)
>                 at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolveLatestVersionRange(AetherBasedResolver.java:998)
>                 at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:703)
>                 ... 12 more
> {noformat}
> Setting the property org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote = true as mentioned
in the mailing list does not help.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message