开发者

How do you select the file name of a maven jar-with-dependencies?

开发者 https://www.devze.com 2022-12-20 20:58 出处:网络
I am creating an executable jar using the jar-with-dependencies component of the maven-assembly-plugin during the package phase of my maven l开发者_如何学Pythonifecycle.However, I can\'t see a way to

I am creating an executable jar using the jar-with-dependencies component of the maven-assembly-plugin during the package phase of my maven l开发者_如何学Pythonifecycle. However, I can't see a way to configure the name of the jar that is output. It appears to always be something like

appname-1.1-r1011-jar-with-dependencies.jar 

How can i configure it to be something else, like perhaps

appname-1.1-r1011.jar

Is this possible?


You can set the appendAssemblyId parameter to false in the maven-assembly-plugin to avoid the "jar-with-dependencies" suffix.

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.2-beta-5</version>
  <executions>
    <execution>
      <id>jar-with-dependencies</id>
      <phase>package</phase>
      <goals>
        <goal>single</goal>
      </goals>
      <configuration>
        <descriptorRefs>
          <descriptorRef>jar-with-dependencies</descriptorRef>
        </descriptorRefs>
        <appendAssemblyId>false</appendAssemblyId>
      </configuration>
    </execution>
  </executions>
</plugin>
0

精彩评论

暂无评论...
验证码 换一张
取 消