2010-09-29 35 views
1

我一直在我的grails项目中使用名为quartz-all-1.7.3的lib工作Quartz框架。Shiro插件与Grails中的Quartz框架冲突

现在我需要将shiro插件安装到我的项目中。所以,当我安装四郎插件到我的项目公司得到成功安装..

但同样,每当我遇到我的项目再次它给编译错误如下:

[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: 
    [groovyc] Compile error during compilation with javac. 
    [groovyc] ....scheduler\quartz\framework\CustomJDBCDelegate.java:46: com.securonix.application.scheduler.quartz.framework.CustomJDBCDelegate is not abstract and does not override abstract method updateSchedulerState(java.sql.Connection,java.lang.String,long,java.lang.String) in org.quartz.impl.jdbcjobstore.DriverDelegate 
    [groovyc] public class CustomJDBCDelegate implements DriverDelegate, StdJDBCConstants { 
    [groovyc]  ^

所以经过长期看对四郎插件我发现它与插件有一定的依赖关系。其中一个依赖项是shiro-quartz-1.0.0-incubating.jar。所以,现在里面这是我所看到的下面的代码行pom.xml文件:

<dependency> 
    <groupId>quartz</groupId> 
    <artifactId>quartz</artifactId> 
</dependency> 

根据我们的pom.xml的线,没有版本石英依赖标签,这意味着每当四郎越来越安装在我的项目,同时它正在用maven提取最新的石英库,即1.8.3。

而在quartz 1.8.3里面,CustomJDBCDelegate类的updateSchedulerState方法已从版本quarts 1.7.3更改。

所以现在问题是我不能在我现有的项目中更改quartz-all-1.7.3,并且想在我的项目中使用Shiro插件。

所以应该有一些解决方案,以便shiro应该得到quartz-1.7.3版本,而不是使用maven的最新版本。

任何帮助将高度赞赏...

谢谢...

回答

2

也许我得到这个错误,你的意思是这样的?:

<dependency> 
     <groupId>org.apache.shiro</groupId> 
     <artifactId>shiro-quartz</artifactId> 
     <version>1.0.0-incubating</version> 
     <exclusions> 
      <exclusion> 
       <groupId>quartz</groupId> 
       <artifactId>quartz</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>org.quartz-scheduler</groupId> 
     <artifactId>quartz</artifactId> 
     <version>1.7.3</version> 
    </dependency> 

然后$ mvn dependency:tree

[...]

[INFO] +- org.apache.shiro:shiro-quartz:jar:1.0.0-incubating:compile 
[INFO] | \- org.apache.shiro:shiro-core:jar:1.0.0-incubating:compile 
[INFO] |  +- org.slf4j:slf4j-api:jar:1.5.6:compile 
[INFO] |  \- commons-beanutils:commons-beanutils:jar:1.7.0:compile 
[INFO] \- org.quartz-scheduler:quartz:jar:1.7.3:compile 
[INFO] \- commons-logging:commons-logging:jar:1.1:compile 
[INFO]  +- log4j:log4j:jar:1.2.12:compile 
[INFO]  +- logkit:logkit:jar:1.0.1:compile 
[INFO]  \- avalon-framework:avalon-framework:jar:4.1.3:compile