2012-09-10 49 views
0

我只是说相关性日食BIRT到我的项目现在很奇怪的故障发生:冲突的依赖在德比与Maven 3

java.lang.SecurityException: sealing violation: package org.apache.derby.impl.store.raw.xact is sealed 

在集成测试或

java.sql.SQLException: Catalogs at version level 'null' cannot be upgraded to version level '10.5'. 
ERROR XCL20: Catalogs at version level 'null' cannot be upgraded to version level '10.5'. 

google搜索第一点德比可能存在的依赖关系冲突。

mvn dependency:list 

证明了这一点。 birt需要德比10.5,我们的一个罐子需要10.8。所以德比依赖性都是传递性的(birts依赖性更加间接 - 树中更深一层)。

如何解决这个/这样的冲突?

(改变POM的顺序并不帮助)

在同时

我由丹·马修斯 - 灌浆尝试了答案 - 现在的作品

 <dependency> 
     <groupId>de.stalabw</groupId> 
     <artifactId>charts</artifactId> 
     <version>0.0.2</version> 
     <exclusions> 
      <exclusion> 
       <!-- does not work<groupId>org.apache.derby</groupId> but this:--> 
       <groupId>org.eclipse.birt.runtime.3_7_1</groupId> 
       <artifactId>derby</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

的错误是一样的, “mvn依赖:列表”没有改变。依赖IST charts-> birt->德比 树的相关部分:使用

+- <myPackage.myProject>:metaDataService:jar:1.8.0:compile 
| +- org.apache.derby:derby:jar:10.8.1.2:compile 
... 
\- <myPackage>:charts:jar:0.0.2:compile 
    \- org.eclipse.birt.runtime:org.eclipse.birt.runtime:jar:4.2.0:compile 
     ... 
     +- org.eclipse.birt.runtime.3_7_1:derby:jar:10.5.1000001:compile 

回答

2

您可以从其中一个条目排除传递依赖:

<dependency> 
    <groupId>sample.ProjectA</groupId> 
    <artifactId>Project-A</artifactId> 
    <version>1.0</version> 
    <scope>compile</scope> 
    <exclusions> 
    <exclusion> <!-- declare the exclusion here --> 
     <groupId>sample.ProjectB</groupId> 
     <artifactId>Project-B</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 

http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

+0

没有按”工作看到我的答案除了 – dermoritz