[HAP-639] Possible to release Maven project with snapshot dependencies when versions are defined as properties Created: 25/Sep/15  Updated: 14/Nov/17  Resolved: 08/Jun/16

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: Release Management
Affects Version/s: 2.3.1
Fix Version/s: 2.5.0

Type: Bug Priority: Blocker
Reporter: Christoffer Kylvåg Assignee: Tamir Hadad
Resolution: Fixed Votes: 2
Labels: jenkins, maven3, release


Issue Links:
depends on MAP-61 Possible to release Maven project wit... Open


Code snippet below seem to contain the faulty code:

private void verifyNonSnapshotVersion(ModuleName moduleName, Element element, Namespace ns) {
        if (!failOnSnapshot) {
        Element versionElement = element.getChild("version", ns);
        if (versionElement != null) {
            String currentVersion = versionElement.getText();
            if (currentVersion.endsWith("-SNAPSHOT")) {
                throw new SnapshotNotAllowedException(String.format("Snapshot detected in file '%s': %s:%s",
                        pomFile.getAbsolutePath(), moduleName, currentVersion));

The code only checks the versions tag for text that ends with "-SNAPSHOT". If the pom looks like this:


The code will not find "-SNAPSHOT" in the version-tag text and will therefore let the release go through.

Expected result: Code should when finding a reference to a property in the versions tag look for properties defined either in this pom or a parent pom and also check those for snapshot references.

Generated at Mon Jun 01 20:04:03 UTC 2020 using Jira 8.5.3#805003-sha1:b4933e02eaff29a49114274fe59e1f99d9d963d7.