title: Publishing Maven artifact to artifactory with different artifact ID
body: <p>New to Maven Publishing. Our team has started using Artifactory and I'm trying to figure out how to publish to it, but using a custom artifact ID. Here's the relevant part of my build.gradle file</p>
  
  <pre><code>def applicationName = 'example-api'
  def applicationVersion = '1.0.0.1'
  def group = 'com.example.api'
  def archiveName = "${applicationName}##${applicationVersion}"
  
  bootWar {
    archiveFileName = "${archiveName}.war"
  }
  
  publishing {
    publications {
      mavenJava(MavenPublication) {
        artifact(file("build/libs/${archiveName}.war"))
        afterEvaluate {
          artifactId archiveName
          groupId group
          version applicationVersion
        }
      }
    }
  }
  
  artifactory {
    contextUrl = "http://172.17.0.2:32447/artifactory"
    publish {
      repository {
        repoKey = 'libs-release-local'
        username = 'admin'
        password = 'password1'
        maven = true
      }
  
      defaults {
        publications('mavenJava')
        publishBuildInfo = true
        publishArtifacts = true
        publishPom = false
      }
  
    }
  
    clientConfig.info.setBuildName(applicationName)
    clientConfig.info.setBuildNumber(applicationVersion)
  }
  </code></pre>
  
  <p>But it seems it's never keeps the same name as the WAR file that's produced in the build. This is the closest I've gotten:</p>
  
  <p><a href="https://i.stack.imgur.com/DGint.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DGint.png" alt="enter image description here"></a></p>
  
  <p>Ideally, I'd like to have the artifact be called just 'example-api##1.0.0.1.war' since it will be deployed to Tomcat.</p>
  
  <p>When I try to remove groupId, Artfactory seems unable to create a repo URL, and if I omit the the version, the artifact name is then <code>example-api##1.0.0.1-unspecified.war</code></p>
  
  <p>Any thoughts?</p>