2015-07-13 66 views
5

我正在我的AEM环境中安装一个OSGi软件包作为jar。CQ5 OSGi软件包错误 - org.json.simple - 无法解析

在此期间,我在安装包后,出现以下错误:

org.json.simple -- Cannot be resolved 

我已经宣布在Maven的依赖和我的程序在本地运行正常。

我Maven的依赖性如下:

<dependency> 
    <groupId>com.googlecode.json-simple</groupId> 
    <artifactId>json-simple</artifactId> 
    <version>1.1</version> 
</dependency> 

我是否需要添加任何依赖关系来解决这个错误吗? 我对maven比较陌生,这是我正在开发的第一个包。

+0

可能重复的一些传递依赖不活跃(CQ5 Maven项目)WHY ?](http://stackoverflow.com/questions/29912636/osgi-bundle-status-is-not-active-cq5-maven-project-why) – santiagozky

+0

Maven只会帮助你建立捆绑,它不会照顾将您的依赖关系部署到OSGi容器中。这已在之前讨论过,请查看http://stackoverflow.com/questions/29912636/osgi-bundle-status-is-not-active-cq5-maven-project-why/29937645#29937645 – santiagozky

回答

3

改变你的Maven束配置

<plugin> 
       <groupId>org.apache.felix</groupId> 
       <artifactId>maven-bundle-plugin</artifactId> 
       <version>2.3.7</version> 
       <configuration> 
        <instructions> 

         <Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency> 
         <Embed-Transitive>true</Embed-Transitive> 

        </instructions> 
       </configuration> 

      </plugin> 

有它需要应该得到固定的代码上面的[OSGi包状态