title: Create and execute a runnable jar using maven which might resolve dependencies if not found
body: <p>I want to use maven to</p>
  <ol>
  <li><p>create an executable jar from a specified &quot;target&quot; folder containing compiled classes or,</p>
  </li>
  <li><p>create an executable jar from a prebuilt jar at a specific path</p>
  <p>where the executable jar contains a META-INF/pom.xml which contains the following</p>
  </li>
  <li><p>the main class</p>
  </li>
  <li><p>class path to resolve external dependencies from local lib folder</p>
  </li>
  <li><p>dependencies to be resolved from central repo, and if missing then download them</p>
  </li>
  <li><p>pass arguments while running the jar</p>
  </li>
  </ol>
  <p>So, the user will run the executable jar. If the internal dependencies are not met, they will be downloaded. The main class will be found from the pom.xml. The internal dependencices will be found from the m2 repo where as the external dependencies will be met from the class path provided in the classpath. If any arguments are passed to the executable jar from the command line, they will be passed on to the main class.</p>