History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-11497
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Nikolay Chashnikov
Reporter: Mihai Danila
Votes: 3
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Dependency JAR files do not allow customized MANIFEST

Created: 04 Aug 06 00:04   Updated: 18 Sep 08 13:40
Component/s: Compiling Project
Fix Version/s: Diana 8823

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Windows XP

Build: 4,267
Fixed in build: 8,813
Severity: Medium


 Description  « Hide
If component A is a dependency for web application W, then the Web Module Settings tab allows the component output to be archived in a JAR archive prior to deployment.
Unfortunately, there is no way to supply a customized manifest file. If a manifest file is specified on the classpath as META-INF/MANIFEST.MF then the compile fails with the error "duplicate manifest".

Even though some of Sun's creations are obscure and not so heavily used, we are striving to make good use of them. One of these is the manifest file.

Would it be difficult to make IDEA note the existing MANIFEST file on the classpath of the component to be compressed, and to retain the manifest, or at least merge it, into the resulting JAR?
We are trying to avoid Ant integration and use IDEA's facilities wherever possible. We are planning to adapt our project structure such that all our projects are buildable by IDEA without Ant, but the manifest limitation currently poses a problem.



 All   Comments   Work Log   Change History      Sort Order:
Mihai Danila - 04 Aug 06 00:09

The suggestion for the fix might not be clear the way I put it. I'll try to rephrase it, this time in pseudocode:

jar component output:
precondition: component has been compiled, output is present in the configured output directory
if the output directory contains file "META-INF/MANIFEST.MF" (possibly with any case, as the JAR specification allows for manifest files with combined case)
create the JAR using the existing manifest file
else
create the JAR using a blank manifest file (only manifest-version and possibly idea footprint)
end if
end

or
jar component output:
precondition: same
compress the output directory
if the resulting archive contains an entry called "META-INF/MANIFEST.MF" (possibly case insensitive check) then do nothing
otherwise, add blank manifest file
end


Ben Sommerville - 04 Mar 07 08:31
Allowing user supplied manifest to take precedence is good.

Even better would be to merge the Intellij manifest entries with the user supplied manifest. Given about the only thing that Intellij adds to the manifest are classpath entries this does not seem too hard.


Mihai Danila - 04 Mar 07 21:48
I agree with the merging approach. It would be nice to allow the user to override those values that IDEA provides by default. "Created-By" is such an example. I believe that the degree of configurability enabled by this precedence based approach is a Good Thing.

Here's an example of a manifest created by IDEA:
Manifest-Version: 1.0
Created-By: 1.3.1_01 (Sun Microsystems Inc.)

Also note, per http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest, the version specification is the only required part in a manifest.


Pavel Kaplin - 10 Sep 07 13:41
Feature is necessary for development of OSGi-based applications.