996Worker
996Worker
发布于 2022-08-17 / 182 阅读
0
0

Maven pom for building the fat jar

A quick note of the pom that can build a fat jar for the web app. It workes for me.

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.4.2</version>
                <configuration>
                    <finalName>app</finalName>
                    <archive>
                        <manifest>
                            <mainClass>io.swen90007sm2.app.HotelBookingApplication</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <appendAssemblyId>false</appendAssemblyId>
                </configuration>
                <executions>
                    <execution>
                        <id>assemble-all</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

评论