04 February 2009

I published an article on Infoq.com recently. The code was sound but it used the cock-a-many OSGi friendly Maven jar dependencies that were being provided off the Spring Source Maven repository. The problem was that these jars were custom to SpringSource's build of the product. If you had an existing Spring application and then you introduced the Spring Integration jars it would bring down a different set of jars -- possibily conflicting with your existing jars' classes. It wasn't addressable using Maven's dependencyManagement element either, as the artifactIds were different. A bug was filed. Finally - and regretfully after the article was beyond my editorial control - the correct jars are in the public Maven repository using the correct for the Spring Framework proper.

What follows is my sample POM for another project. Use it at your discretion. Please note that in this case <spring.version> is 2.5.6 and <spring.integration.version> is 1.0.1.RELEASE. That updated version is the release that contains the corrected revisions. Upgrade time!

    <dependencies>
             <dependency>
                 <groupId>log4j</groupId>
                 <artifactId>log4j</artifactId>
                 <version>1.2.14</version>
             </dependency>
             <!-- COMMONS STUFF -->
             <dependency>
                 <groupId>commons-lang</groupId>
                 <artifactId>commons-lang</artifactId>
                 <version>2.2</version>
             </dependency>
             <dependency>
                 <groupId>commons-io</groupId>
                 <artifactId>commons-io</artifactId>
                 <version>1.1</version>
             </dependency>
             <dependency>
                 <groupId>commons-collections</groupId>
                 <artifactId>commons-collections</artifactId>
                 <version>3.2</version>
             </dependency>
             <dependency>
                 <groupId>commons-beanutils</groupId>
                 <artifactId>commons-beanutils</artifactId>
                 <version>1.7.0</version>
             </dependency>
             <!-- SPRING FRAMEWORK -->
             <dependency>
                 <groupId>org.springframework</groupId>
                 <artifactId>spring-context</artifactId>
                 <version>${spring.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.springframework</groupId>
                 <artifactId>spring-webmvc</artifactId>
                 <version>${spring.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.springframework</groupId>
                 <artifactId>spring-context-support</artifactId>
                 <version>${spring.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.springframework</groupId>
                 <artifactId>spring-core</artifactId>
                 <version>${spring.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.springframework</groupId>
                 <artifactId>spring-aop</artifactId>
                 <version>${spring.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.springframework</groupId>
                 <artifactId>spring-aspects</artifactId>
                 <version>${spring.version}</version>
             </dependency>
 	  		<dependency>
 				<groupId>org.springframework.integration</groupId>
 				<artifactId>spring-integration-core</artifactId>
 				<version>${spring.integration.version}</version>
 			</dependency>
 			<dependency>
 				<groupId>org.springframework.integration</groupId>
 				<artifactId>spring-integration-httpinvoker</artifactId>
 				<version>${spring.integration.version}</version>
 			</dependency>
 			<dependency>
 				<groupId>org.springframework.integration</groupId>
 				<artifactId>spring-integration-file</artifactId>
 				<version>${spring.integration.version}</version>
 			</dependency>
 			<dependency>
 				<groupId>org.springframework.integration</groupId>
 				<artifactId>spring-integration-jms</artifactId>
 				<version>${spring.integration.version}</version>
 			</dependency>
 			<dependency>
 				<groupId>org.springframework.integration</groupId>
 				<artifactId>spring-integration-adapter</artifactId>
 				<version>${spring.integration.version}</version>
 			</dependency>
        </dependencies>