Wednesday, April 29, 2009

Managing dependencies with Spring 3.0 M2 and DataNucleus

ASM this library is major p.i.t.a cause releases aren't backwards compatible, and is done for the performance improvements. Spring doesn't plan to upgrade as from this post and this post but instead will reference a packaged version of asm, due to release with Spring 3.0 M3 . This is all part of the cost of working with milestones.

Google app engine / java uses Data Nucleus to enhance class files for persistence and relies on asm 3.1. Currently I am using the maven-datanucleus-plugin to enhance my class files. With maven I couldn't figure out how to include both libraries. The solution was to define the asm 2.3.2 libraries with scope runtime, and change ant-macros.xml file to not failonerror to false. I haven't tested on gae/j itself and just hosted mode, and this seemed to work. Also I had to define the datanucleus-core dependency as runtime scope as well, because the plugin requires 1.1.2, and gae only works with 1.1.1 now.

3 comments:

  1. This is all you need.

    <dependency>
    <groupId>org.objectweb.asm</groupId>
    <artifactId>com.springsource.org.objectweb.asm</artifactId>
    <version>2.2.3</version>
    </dependency>
    <dependency>
    <groupId>asm</groupId>
    <artifactId>asm-commons</artifactId>
    <version>3.1</version>
    <exclusions>
    <exclusion>
    <groupId>asm</groupId>
    <artifactId>asm</artifactId>
    </exclusion>
    </exclusions>
    </dependency>

    ReplyDelete
  2. Spring Framework is suited to a wide variety of architectures, and can be utilised in discrete parts of a system, as well as across the whole system. Let's give an example where we want to use Spring for the business and data access tiers of a system. This is performed via an XML configuration file. There are many ways you can utilise Spring in this respect. Here's our definition using what is typically the simplest pattern. This file is used to create an ApplicationContext which loads all of these beans at startup automatically.

    ReplyDelete