I want to set up each TeamCity agent to use a local repository (maven.repo.local) in the agent's working directory (agent.work.dir). Is it possible to configure maven properties to use TeamCity properties in this way?
Enter -Dmaven.repo.local=%system.agent.work.dir%/.m2
for the setting Runner: Maven2
/ JVM command line parameters
I don't use TeamCity, but Bamboo. The way I do this is for the maven goals, I have this defined:
-Dmaven.repo.local=${bamboo.M2REPOHOME}/${bamboo.buildKey} ...
Then the property M2REPOHOME is defined to be someplace on the filesystem, and bamboo.buildKey is the project name. I keep my m2 repositories all in one spot so I can easily nuke them. You should probably do something similar by setting maven.repo.local
to the value of agent.work.dir
, or someplace else. Quickly looking at the TeamCity docs, it looks like you would do something like this:
-Dmaven.repo.local=%agent.work.dir%/m2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With