Skip to content

Add artifact classifier to ChangeRocorderXML#1327

Open
ggkochanski wants to merge 1 commit intomojohaus:masterfrom
ggkochanski:master
Open

Add artifact classifier to ChangeRocorderXML#1327
ggkochanski wants to merge 1 commit intomojohaus:masterfrom
ggkochanski:master

Conversation

@ggkochanski
Copy link
Copy Markdown

@ggkochanski ggkochanski commented Dec 15, 2025

When two dependencies differ by the classifier only then they appear twice in file version-changes.xml but you cannot distinguish which is which.

The general idea is to add the artifact's classifier attribute to node /updates/dependencyUpdate when is set:

        DependencyVersionChange change = (DependencyVersionChange) changeRecord.getVersionChange();
        update.setAttribute("groupId", change.getGroupId());
        update.setAttribute("artifactId", change.getArtifactId());
        if(change.getClassifier() != null) {
            update.setAttribute("classifier", change.getClassifier());
        }

@andrzejj0
Copy link
Copy Markdown
Contributor

andrzejj0 commented Dec 15, 2025

There's currently #1284 open which is going to overhaul the change recorder. I could include your change there or maybe you could wait until it's merged in.

FWIW, you'd also need to update the xsd and the documentation.

@ggkochanski
Copy link
Copy Markdown
Author

@andrzejj0 please go ahead, you know the structure better then me 😅

The classifier makes only sens for dependencies, so sth like this should be sufficient:

class DefaultDependencyVersionChange {
...
        public Builder withDependency(Dependency dependency) {
            groupId = dependency.getGroupId();
            artifactId = dependency.getArtifactId();
+            classifier = dependency.getClassifier();
            oldVersion = dependency.getVersion();
            return this;
        }

        public Builder withArtifact(Artifact artifact) {
            groupId = artifact.getGroupId();
            artifactId = artifact.getArtifactId();
  +          classifier = artifact.getClassifier();
            oldVersion = artifact.getVersion();
            return this;
        }

@andrzejj0
Copy link
Copy Markdown
Contributor

Yes, it's generally a good idea. A classifier could definitely be added. I'm thinking of maybe making it optional and only providing it if it differs from the standard.

Same goes for type, I guess. It gets used a lot sometimes.

I would not stack too much changes into that one PR so that we don't overwhelm Sławek who needs to review all that.

@ggkochanski ggkochanski force-pushed the master branch 3 times, most recently from 74e5f07 to 80f4abd Compare December 16, 2025 08:15
@ggkochanski
Copy link
Copy Markdown
Author

code format fixed, schema updated, integration test added

and waiting for events to unfold 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants