0

I am new to maven. I want to package my java code so that, it can be run only by running a command java jar. My code uses 2 external jar files, 1 main java class, 1 property file and will output 1log file.

My POM :

   <modelVersion>4.0.0</modelVersion>
   <groupId>com.ibm.mq.jms</groupId>
  <artifactId>com.ibm.mq</artifactId>
   <version>0.0.1-SNAPSHOT</version>
    <dependencies>
      <dependency>
        <groupId>com.ibm.mq</groupId>
        <artifactId>com.ibm.mq.allclient</artifactId>
        <version>9.0.4.0</version>
       </dependency>
    <dependency>
        <groupId>javax.jms</groupId>
        <artifactId>javax.jms-api</artifactId>
        <version>2.0.1</version>
       </dependency>
     </dependencies>

How can i create a single jar file that could be run independently? Is it better to have this complied in a zip file? My property file needs to be changed by user. Where should I put my property file?

Newbie
  • 45
  • 8
  • Does this answer your question? [How can I create an executable JAR with dependencies using Maven?](https://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven) – Thorbjørn Ravn Andersen Oct 30 '19 at 09:54

1 Answers1

0

Generally, try one of the solutions in How can I create an executable JAR with dependencies using Maven?

The property file must be outside the final jar so that the user can edit them.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142