title: Why does the Nexus Artifact Uploader store artifacts in a separate directory?
body: <p>I want to publish an artifact to Nexus 3 in the Gradle project.
  Due to requirements, publish from Jenkins instead of gradle publish using build.gradle maven-publish plug-in.
  I created and executed a JenkinsPipeline script, but the artifact jar and pom have been separated.Why?</p>
  
  <p>The following site is referred to <a href="https://dzone.com/articles/jenkins-publish-maven-artifacts-to-nexus-oss-using" rel="nofollow noreferrer">this</a> and <a href="https://dzone.com/articles/jenkins-publish-maven-artifacts-to-nexus-oss-using" rel="nofollow noreferrer">this</a>.</p>
  
  <p><a href="https://plugins.jenkins.io/nexus-artifact-uploader" rel="nofollow noreferrer">https://plugins.jenkins.io/nexus-artifact-uploader</a></p>
  
  <p>And I make JenkinsPipeline script.</p>
  
  <p>floowing pipeline script.</p>
  
  <pre><code>pipeline {
      ...
          stage("publish to nexus") {
              steps {
                  script {
                      pom = readMavenPom file: "build/pom.xml";
                      artifactPath = "build/libs/gs-managing-transactions-0.1.0.jar"
                      artifactExists = fileExists artifactPath;
                      if(artifactExists) {
                          nexusArtifactUploader(
                              nexusVersion: NEXUS_VERSION,
                              protocol: NEXUS_PROTOCOL,
                              nexusUrl: NEXUS_URL,
                              groupId: pom.groupId,
                              version: pom.version,
                              repository: NEXUS_REPOSITORY,
                              credentialsId: NEXUS_CREDENTIAL_ID,
                              artifacts: [
                                  [artifactId: pom.artifactId, classifier: '', file: artifactPath   , type: pom.packaging],
                                  [artifactId: pom.artifactId, classifier: '', file: "build/pom.xml", type: "pom"]
                              ]
                          );
  
                      } else {
                          error "*** File: ${artifactPath}, could not be found";
                      }
                  }
              }
          }
      ...
  }
  </code></pre>
  
  <p>part of execute log</p>
  
  <pre><code>[Pipeline] nexusArtifactUploader
  ...
  Uploading: http://localhost:7777/repository/maven-snapshots/com/sample/sample-spring-managing-transactions/0.0.1-SNAPSHOT/sample-spring-managing-transactions-0.0.1-20190621.123700-7-debug.jar
  ...
  Uploading artifact gs-managing-transactions-0.1.0.jar completed.
  ...
  Uploading: http://localhost:7777/repository/maven-snapshots/com/sample/sample-spring-managing-transactions/0.0.1-SNAPSHOT/sample-spring-managing-transactions-0.0.1-20190621.123701-8-debug.pom
  Uploading artifact pom.xml completed.
  </code></pre>
  
  <p>Why stored separete artifact like "sample-spring-managing-transactions-0.0.1-20190621.123700-7-debug.jar", "sample-spring-managing-transactions-0.0.1-20190621.123701-8-debug.pom".</p>
  
  <p>I will expect following.</p>
  
  <p>"sample-spring-managing-transactions-0.0.1-20190621.123700-7-debug.jar" "sample-spring-managing-transactions-0.0.1-20190621.123701-7-debug.pom"</p>