0 votes
in DevOps by
Maven JAR File Creation

1 Answer

0 votes
by

Now, assuming you have finished coding your Java project and compiled the same, it is time to create a JAR file.

  • The first step for creating JAR file is to ensure cleansing any previous build artifacts before packaging them as a Maven project. This can be done using mvn clean which removes all the previously generated files from ./target folder.

  • mvn package would create a new package at ./target folder.

Alternately, we could combine cleaning and package creation as one step by typing mvn clean package. You would get a new JAR file created.

Related questions

0 votes
asked Aug 19, 2023 in Maven - Coalescing Pipeline by GeorgeBell
0 votes
asked Feb 20, 2020 in DevOps by MBarbieri
0 votes
asked Apr 7, 2021 in Maven - Coalescing Pipeline by SakshiSharma
...