title: How to upload snapshot versions of a build artifact to gradle repository in Artifactory
body: <p>I am using the Jenkins-Artifactory plugin to deploy a jar file to a repo in Artifactory. Build tool being used is gradle. The process does not seem to maintain multiple timestamped versions of the jar artifact.</p>
  
  <p>The repository uses 'gradle-default' layout.
  Maven snapshot version behavior has been set to 'Unique'. 
  Max unique snapshots set to 30.</p>
  
  <p>I am using rtUpload and rtPublishBuildInfo to upload the jar and corresponding buildinfo to Artifactory.</p>
  
  <p>I see multiple versions of buildinfo under 'artifactory-build-info' repository in format BUILDNUMBER_TIMESTAMP.json
  However the application jar is being overwritten every time with name as appname-VERSION.jar, thus keeping only the latest version in repo.</p>
  
  <p>I have tried changing Maven snapshot version behavior to 'Non-Unique' and adding 'SNAPSHOT' to version string. This did not resolve the issue</p>
  
  <p>pipeline code for uploading artifacts</p>
  
  <pre><code>// upload build artifacts to artifact repository
          stage('publish to artifactory') {
            steps {
              rtUpload (
                  serverId: "ARTIFACTORY_SERVER_ID",
                  spec:
                    """{
                      "files": [
                        {
                          "pattern": "kotlin-source/build/libs/appname-*.jar",
                          "target": "gradle-dev-local"
                        }
                      ]
                    }""",
                  failNoOp: true,
              )
            }
          }
          stage ('Publish build info') {
             steps {
                rtPublishBuildInfo (
                  serverId: "ARTIFACTORY_SERVER_ID",
                 )
             }
          }
  </code></pre>
  
  <p>expected multiple artifacts to be present in the repo with timestamp appended to the name.
  Only a single jar is seen under the repo.
  After the artifact is published, existing jar in the repo is moved to Trash Can</p>