Artifactory properties

Hello community,
I’m implementing a custom plugin which is based on maven-publisher.
I’ve an issue when I try to pass a map through method (getArtifactoryProperties) to properties map inside artifactory → publish → defaults closures:

private Map<String, String> getArtifactoryProperties(Project project) {
     return ['key1', 'value1', 'key2': 'value']
}

this is the call of the method inside my custom plugin

class myCalss implements Plugin<Project> {
// code ....
      project.artifactory{
         //code ....
         publish {
              defaults {
                   publications('maven')
                   properties = getArtifactoryProperties(project)
              }
         } 
     }
}

when I run artifactoryPublish I got successful run but I got also a message like:
[root project ‘projectname’][0]null
and the properties (related to the jar and the pom published) are not deployed in artifactory.
can you please help me to solve that?
best Regards

Where do you get that message?
What exactly is the message?
What is around the message?
Does --info help?
Or --debug?
Can you provide a build --scan?

Thank you for your help
Where do you get that message?
in the consol output after executing gradle artifactoryPublish task
the build finish with the message :

> Configure project :
**[root project 'myproject'][0]null**

> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :defaultJar
> Task :generatePomFileForMavenJavaPublication
> Task :jar
> Task :artifactoryPublish
Deploying artifact: https://artifactory/myrepo/com/myproject/1.0.0/myproject-1.0.0.jar
Deploying artifact: https://artifactory/myrepo/com/myproject/1.0.0/myproject-1.0.0.pom

> Task :artifactoryDeploy
Deploying build descriptor to: https://artifactory/artifactory/api/build
Build successfully deployed. Browse it in Artifactory under https://artifactory/webapp/builds/myproject/170358263836

I’ve tried also to debug with println :
case 1 :

class myCalss implements Plugin<Project> {
// code ....
      project.artifactory{
         //code ....
         publish {
               **println getArtifactoryProperties(project)**
              defaults {
                   publications('maven')
                   //properties = getArtifactoryProperties(project)
              }
         } 
     }
}

the properties map is returned and printed correctly: [‘key1’, ‘value1’, ‘key2’: ‘value’]

case 2:

class myCalss implements Plugin<Project> {
// code ....
      project.artifactory{
         //code ....
         publish {
              defaults {
                   publications('maven')
                   **println getArtifactoryProperties(project)**
                   //properties = getArtifactoryProperties(project)
              }
         } 
     }
}

the return printed is: [root project ‘projectname’][0]null

I hope that this additional informations could help you to understand my issue, please don’t hesitate to ask for additional information.
Best regards

I have no idea why that println should produce that output.
You probably need to debug your build to find out what is happening.
You could also try to provide an MCVE. Often creating it already discloses the problem.