Tarjei Huse wrote:
> Hi, I'm trying to use CXF with Maven and Spring 2.5.5.
>
> My problem is that the CXF poms depend on Spring 2.0.8 resulting in the
> following error when I try to write tests:
>
> org.apache.maven.surefire.booter.SurefireExecutionException:
> org/springframework/core/AliasRegistry; nested exception is
> java.lang.NoClassDefFoundError: org/springframework/core/AliasRegistry
> java.lang.NoClassDefFoundError: org/springframework/core/AliasRegistry
>
> My question is:
>
> Does anyone know how I can configure Maven to override the spring
> dependencies so that CXF will use 2.5.5 instead of 2.0.8?
>
> Or, do I have to rip out maven and use ant so that I can have local libs
> instead?
>   

Ok, this is what I ended up with:
   <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-api</artifactId>
      <version>2.1.2</version>
            <exclusions>
          <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-web</artifactId>
          </exclusion>
      </exclusions>

    </dependency>

I had to add this exclusion to every cxf dependency. It seems to work
for now. Maybe something for the FAQ?

Regards,
Tarjei


> kind regards,
> Tarjei
>   

Reply via email to