sergioadevita / jarjar

Automatically exported from code.google.com/p/jarjar
0 stars 0 forks source link

Preserve Main-Class from MANIFEST.MF #39

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use jarjar to create a single jar from multiple sources, one of which has 
the Main-Class set
2. Attempt to run the jar using "java -jar"

What is the expected output? What do you see instead?
I expect the class selected in the "Main-Class" manifest attribute to run. It 
turns out that no 
manifest information is preserved.

I would hope that a warning (or, optionally, an error) would be printed if more 
than one Main-
Class was seen.

What version of the product are you using? On what operating system?
1.0 from the downloads

Original issue reported on code.google.com by simon.m.stewart on 8 May 2010 at 11:43

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This issue also occurs when running a task on a single file - Main-Class and 
Premain-Class attributes in MANIFEST.MF are lost. Using version 1.4.

Tested with http://code.google.com/p/tpalus/ and this task:

    <project name="generate-jarjar">
        <property name="jarjarfile" value="palus-0.2-nodept-jarjar.jar"/>
        <path id="classpath">
          <pathelement location="jarjar-1.4.jar"/>
          <pathelement location="asm-3.1.jar"/>
        </path>
        <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"   classpathref="classpath"/>
        <delete file="${jarjarfile}"/>
        <jarjar destfile="${jarjarfile}">
        <zipfileset src="palus-0.2-nodept.jar"/>
        <rule pattern="org.**" result="org.jarjar.@1"/>
        </jarjar>
    </project>

Original comment by jarkko.r...@gmail.com on 23 Mar 2014 at 9:36