当前位置: 动力学知识库 > 问答 > 编程问答 >

java - spring-boot: where is defined the settings to generate jar files

问题描述:

how (where) the spring-boot defines

  1. the name of generated jar-files
  2. the settings for jar-generation by ~$ mvn package . There are two file generated by maven in target folder: XXXX.jar and XXXX.jar.origin.

How can i interfere with the jar-generation process?

thanks

网友答案:

in your pom.xml

<build>
  <finalName>desiredname</finalName>
</build>

or

spring-boot typically uses Spring Boot Maven Plugin

<plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <version>1.4.1.RELEASE</version>
      <executions>
        <execution>
          <goals>
            <goal>repackage</goal>
          </goals>
          <configuration>
                        <finalName>yourdisiredname</finalName>
          </configuration>
        </execution>
      </executions>
    </plugin>

then,

mvn package
网友答案:

pom.xml (because you are using maven; otherwise if you are using gradle, then its build.gradle) can be used to control the jar file name.

分享给朋友:
您可能感兴趣的文章:
随机阅读: