Acegy + Spring 2.0 and Maven[摘]

http://forum.springframework.org/archive/index.php/t-30042.html

View Full Version : Acegy + Spring 2.0 and Maven


akakunin
10-09-2006, 11:48 AM
I'm trying to build project with Acegy 1.0.1 and Spring 2.0 with using Maven.

Problem is that acegy in maven repository has dependency to spring-hibernate-1.2.7 (and some other packages from 1.x branch). But, since I'm using Spring 2.0 I do not need them.

Before 2.0 release (last version I used was 2.0 rc3) it is not caused problems.
But after upgrade to 2.0 final I've got followed problem:

since both jars (spring-2.0 & spring-hibernate-1.2.7) is included into project then I'm creating hibernate session bean class org.springframework.orm.hibernate3.LocalSessionFac toryBean got from spring-hibernate-1.2.7 jar, but inherited it from AbstractSessionFactoryBean from spring-2.0. As result I have many very strange bugs.

Does anybody know solution?
Thank you

kantorn
10-09-2006, 04:39 PM
Hi

I have had problems of the same kind.
I'm using Maven2, and here's my solution:
In your dependency declarations in Maven pom.xml, type something like (my working setup example)

<dependency>
<groupId>org.acegisecurity</groupId>
<artifactId>acegi-security</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-remoting</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-support</artifactId>
</exclusion>
</exclusions>
</dependency>

That should leave the Acegi transitive dependencies out of your build.
I must say I'm somewhat surprised at Acegi beeing dependent on old stuff... ;)

akakunin
10-10-2006, 03:43 PM
Thank you very much.

In my case your suggestion helps me to remove unused dependencies from project.

I think dependency from old Spring is not problem of acegi, but problem of maven: acegi (as I know) can work with Spring 1.x as well as with spring 2.0
So, in maven dependencies minimal dependency is declared for acegi. But maven has no any feature like depricated (like including spring 2.0 makes any libraries from spring 1.x depricated).

But anyway, in my case it was not an issue of my problem: I found real source (http://forum.springframework.org/showthread.php?p=80602) in hibernate configuration :)
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值