This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 166895 - manifest.mf is not processed for java applet project
Summary: manifest.mf is not processed for java applet project
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Tomas Zezula
URL:
Keywords: REGRESSION
: 167315 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-11 06:42 UTC by estarkov
Modified: 2009-09-02 15:36 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Reproducing Project (15.25 KB, application/octet-stream)
2009-07-03 12:04 UTC, ttampe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description estarkov 2009-06-11 06:42:26 UTC
I have a java _applet_ project that requires modified Class-Path in MANIFEST.MF of the final jar.
I created manifest.mf file in the project dir and added "manifest.file=manifest.mf" string in the project.properties file.
NetBeans 6.5.1 had processed this manifest.mf correctly, but new NetBeans 6.7 RC2 ignores it.
Comment 1 ttampe 2009-07-03 10:42:03 UTC
Similar things happen in Final Release as well.

Investigating shows that the new target -do-jar-with-libraries-without-manifest is invoked though a manifest is
available. In fact, the situation is even worse:

A library jar (Standard project created by NB67, provided with a manifest, but containing no main class) will be built
twice:
- first by target -do-jar-with-manifest (containing the specified manifest)
- second by target -do-jar-with-libraries-without-manifest (containing a *DEFAULT* manifest)
The resulting JAR in ${dist.dir} will not contain the contents of the specified manifest.
Comment 2 ttampe 2009-07-03 12:04:40 UTC
Created attachment 84333 [details]
Reproducing Project
Comment 3 ttampe 2009-07-03 12:06:39 UTC
Steps to reproduce:

1. Create a new project for a Java Class Library
2. Add a package (com.foo) and a source file (A.java) in this package
3. Create a manifest.mf in the project's root containing e.g. "Implementation-Vendor: com.foo"
4. Execute "Clean and Build Project"

The output window shows

init:
deps-clean:
Deleting directory C:\Source\Tools\JavaLibrary1\build
Deleting directory C:\Source\Tools\JavaLibrary1\dist
clean:
init:
deps-jar:
Created dir: C:\Source\Tools\JavaLibrary1\build\classes
Created dir: C:\Source\Tools\JavaLibrary1\build\empty
Compiling 1 source file to C:\Source\Tools\JavaLibrary1\build\classes
compile:
Created dir: C:\Source\Tools\JavaLibrary1\dist
Building jar: C:\Source\Tools\JavaLibrary1\dist\JavaLibrary1.jar
Building jar: C:\Source\Tools\JavaLibrary1\dist\JavaLibrary1.jar
Not copying the libraries.
jar:
BUILD SUCCESSFUL (total time: 0 seconds)

Note that the jar is built twice and the resulting jar's manifest does not contain the Implementation-Vendor.

>System Info: 
  Product Version         = NetBeans IDE 6.7 (Build 200906241340)
  Operating System        = Windows Vista version 6.0 running on x86
  Java; VM; Vendor        = 1.6.0_14; Java HotSpot(TM) Client VM 14.0-b16; Sun Microsystems Inc.
  Runtime                 = Java(TM) SE Runtime Environment 1.6.0_14-b08

attachment #84333 [details] contains complete project and verbose output log of running target 'jar' after a 'clean'.
Comment 4 Milan Kubec 2009-07-08 14:40:39 UTC
*** Issue 167315 has been marked as a duplicate of this issue. ***
Comment 5 Milan Kubec 2009-07-09 09:47:59 UTC
It seems that build-impl.xml doesn't support java library project (no main class) with manifest, because in such a
project property 'manifest.available+main.class' is not defined and target '-do-jar-with-libraries-without-manifest' is
executed and <copylibs> task does new jar processing, but without manifest file.

Jesse, was "java library with manifest file" use case omitted intentionally?
Comment 6 Jesse Glick 2009-07-09 16:09:50 UTC
Probably just an oversight. If there is a reproducible test case, should be straightforward to fix.

BTW I recommend adding a new test case to BuildImplTest to verify all the different combinations.
Comment 7 Tomas Zezula 2009-09-02 15:36:54 UTC
Fixed in jet-main: 632b7153604d