Archive for the 'Spring' Category

Sep 06 2009

Want to use Spring 3.0 milestone release from Maven?

Published by michael under Java, Maven, Spring

I wanted to add the Spring 3.0 M4 milestone early access release to a Maven project to test out some of the new features. However SpringĀ  milestone releases are not readily available in the standard public Maven repositories, so what do you do?

For the full explanation check out the link to “Spring/Maven Repositories” link in the bottom. For a quick 1-2-3 step solution add this to the <repositories> section in your Maven pom.xml file so that Maven can find Spring’s early access milestone releases:

<repository>
  <id>spring-milestone</id>
  <name>Spring Portfolio Milestone Repository</name>
  <url>http://s3.amazonaws.com/maven.springframework.org/milestone</url>
</repository>
You can then add Spring 3.0 M4 as a dependency in your pom.xml file:
<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-core</artifactId>
  <packaging>jar</packaging>
  <version>3.0.0.M4</version>
</dependency>
If you’re looking for other Spring artifacts you can browse them using this Spring Maven artifact URL

This Spring article has additional details on this topic e.gĀ  how to access snapshot releases:

Spring/Maven Repositories

No responses yet

Aug 26 2009

Spring XML and defining end of line characters in a bean property

Published by michael under Java, Spring, XML

If you need to define and end of line character (EOL) like \n in your Spring XML files in a bean property you can’t do this

<bean id="some-bean-id" class="some-class">
    <property name="my-property-name" value="\n"/>
</bean>

This simply wont work. You’ll end up with a backslash followed by the letter n. What you have to do is to use an escape character like this

<bean id="some-bean-id">
    <property name="my-property-name" value="&#10;"/>
</bean>

No responses yet