How to add appendix to publish artifacts?

I need add appendix to publish artifacts. For build task it is easy. But it doesn’t work when I try publish artifacts via maven-publish plugin. Appendix are not added.

plugins {
    id 'maven-publish'
    id 'org.springframework.boot' version '1.5.19.RELEASE'
    id 'org.asciidoctor.convert' version '1.5.3'

def env = 'something'

jar {
    enabled = true
    appendix env

sourceJar {
    appendix env

apiDocZip {
    appendix env

In result I get follow artifacts:


But when I use task publishToMavenLocal, then I get follow:


How can you see appendix was not added. Is there any solution to add appendix to publish artifacts?

Documentation contains follow solution:

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifactId = 'my-library'

But I get artifacts twice. First are named ‘my-library’. And second has name equal root project name.