Note that there are some explanatory texts on larger screens.

plurals
  1. POPackaging Spring Jars in the exported Spring project - better way?
    primarykey
    data
    text
    <p>I'm exporting a spring project as JAR. Now the problem is, I need to take care of spring jar files dependencies. </p> <p>One option for this is, include all the JAR files in the <code>Class-Path</code> header of the <em>MANIFEST.MF</em> file (A Real Pain in the neck). Second option I tried is using the Command Line, but of course, we can't have both <code>-cp</code> and <code>-jar</code> options to work together. Once we have <code>-jar</code>, <code>-cp</code> will get ignored.</p> <p>To ease out the first option, I wondered if I could introduce some wildcard here. So, I gave it a try, and changed my MANIFEST as:</p> <pre><code>Class-Path: lib/* </code></pre> <p>Nothing happened. This confirmed that Manifest headers don't treat <code>*</code> as wildcard -> <strong>FAILED</strong>.</p> <p>Then I moved onto the second option. I did a little tweaking there. I got rid of the JAR file, and decided to work with simple directory structure containing my class files. Then I created a <em>batch</em> file, with the command to run the main class, passing all the JAR files using wildcards as command line argument:</p> <pre><code>java -cp .;./* MainClass </code></pre> <p>and then I simply ran the batch file. Thankfully it worked. But I don't want it this way.</p> <p>If only there was some way to get it done using JAR file only, that would be much better option. Do I have any option here? The only thing that I doubt is am I using the Wildcards the right way in the MANIFEST header? Do the MANIFEST headers consider wildcards at all?</p> <hr> <p><strong>NOTE</strong>: I can't use Maven. So, it's not an option here.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload