Results 1 to 3 of 3

Thread: Acegy + Spring 2.0 and Maven

  1. #1
    Join Date
    Apr 2006
    Location
    Saint-Petersburg, Russia
    Posts
    50

    Default Acegy + Spring 2.0 and Maven

    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
    With best regards,
    Alexey Kakunin
    EmForge: Liferay based project hosting service

  2. #2
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    466

    Default

    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)
    Code:
    <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...
    Sincerely,
    /The Cantor

    "Murphy was an optimist"
    (The O'Toole commentary on Murphy's Law)

  3. #3
    Join Date
    Apr 2006
    Location
    Saint-Petersburg, Russia
    Posts
    50

    Thumbs up Thank you

    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
    With best regards,
    Alexey Kakunin
    EmForge: Liferay based project hosting service

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •