---
title: "编译 Apache Karaf 2.2.9遇到找不到jar包问题的解决方案"
author: "fm2005"
date: "2012-09-04T07:33:00Z"
tags: []
slug: "apache-karaf-2-2-9-jar"
draft: false
lastmod: "2014-11-20T16:42:04Z"
id: 2158537
url: "https://okuc.iteye.com/blog/2158537"
---

1\. 找不到 org.eclipse:osgi:jar:3.6.2.R36x\_v20110210  
有两种解决方式：  
第一种：该jar包只在仓库[http://svn.apache.org/repos/asf/servicemix/m2-repo](http://svn.apache.org/repos/asf/servicemix/m2-repo) 提供，添加上该仓库即可。  
第二种：该jar包在仓库[http://repository.sonatype.org/content/groups/forge/](http://repository.sonatype.org/content/groups/forge/)也提供，不过坐标不同，需要把涉及POM的坐标更改为（大约需要更改两处）：

```
       <dependency>
                <groupId>org.sonatype.tycho</groupId>
                <artifactId>org.eclipse.osgi</artifactId>
                <version>${equinox.version}</version>
            </dependency>
```

注：原来的坐标是：

```
       <dependency>
                <groupId>org.eclipse</groupId>
                <artifactId>osgi</artifactId>
                <version>${equinox.version}</version>
            </dependency>
```

2、找不到biz.aQute:bndlib:jar:0.0.313

对于这个jar，在中央库中有它的最新版本，只需要改一下版本号就可以了。

```
<dependency>
<groupId>biz.aQute</groupId>
<artifactId>bndlib</artifactId>
<version>1.50.0</version>
</dependency>
```

只需要修改以上两处，即可构建成功。