You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by helio <he...@buscape-inc.com> on 2007/11/27 22:52:56 UTC

Problem with MANIFEST.MF in maven-jar-plugin

Hi,

I am using maven-jar-plugin on maven 2.0.7.
I added this in my pom.xml:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <configuration>
        <archive>
          
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
        </archive>
      </configuration>
    </plugin>
  </plugins>
</build>

In src/main/resources/META-INF/MANIFEST.MF I have:

Manifest-Version: 1.0
Class-Path: activation.jar commons-logging.jar getopt.jar javassist.jar 
jaxb-api.jar jaxb-impl.jar jbossall-client.jar jboss-ejb3x.jar 
jboss-j2ee.jar jboss-jaxrpc.jar jboss-jaxws.jar jboss-saaj.jar 
jbossws-client.jar jbossws-spi.jar jboss-xml-binding.jar jtds-1.2.jar 
log4j.jar mail.jar mysql-connector-java-3.1.12-bin.jar policy.jar 
stax-api.jar wsdl4j.jar wstx.jar xercesImpl.jar
Main-Class: com.Claudio

But when I run mvn clean package, into jar´s MANIFEST.MF I got:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: claudior
Build-Jdk: 1.5.0_06
Main-Class: com.Claudio
Class-Path: activation.jar commons-logging.jar getopt.jar javassist.ja
 r jaxb-api.jar jaxb-impl.jar jbossall-client.jar jboss-ejb3x.jar jbos
 s-j2ee.jar jboss-jaxrpc.jar jboss-jaxws.jar jboss-saaj.jar jbossws-cl
 ient.jar jbossws-spi.jar jboss-xml-binding.jar jtds-1.2.jar log4j.jar
  mail.jar mysql-connector-java-3.1.12-bin.jar policy.jar stax-api.jar
  wsdl4j.jar wstx.jar xercesImpl.jar

The plugin maven-jar-plugin adds breaklines in Class-Path and my jar 
does not work out!!!

Please, help me.

Helio

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with MANIFEST.MF in maven-jar-plugin

Posted by helio <he...@buscape-inc.com>.
Hi, guys!

I have not known the rule of 72 character in Manifest file.
My application was using more than 72 character in Manifest file.
When I saw the file created by maven, I thought that will not work out
I tested and work out with breaklines.
 
Sorry and thanks for your help!

Helio

Wayne Fay escreveu:
> What do you mean "my jar does not work out"? How does it break?
>
> Please review the JAR spec -- I am reasonably certain the
> Maven-produced manifest.mf is correct:
> http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Notes%20on%20Manifest%20and%20Signature%20Files
>
> Line length:
> No line may be longer than 72 bytes (not characters), in its
> UTF8-encoded form. If a value would make the initial line longer than
> this, it should be continued on extra lines (each starting with a
> single SPACE).
>
> Wayne
>
> On 11/27/07, helio <he...@buscape-inc.com> wrote:
>   
>> Hi,
>>
>> I am using maven-jar-plugin on maven 2.0.7.
>> I added this in my pom.xml:
>>
>> <build>
>>  <plugins>
>>    <plugin>
>>      <groupId>org.apache.maven.plugins</groupId>
>>      <artifactId>maven-jar-plugin</artifactId>
>>      <configuration>
>>        <archive>
>>
>> <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
>>        </archive>
>>      </configuration>
>>    </plugin>
>>  </plugins>
>> </build>
>>
>> In src/main/resources/META-INF/MANIFEST.MF I have:
>>
>> Manifest-Version: 1.0
>> Class-Path: activation.jar commons-logging.jar getopt.jar javassist.jar
>> jaxb-api.jar jaxb-impl.jar jbossall-client.jar jboss-ejb3x.jar
>> jboss-j2ee.jar jboss-jaxrpc.jar jboss-jaxws.jar jboss-saaj.jar
>> jbossws-client.jar jbossws-spi.jar jboss-xml-binding.jar jtds-1.2.jar
>> log4j.jar mail.jar mysql-connector-java-3.1.12-bin.jar policy.jar
>> stax-api.jar wsdl4j.jar wstx.jar xercesImpl.jar
>> Main-Class: com.Claudio
>>
>> But when I run mvn clean package, into jar´s MANIFEST.MF I got:
>>
>> Manifest-Version: 1.0
>> Archiver-Version: Plexus Archiver
>> Created-By: Apache Maven
>> Built-By: claudior
>> Build-Jdk: 1.5.0_06
>> Main-Class: com.Claudio
>> Class-Path: activation.jar commons-logging.jar getopt.jar javassist.ja
>>  r jaxb-api.jar jaxb-impl.jar jbossall-client.jar jboss-ejb3x.jar jbos
>>  s-j2ee.jar jboss-jaxrpc.jar jboss-jaxws.jar jboss-saaj.jar jbossws-cl
>>  ient.jar jbossws-spi.jar jboss-xml-binding.jar jtds-1.2.jar log4j.jar
>>  mail.jar mysql-connector-java-3.1.12-bin.jar policy.jar stax-api.jar
>>  wsdl4j.jar wstx.jar xercesImpl.jar
>>
>> The plugin maven-jar-plugin adds breaklines in Class-Path and my jar
>> does not work out!!!
>>
>> Please, help me.
>>
>> Helio
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>   


-- 
 
* Helio Marci de Oliveira *
Departamento de Tecnologia
helio@buscape-inc.com <ma...@buscape-inc.com>
tel: + 55 11 3848 8700 ramal:8780
skype: helio.marci
<http://www.buscape.com>
 







---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with MANIFEST.MF in maven-jar-plugin

Posted by Stuart McCulloch <st...@jayway.net>.
On 28/11/2007, Wayne Fay <wa...@gmail.com> wrote:
>
> What do you mean "my jar does not work out"? How does it break?
>
> Please review the JAR spec -- I am reasonably certain the
> Maven-produced manifest.mf is correct:
>
> http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Notes%20on%20Manifest%20and%20Signature%20Files
>
> Line length:
> No line may be longer than 72 bytes (not characters), in its
> UTF8-encoded form. If a value would make the initial line longer than
> this, it should be continued on extra lines (each starting with a
> single SPACE).


that's correct - you'll see the same effect when using plain old jar:

   jar cfm foo.jar src/main/resources/META-INF/MANIFEST.MF
   jar xf foo.jar

and META-INF/MANIFEST.MF will be formatted with the 72 char limit

as Wayne said, could you explain more about "does not work out"?
do you see any exceptions / errors when using your jar? are those
jarfiles listed in Class-Path, in the same directory as your jar.

note Class-Path does not allow you to refer to embedded jars, see:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4648386
for the (long-running!) saga...

Wayne
>
> On 11/27/07, helio <he...@buscape-inc.com> wrote:
> > Hi,
> >
> > I am using maven-jar-plugin on maven 2.0.7.
> > I added this in my pom.xml:
> >
> > <build>
> >  <plugins>
> >    <plugin>
> >      <groupId>org.apache.maven.plugins</groupId>
> >      <artifactId>maven-jar-plugin</artifactId>
> >      <configuration>
> >        <archive>
> >
> > <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
> >        </archive>
> >      </configuration>
> >    </plugin>
> >  </plugins>
> > </build>
> >
> > In src/main/resources/META-INF/MANIFEST.MF I have:
> >
> > Manifest-Version: 1.0
> > Class-Path: activation.jar commons-logging.jar getopt.jar javassist.jar
> > jaxb-api.jar jaxb-impl.jar jbossall-client.jar jboss-ejb3x.jar
> > jboss-j2ee.jar jboss-jaxrpc.jar jboss-jaxws.jar jboss-saaj.jar
> > jbossws-client.jar jbossws-spi.jar jboss-xml-binding.jar jtds-1.2.jar
> > log4j.jar mail.jar mysql-connector-java-3.1.12-bin.jar policy.jar
> > stax-api.jar wsdl4j.jar wstx.jar xercesImpl.jar
> > Main-Class: com.Claudio
> >
> > But when I run mvn clean package, into jar´s MANIFEST.MF I got:
> >
> > Manifest-Version: 1.0
> > Archiver-Version: Plexus Archiver
> > Created-By: Apache Maven
> > Built-By: claudior
> > Build-Jdk: 1.5.0_06
> > Main-Class: com.Claudio
> > Class-Path: activation.jar commons-logging.jar getopt.jar javassist.ja
> >  r jaxb-api.jar jaxb-impl.jar jbossall-client.jar jboss-ejb3x.jar jbos
> >  s-j2ee.jar jboss-jaxrpc.jar jboss-jaxws.jar jboss-saaj.jar jbossws-cl
> >  ient.jar jbossws-spi.jar jboss-xml-binding.jar jtds-1.2.jar log4j.jar
> >  mail.jar mysql-connector-java-3.1.12-bin.jar policy.jar stax-api.jar
> >  wsdl4j.jar wstx.jar xercesImpl.jar
> >
> > The plugin maven-jar-plugin adds breaklines in Class-Path and my jar
> > does not work out!!!
> >
> > Please, help me.
> >
> > Helio
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Cheers, Stuart

Re: Problem with MANIFEST.MF in maven-jar-plugin

Posted by Wayne Fay <wa...@gmail.com>.
What do you mean "my jar does not work out"? How does it break?

Please review the JAR spec -- I am reasonably certain the
Maven-produced manifest.mf is correct:
http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Notes%20on%20Manifest%20and%20Signature%20Files

Line length:
No line may be longer than 72 bytes (not characters), in its
UTF8-encoded form. If a value would make the initial line longer than
this, it should be continued on extra lines (each starting with a
single SPACE).

Wayne

On 11/27/07, helio <he...@buscape-inc.com> wrote:
> Hi,
>
> I am using maven-jar-plugin on maven 2.0.7.
> I added this in my pom.xml:
>
> <build>
>  <plugins>
>    <plugin>
>      <groupId>org.apache.maven.plugins</groupId>
>      <artifactId>maven-jar-plugin</artifactId>
>      <configuration>
>        <archive>
>
> <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
>        </archive>
>      </configuration>
>    </plugin>
>  </plugins>
> </build>
>
> In src/main/resources/META-INF/MANIFEST.MF I have:
>
> Manifest-Version: 1.0
> Class-Path: activation.jar commons-logging.jar getopt.jar javassist.jar
> jaxb-api.jar jaxb-impl.jar jbossall-client.jar jboss-ejb3x.jar
> jboss-j2ee.jar jboss-jaxrpc.jar jboss-jaxws.jar jboss-saaj.jar
> jbossws-client.jar jbossws-spi.jar jboss-xml-binding.jar jtds-1.2.jar
> log4j.jar mail.jar mysql-connector-java-3.1.12-bin.jar policy.jar
> stax-api.jar wsdl4j.jar wstx.jar xercesImpl.jar
> Main-Class: com.Claudio
>
> But when I run mvn clean package, into jar´s MANIFEST.MF I got:
>
> Manifest-Version: 1.0
> Archiver-Version: Plexus Archiver
> Created-By: Apache Maven
> Built-By: claudior
> Build-Jdk: 1.5.0_06
> Main-Class: com.Claudio
> Class-Path: activation.jar commons-logging.jar getopt.jar javassist.ja
>  r jaxb-api.jar jaxb-impl.jar jbossall-client.jar jboss-ejb3x.jar jbos
>  s-j2ee.jar jboss-jaxrpc.jar jboss-jaxws.jar jboss-saaj.jar jbossws-cl
>  ient.jar jbossws-spi.jar jboss-xml-binding.jar jtds-1.2.jar log4j.jar
>  mail.jar mysql-connector-java-3.1.12-bin.jar policy.jar stax-api.jar
>  wsdl4j.jar wstx.jar xercesImpl.jar
>
> The plugin maven-jar-plugin adds breaklines in Class-Path and my jar
> does not work out!!!
>
> Please, help me.
>
> Helio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org