Announcement Announcement Module
Collapse
No announcement yet.
Acegi dependencies in Maven Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Acegi dependencies in Maven

    I've been wondering how to configure the dependency management for my project when using Maven and Spring.

    This is my configuration:
    Code:
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring</artifactId>
      <version>2.0.2</version>
    </dependency>
    <dependency>
      <groupId>org.acegisecurity</groupId>
      <artifactId>acegi-security</artifactId>
      <version>1.0.3</version> 
    </dependency>
    But when using this configuration, Acegi will download a bunch of spring-1.2.8 jars by itself separately. How can I configure both properly?

  • #2
    You'll probably have to look into Maven's "exclusions" mechanism:


    http://maven.apache.org/pom.html#Exclusions

    http://docs.codehaus.org/display/MAV...cies+Filtering

    Comment


    • #3
      I could take that approach, but don't know if this is a viable solution. It seems to me that acegi just has too many dependencies, even to libs I don't use. I prefer convention over configuration, and when I need those extra libs I would include them.

      When will acegi be moving to the Spring core libraries? Or isn't this what is going to happen when moving to "Spring Security"

      Comment


      • #4
        I think 1.1 will require Spring 2.0.

        What happens if you just exclude the transitive Spring 1.2.8 dependency from Acegi? Isn't that sufficient?

        Comment


        • #5
          It works.. but there is no dependency to the all-containing spring-1.2.8.jar, instead to all modules independently... so my exclusion list will be long

          But hey, if this is the only way.. it is the only way

          Comment


          • #6
            You could also just create your own "acegi-spring-2-1.0.3" artifact in your maven repo, copy the existing acegi-1.0.3 and edit the acegi pom.xml to point to spring 2.

            Comment


            • #7
              Here is what got my tests to pass. I have a feeling it'll come back to haunt me though.

              Code:
                  <dependency>
                    <artifactId>acegi-security</artifactId>
                    <groupId>org.acegisecurity</groupId>
                    <version>1.0.3</version>
                    <exclusions>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-aop</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-beans</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-context</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-core</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-dao</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-jdbc</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-mock</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-remoting</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-support</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-web</artifactId>
                      </exclusion>
                      <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-webmvc</artifactId>
                      </exclusion>
                    </exclusions>
                  </dependency>

              Comment

              Working...
              X