Announcement Announcement Module
Collapse
No announcement yet.
Acegy + Spring 2.0 and Maven Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    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...

    Comment


    • #3
      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

      Comment

      Working...
      X