I encountered this error while setting up a continous build system using the Bamboo system from Atlassian Software. Setting up Bamboo was not difficult at all. However, this problem occurred when I attempted to add a Maven2 project. If you are not familiar with Maven2, it is a build system for java web applications. When doing java web applications, most people either use ANT or Maven2 as the build tool. Anyways, I set up a valid project with a working pom.xml file, proper artifacts, struts framework, and the application builds and runs perfectly on my local machine. I even added some Test Cases so as to make certain the build server properly invoked the test cases. I added the project to subversion and attempted to add the project to the Bamboo continuous build server. Unfortuneatly, when I sumbitted the project, I was immediately handed a stack trace.
java.lang.IllegalArgumentException: When not aligning with a user install you must specify a local repository location using the setLocalRepositoryDirectory( File ) method.
at org.apache.maven.embedder.MavenEmbedder.createMavenSettings(MavenEmbedder.java:699)
at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:628)
at com.atlassian.bamboo.ww2.actions.admin.ImportMavenPlanCheckoutPomAction.parsePom(ImportMavenPlanCheckoutPomAction.java:219)
at com.atlassian.bamboo.ww2.actions.admin.ImportMavenPlanCheckoutPomAction.doExecute(ImportMavenPlanCheckoutPomAction.java:118)
at com.atlassian.bamboo.ww2.BambooActionSupport.execute(BambooActionSupport.java:705)
……..
As I searched for the solution to the problem, it appeared that this problem had been reported quite commonly to the Maven team – However, getting the details on how to fix it were not offered. The solution was rather simple.
MAVEN2 needed to be installed on the Linux server running the Tomcat instance with the Bamboo application. The M2_HOME and M2 path variables also needed to be set on the server.
One last thing to check on the Bamboo application is to make certain you have established a builder that works. The default Maven2 builder in Bamboo may not have the same path as the one you have installed. So you may have to specify your own builder to match the path of your Maven installation.

Once I had taken these steps, the Bamboo application no longer threw that stack trace and I was able to complete the installation of the project to the continuous build system.