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.
Summary: | Manifest ignored for library | ||
---|---|---|---|
Product: | java | Reporter: | Milan Kubec <mkubec> |
Component: | Unsupported | Assignee: | David Konecny <dkonecny> |
Status: | CLOSED FIXED | ||
Severity: | blocker | CC: | jrojcek |
Priority: | P3 | Keywords: | RELNOTE |
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 41537 |
Description
Milan Kubec
2004-05-26 13:56:09 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. My usecase: I created library project - javabean, no main class. I put manifest.mf 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 manifest.mf 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 manifest? 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. 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). I need to give this some thought. I do not like conditional logic in Ant script. I will return to this later this week. No need some magic, I'd use something like: <available file="maifest.mf" 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. To configure library project to use a manifest you have to do this: add "manifest.file" property to project.properties which points to your manifest. This will need to be documented in user's guide. Fixed in: src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl; new revision: 1.15; previous revision: 1.14 Verified in dev-200406230100. |