Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am creating an executable jar using the jar-with-dependencies component of the maven-assembly-plugin during the package phase of my maven lifecycle. 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?

like image 925
Jason Novak Avatar asked Feb 23 '10 17:02

Jason Novak


1 Answers

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>
like image 135
Pascal Thivent Avatar answered Nov 13 '22 23:11

Pascal Thivent