Artifactory Snapshot Image File Processing

In our art, we have a snapshot repository designed to handle a maximum of 5 unique snapshots. We added the -SNAPSHOT extension to the file name. SNAPSHOT is also converted to a timestamp. The build is done using gradle, and the artifact is published with a bamboo and artificial plugin.

File deployed to artifactory ...

inhouse-snapshots:com/example/project/subproject/trunk-SNAPSHOT/subproject-trunk-SNAPSHOT-79.amp

becomes ...

inhouse-snapshots:com/example/project/subproject/trunk-SNAPSHOT/subproject-trunk-20120321.154621-1-79.amp

This is fine, and each assembly adds a new file with an assembly extension number, but the timestamp number always remains in the list 20120321.154621-1, so we have a list of files, for example:

  • subproject-negotiation 20120321.154621-1-79.amp
  • subproject-negotiation 20120321.154621-1-80.amp
  • subproject-negotiation 20120321.154621-1-81.amp

- ?

+5
2

, , , ; , Maven .

Artifactory "" "" ""; , Artifactory "" :

  • : ( ), POM, ( ); , POM, ""; , .

  • , "build.timestamp" ; "".

, "build.timestamp" ( Artifactory "" ) .

+9

: https://discuss.gradle.org/t/2-8-2-9-mavendeployer-doesnt-honour-uniqueversion-false-in-maven-uploadarchives/13370/8 , , - . , . , api jar, source jar, api source jar main jar SNAPSHOT. , , build.timestamp .

task apiJar(type: Jar) {
    classifier = 'api'
    from(sourceSets.main.output) {
        include "com/company/app/dto/**"
    }
}

task sourceJar(type: Jar, dependsOn: classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

task apiSourceJar(type: Jar, dependsOn: classes) {
    classifier = 'api-sources'
    from(sourceSets.main.allSource) {
        include "com/company/app/dto/**"
    }
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java
            pom.withXml {
                asNode().appendNode('description', 'APP Sprint Boot App')
            }
            artifact apiJar
            artifact sourceJar
            artifact apiSourceJar
        }
    }
    repositories {
        maven {
            credentials {
                username = 'username'
                password = 'password'
            }
            if(project.version.endsWith('-SNAPSHOT')) {
                url "http://server:9081/artifactory/libs-snapshot-local"
            } else {
                url "http://server:9081/artifactory/libs-release-local"
            }
        }
    }
}
0

All Articles