title: Use the gradle bootJar instead of jar task and build fails in Jenkins
body: <p>After I started using the spring boot gradle plugin in my gradle.build file, the build fails on jenkins.</p>
  
  <pre><code>classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.2.RELEASE")
  </code></pre>
  
  <p>Things work fine locally including build, test and webapp runs fine with Jetty. The only problem is the build fails on Jenkins in the task <code>artifactoryPublish</code>. It says:</p>
  
  <pre><code>File '/var/lib/jenkins/jobs/release-my-project/workspace/build/libs/workspace-0.2.1-SNAPSHOT.jar' does not exists, and need to be published!
  </code></pre>
  
  <p>Not sure what's going with the gradle <code>artifactoryPublish</code> task.  I think the task comes from Jenkins.</p>
  
  <p>Before using the spring boot gradle plugin, my jar task in gradle.build is as follows:</p>
  
  <pre><code>jar {
      baseName = 'my-project'
      from {
          configurations.compile.collect {
              it.isDirectory() ? it : zipTree(it)
          }
          configurations.runtime.collect {
              it.isDirectory() ? it : zipTree(it)
          }
      }
      manifest {
          attributes 'Main-Class':'com.example.Application'
      }
      // Exclude manifest signature files
      exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/LICENSE'
  }   
  </code></pre>
  
  <p>Since the spring boot gradle plugin disables the jar task, and replaces it with the bootJar task, so I configured the bootjar task as follows:</p>
  
  <pre><code>bootJar {
      baseName = 'my-project'
      mainClassName = 'com.example.Application'
      // Exclude manifest signature files
      exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/LICENSE'
  }
  </code></pre>
  
  <p>One thing I noticed from jenkins log is that it says the file <code>workspace-0.2.1-SNAPSHOT.jar</code> does not exist. Seems like it is looking for the wrong file. Previously, it looked for the correct file <code>my-project-0.2.1-SNAPSHOT.jar</code>. When I built locally, this jar file was created. Not sure what made jenkins look for <code>workspace-0.2.1-SNAPSHOT.jar</code>. It is supposed to be <code>my-project</code> as I did define baseName inside the bootJar task.</p>
  
  <p>Any idea what's wrong here? Thanks.</p>