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 43881 - Manifest ignored for library
Summary: Manifest ignored for library
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Konecny
Keywords: RELNOTE
Depends on:
Blocks: 41537
  Show dependency tree
Reported: 2004-05-26 13:56 UTC by Milan Kubec
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kubec 2004-05-26 13:56:09 UTC
Manifest file is ignored for project created as
Comment 1 Jesse Glick 2004-05-26 16:19:35 UTC
Yes, no manifest file is created and none is included in the JAR,
unless <manifest/> is added to project.xml. Please provide more details.
Comment 2 Milan Kubec 2004-05-27 08:26:30 UTC
My usecase:
I created library project - javabean, no main class. I put
to the root of project and build the project. Created jar contains
only default manifest (version, created by, ...) and not provided
manifest. I thought if is in project root it's
automaticaly used for creating jar file (it works this way for j2se
application project).
Is there another way how to build library jar using user provided
Comment 3 David Konecny 2004-05-31 10:57:13 UTC
Re. J2SE Application project: empty manifest is generated in project
root and project.xml is updated to include <use-manifest/>. That's why
it works.

Re. J2SE Library project: there is no support at the moment. Even hand
editing of project.xml does not work because main class manifest entry
will be generated what does not make sense for library. I will fix this.

Question is: should this be supported in UI? Should user be able to
specify in project properties path to manifest which for library is
empty by default, but if non-null the jar target would use it?

Or should we just always generate an empty manifest and use it from
jar target and in case of J2SE App automatically add the main class
attr? This would be easier and would not require any UI change.
Comment 4 Milan Kubec 2004-05-31 16:29:08 UTC
I'd vote for non-null manifest included automaticaly. Manifest is
generated for any j2se application automaticaly. And for j2se library
it would use manifest only if it's in the root of project. Doesn't
need to be in UI (but it would be nice).
Comment 5 David Konecny 2004-05-31 16:45:10 UTC
I need to give this some thought. I do not like conditional logic in
Ant script. I will return to this later this week.
Comment 6 Milan Kubec 2004-05-31 17:03:53 UTC
No need some magic, I'd use something like:

<available file="" property="manifest.available"/>

<target name="jar" depends="jar-manifest,jar-nomanifest"/>

<target name="jar-manifest" if="manifest.available">...</>

<target name="jar-nomanifest" unless="manifest.available">...</>

Maybe it's too much ant code for such little thing, ... but there
should be some way of putting manifest into library jar.
Comment 7 David Konecny 2004-06-03 12:34:17 UTC
To configure library project to use a manifest you have to do this:
add "manifest.file" property to which points to
your manifest. This will need to be documented in user's guide. 

Fixed in:
new revision: 1.15; previous revision: 1.14
Comment 8 Milan Kubec 2004-06-23 13:18:46 UTC
Verified in dev-200406230100.