title: Spring Boot 2 - Change Jar Name
body: <p>I am using Spring Boot 2 in my Gradle project to do a build to jar in Jenkins, and I would like to change the name of that jar file.</p>
  
  <p>By default, Spring Boot 2 used the Gradle property <code>rootProject.name</code>, which can be set in the <code>/settings.gradle</code> file.</p>
  
  <p>However, I would like to change the jar file name, without changing the <code>rootProject.name</code>.</p>
  
  <p>Here are my <code>bootJar</code> and <code>springBoot</code> sections of the <code>build.gradle</code> file:</p>
  
  <pre><code>bootJar {
    launchScript()
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>springBoot {
    buildInfo {
      properties {
        artifact = "jarName"
        group = "groupName"
        name = "projectName"
        version = "1.0"
      }
    }
  }
  </code></pre>
  
  <p><strong>Note:</strong> <code>artifact</code> is not setting the jar name, as I expected it to, after reading: <a href="https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/#integrating-with-actuator" rel="noreferrer">https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/#integrating-with-actuator</a></p>