Limit number of artifacts installed into .m2

We use the maven plugin to install our artifacts into a local .m2 repository. For some reason gradle (using 1.4) is starting to use a timestamp instead of the SNAPSHOT qualifier when installing the artifacts to the local .m2 repo. Eg:


instead of:


As a result one of our jenkins build nodes now have a .m2 repository containing 58 GB of data (only counting our own projects). What has caused this change in behavior and how do we fix it.

I can’t reproduce the behaviour you’re describing. Can you provide some more details about you’re environment? Which gradle version are you using? Did you add any customizations to the install task? Do you have custom settings in your settings.xml?

cheers, René

Hm seems to be a problem with the uploadArchives task.

I use gradle 1.4. I am building on windows/linux/ubuntu. I don’t have any settings.xml file (only used when building with maven I assume). No modification of the install task. I build with

gradle clean install uploadArchives


project.uploadArchives {
      repositories {
        mavenDeployer {
          repository(url: http://path-to-artifactory/libs-snapshot-local) {
            authentication(userName: 'admin', password: 'password')

If I remove uploadArchives if does not install multiple archives into .m2. Is this a bug in the uploadArchives task?

Hello, It’s a known issue, that the uploadArchives task also writes to the m2 repository. I havn’t found the according jira ticket yet.

Is there any workaround besides deleting each local .m2 on all slave each night? This is pretty much a breaking bug in our case since we rely 100% on integration with artifactory.

If you find the bug/jira ticket please post it.

I could not find it here (did a search for uploadArchives):

so I have created a new bug:

Any chance you can check if this is a regression from earlier behaviour, and in which version it broke? That information can be useful to other users, and may help track down a fix. Thanks.

If it works for you, the new ‘maven-publish’ plugin does not automatically install to ‘.m2’ when publishing. Although it is an incubating feature, it has good test coverage and works very well for many use cases.