Domain properties in Glassfish

You can make properties files available to you WAR and EAR applications by putting the file in the folder glassfish/domains/${}/lib/classes

You can use these in your spring configuration by prefixing the resource name with classpath:. For example:

<beans:bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <beans:property name="location" value=""/>

Configuration Properties in Spring

Make configuration properties from a properties file available in a Spring context

<bean id="propertyPlaceholderConfigurer"
   <property name="locations">

m2eclipse and separate output folders

The recent versions of m2eclipse (> 0.9.3) are a nightmare to get working. The biggest issues is that if you run a command line build whilst eclipse is working, one or the other will get totally borked. there is a section in the FAQ describing how to use separate output folders. Essentially you have to tell eclipse to use a certain maven profile, which changes your project configuration.

The instructions almost work. However, some plugins need the variable (for example for code-generation) to be set, and the FAQ does not achieve that.

Ordinarily you would have to specify the directory element in the build section:


If you do this however, anything you launch in eclipse will not have the correct classpath. You must fully specify the output directories:


I assume this is because m2eclipse is doing some kind of parsing of the pom.xml

Maven Default Execution Ids

Maven execution IDs have changed in maven versions greater than 2.2.0.

It seems that you can disable a default a default execution by binding it to the phase “none”:


Linked Folders in Eclipse

In your .project file:


Following Redirects in Jersey REST Client

There is a method in com.sun.jersey.api.client.Client that causes the Client to follow any redirections:

  * Set if redirection should be performed or not.
  * This method is the functional equivalent to setting the property
  * {@link ClientConfig#PROPERTY_FOLLOW_REDIRECTS} on the property bag
  * returned from {@link #getProperties}
  * @param redirect if true then the client will automatically redirect
  *        to the URI declared in 3xx responses.
 void setFollowRedirects(Boolean redirect)