0
votes

Asking as a relative newbie to repo terminology and semantics: I have a gradle project that builds a Spring-Boot jar file, and then runs an InstallAnywhere project file to package the jar as an installer for a Windows service. I need to publish the executable installer as a SNAPSHOT. I am using the gradle artifactory plugin (not the artifactory-publish plugin, only because I'm following the example of sister project).

The artifact is being published to the Maven snapshot repo, but the "-SNAPSHOT" placeholder is not being replaced by a timestamp. When I add the original Jar file to the artifacts to publish, the Jar file gets a timestamp added, but the .exe still does not. Relevant gradle code follows, and project version is set to "1.0.0-SNAPSHOT" in gradle.properties, along with other shown artifactory configuration properties:

task buildInstaller {
    inputs.files cleanJarName.outputs
    outputs.file installerFile
    doLast {
        project.exec {
            workingDir 'InstallKit'
            commandLine "${System.env.INSTALLANYWHERE_HOME}\\build.exe", 'MyInstallAnywhereProject.iap_xml', '-nupd'
        }
    }
}

artifactoryPublish {
    dependsOn buildInstaller
}

configurations {
    published
}

artifacts {
    published installerFile
}

artifactory {
    contextUrl = project.artifactoryContextUrl
    publish {
        repository {
            repoKey  = project.artifactoryPublishRepo
            username = project.artifactoryUser
            password = project.artifactoryPassword
        }
        defaults {
            publishConfigs('published')
            publishBuildInfo = true
            publishArtifacts = true
            publishPom = true
            publishIvy = true
        }
    }
    resolve {
        repository {
            repoKey  = project.artifactoryResolveRepo
            username = project.artifactoryUser
            password = project.artifactoryPassword
            maven=true
        }
    }
}

So why won't Artifactory properly snapshot an .exe? We were going to see if it was a limitation of Maven repos only handling Java-related types (jar, war, ear, etc.). So we looked at creating another Artifactory repo for binary snapshots using the generic(?) repo type, but the configuration screens do not offer the snapshot options present in the Maven repo configuration.

1

1 Answers

1
votes

SNAPSHOT (actually Integration Revision) terminology is mandated by repository layouts.

Since Artifactory enforces single-typed repositories you are correct that a Maven repo will not handle the versioning of an .exe file.

Using a generic repo is the correct path to take - but you need to define your own folder and file integration revision to have Artifactory pick up on it.