Skip to content

Support -SNAPSHOT deployment #21

@vlsi

Description

@vlsi

Expected and Results

Central Portal expects -SNAPSHOT in file names while Gradle generates timestamp-based versions.

The error is as follows

47 failed Component Validations

pkg:maven/org.qubership.profiler/plugin-generator@1.0.0-SNAPSHOT
33
File name 'plugin-generator-1.0.0-20250418.152138-1-javadoc.jar' is not valid
File name 'plugin-generator-1.0.0-20250418.152138-1-javadoc.jar.md5' is not valid
File name 'plugin-generator-1.0.0-20250418.152138-1-javadoc.jar.sha1' is not valid
File name 'plugin-generator-1.0.0-20250418.152138-1-javadoc.jar.sha256' is not valid
File name 'plugin-generator-1.0.0-20250418.152138-1-javadoc.jar.sha512' is not valid

The following workaround helps (it renames timestamp-based files to -SNAPSHOT), however, it would be great if the plugin generated the proper archives in the first place

if (project.version.toString().endsWith("-SNAPSHOT")) {
    val snapshotRe = Regex("20[0-9]{6}.[0-9]{6}-[0-9]+")
    tasks.withType<Zip>()
        .matching { it.name.startsWith("zip") && it.name.endsWith("Publication") }
        .configureEach {
            rename {
                it.replace(snapshotRe, "SNAPSHOT")
            }
        }
}

Related environent and versions

No response

Reproduction steps

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions