Maven extensions not being picked up by TeamCity build agents


I am part of a team that uses TeamCity as CI server for our maven based projects. Recently we wanted to profile a slow build and decided to use a maven extension: tesla-profiler. To enable the extension you just need to copy the extension jar into the  M2_HOME/lib/ext directory.

All works ok on our local machines, but when run our build on teamcity agents, we see no output from tesla profiler. The extension is copied to the correct folder on the maven location used by the agent. Since we were not sure what was happening, we added more output to the tesla-profiler and noticed that its constructor is not even called when maven is invoked by the TeamCity build agent.

This is why I would like to know  how can I enable the teamcity agent to pick up the extension from the standard directory, M2_HOME/lib/ext.

Thank you!

Best Regards,


1 comment
Comment actions Permalink


Effective M2_HOME value for the build can be found in Teamcity build logs. Look for lines strating with 'Current M2_HOME'

If this does not help, please add '-X' in "Additional Maven commandline parameters" field and try to run build with an extention. Then post the resulting build log there.


Please sign in to leave a comment.