Casey Jordan
Casey Jordan

Reputation: 1254

How do I clear teamcity's maven dependency repository/cache

I have a teamcity server and I have maven dependencies which have changed but who's versions have not changed. From what I can tell this is causing my build to fail because teamcity is not updating these dependencies.

So I need to know how to clear out teamcity's maven dependency cache for my project. I looked through the documentation and didn't find anything significant.

Thanks!

Upvotes: 2

Views: 6615

Answers (4)

Anu Shibin Joseph Raj
Anu Shibin Joseph Raj

Reputation: 1047

Found mine at /opt/buildagent/system/jetbrains.maven.runner/maven.repo.local.

Upvotes: 1

Lubos Prague
Lubos Prague

Reputation: 101

You can actually go to Version Control Settings and there is a checkbox "Delete all files in the checkout directory before the build".

Upvotes: 0

Shani Elharrar
Shani Elharrar

Reputation: 657

I found mine in /opt/TeamCity/buildAgent/system/sbt_ivy/cache/, But if you can SSH to your machine, just run sudo find / -name "sbt_ivy" and you'll see the address of ivy in your machine (if you use SBT as I do)

Upvotes: 0

Will Keeling
Will Keeling

Reputation: 23004

Rather than trying to manually clear the local Maven repository on the server running Teamcity, it may be easier to force an update of the Maven dependencies in the Teamcity settings.

To do this, edit the settings for the Teamcity project (in the Teamcity frontend select the project and then select the 'Settings' tab). Next click the 'Edit Configuration Settings' link (top right) and then click the 'Build Steps' link on the right hand side. In here, edit the step responsible for compiling the code. On this form, in the 'Goals' field, add the argument -U (that's an uppercase 'U').

Save the settings and kick off a new build. That extra argument will force Maven to go and update its dependencies.

Going forward, if the dependencies are changing but their versions are not, you may be better to have their versions set as SNAPSHOT. See What exactly is a Maven Snapshot and why do we need it?

Upvotes: 3

Related Questions