Maven failsafe plugin UTF-8 Issues on Bamboo remote agent


We are experiencing a problem where our Bamboo remote agent discards the UTF-8 file encoding we set in the wrapper config and the maven pom file configuration. Strangely this does not happen on the Bamboo Server's local agent.

Our build uses maven failsafe plugin to run integration tests: launches a jboss instance, deploys the war file and imports UTF-8 encoded files onto a mysql server.

The builds were working fine locally but when we tried to run them on Bamboo (4.4.5) the integration tests failed. The test were showing the following error

java.lang.AssertionError: expected:<��2002 - 2004 College of American Pathologists> but was:<??2002 - 2004 College of American Pathologists>
	at org.testng.Assert.failNotEquals(
	at org.testng.Assert.assertEquals(
	at org.testng.Assert.assertEquals(
	at org.testng.Assert.assertEquals(
(7 more lines...)

After hours of debugging and googling we narrowed it down to the Bamboo agent being the cause. We managed to fix the problem on the Bamboo Server's local agent with the -Dfile.encoding wrapper.conf modification but this does not seem to work for the remote agent (which is a Fedora 13 machine with UTF-8 default system character set).

We have tried everything to rectify the problem:
  • Set -Dfile.encoding=UTF-8 in the server's and the agent's wrapper.conf
  • Set -Dfile.encoding=UTF-8 in the pom for the maven-failsafe-plugin's <argLine> configuration
  • Set <file.encoding>UTF-8</file.encoding> in the pom for the maven-failsafe-plugin's <SystemPropertyVariables> configuration
  • Set and project.reporting.outputEncoding properties to UTF-8 in the pom file (This got rid of the maven-failsafe-plugin's warning "File encoding has not been set, using platform encoding..."
When we check the running processes on the remote agent during a build we can see the JVMs are getting the correct command line passed onto them:

[root@buildagent3 init.d]# ps -ef | grep bamb root 27132 1 0 13:10 pts/2 00:00:01 /opt/jdk1.7.0_21/bin/java -Dfile.encoding=UTF-8 -Dbamboo.home=/bamboo-agent-lingo -jar /bamboo-agent-lingo/atlassian-bamboo-agent-installer-4.4.5.jar http://bamboo-lingo.cti/agentServer/ root 27151 27132 0 13:10 pts/2 00:00:00 /bin/sh /bamboo-agent-lingo/bin/ console root 27193 27151 0 13:10 pts/2 00:00:00 /bamboo-agent-lingo/bin/./wrapper /bamboo-agent-lingo/bin/../conf/wrapper.conf wrapper.syslog.ident=bamboo-agent wrapper.pidfile=/bamboo-agent-lingo/bin/./ wrapper.lockfile=/var/lock/subsys/bamboo-agent root 27195 27193 1 13:10 pts/2 00:00:20 java -Dbamboo.home=/bamboo-agent-lingo -Dbamboo.agent.ignoreServerCertName=false -Dfile.encoding=UTF-8 -Xms256m -Xmx512m -Djava.library.path=../lib -classpath ../lib/wrapper.jar:../lib/bamboo-agent-bootstrap.jar -Dwrapper.key=oiO0K17PRrqae88Z -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.version=3.2.3-atlassian-1 -Dwrapper.native_library=wrapper -Dwrapper.disable_shutdown_hook=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp com.atlassian.bamboo.agent.bootstrap.AgentBootstrap http://bamboo-lingo.cti/agentServer/ root 30328 30277 0 13:35 pts/2 00:00:00 /bin/sh -c cd /bamboo-agent-lingo/xml-data/build-dir/LINGO-LINBUILD-INTTEST/war && /opt/jdk1.7.0_21/jre/bin/java -Dfile.encoding=UTF-8 -jar /bamboo-agent-lingo/xml-data/build-dir/LINGO-LINBUILD-INTTEST/war/target/surefire/surefirebooter1374506468386799813.jar /bamboo-agent-lingo/xml-data/build-dir/LINGO-LINBUILD-INTTEST/war/target/surefire/surefire4236449812974687070tmp /bamboo-agent-lingo/xml-data/build-dir/LINGO-LINBUILD-INTTEST/war/target/surefire/surefire_0723920899163737948tmp root 30329 30328 31 13:35 pts/2 00:00:01 /opt/jdk1.7.0_21/jre/bin/java -Dfile.encoding=UTF-8 -jar /bamboo-agent-lingo/xml-data/build-dir/LINGO-LINBUILD-INTTEST/war/target/surefire/surefirebooter1374506468386799813.jar /bamboo-agent-lingo/xml-data/build-dir/LINGO-LINBUILD-INTTEST/war/target/surefire/surefire4236449812974687070tmp /bamboo-agent-lingo/xml-data/build-dir/LINGO-LINBUILD-INTTEST/war/target/surefire/surefire_0723920899163737948tmp root 30461 13348 0 13:36 pts/2 00:00:00 grep bamb

It would be great if you could help with this issue.

Thank you.

1 answer

1 accepted

0 votes
Accepted answer

The problem seems to be fixed either by

export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" in /etc/profile after a reboot

(took the solution from

or the re-setting of -Dfile.encoding to UTF8 instead of UTF-8 everywhere.

I will leave my settings as they are so I'm not going to test what really fixed the issue :-)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

175 views 4 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you