[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-975) Project Archives created WAR file contain duplicated libs

Viacheslav Kabanovich (JIRA) jira-events at lists.jboss.org
Tue Oct 2 09:51:43 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBIDE-975?page=comments#action_12379904 ] 
            
Viacheslav Kabanovich commented on JBIDE-975:
---------------------------------------------

I found following problems in plugins org.jboss.ide.eclipse.archives.core and org.jboss.ide.eclipse.archives.ui:

1) New Archive -> WAR wizard presets 3 file-sets (second page): lib, classes, WebContent.
If libraries are located in WebContent/WEB-INF/lib, then file-set 'lib' is subset of file-set 'WebContent', but 'WebContent' does not excludes *.jar files. This alone makes jar files to be copied twice to the war. 
I think that it is safe to preset property excludes=**/WEB-INF/lib/*.jar for file-set 'WebContent'. Anyway, user has opportunity to edit file sets in Project Archives view. Though, it would be nice to have opportunity to modify file sets already in New WAR wizard, because if by some reason the preset structure is not appropriate, user still has to finish wizard resulting in a wrong war.

2) File-set 'lib' has as source the project root folder. It may be what is needed, to collect all *.jar files in project, however the problem is that method ModelTruezipBridge.getFiles(IPath[], IArchiveFileSet) that calculates destination paths for war entries, always keeps relative path of filtered file to source folder which explains paths like /WEB-INF/lib/WebContent/WEB-INF/lib/x.jar. 

The second problem can be solved in different ways: a) add property 'flat' to IArchiveFileSet, so that if it is true, only file names without relative path to source will be appended to destination root; b) modify source in preset file-set 'lib' to be actual lib folder instead of project root.

I am committing changes to org.jboss.ide.eclipse.as.core.extensions.archives.WarArchiveType:
1) Setting excludes pattern "**/WEB-INF/lib/*.jar" to 'WebContent' file-set.
2) Setting source of 'lib' file-set to %project%/%WebContent%/WEB-INF/lib.


> Project Archives created WAR file contain duplicated libs
> ---------------------------------------------------------
>
>                 Key: JBIDE-975
>                 URL: http://jira.jboss.com/jira/browse/JBIDE-975
>             Project: JBoss Tools
>          Issue Type: Bug
>          Components: Archives
>         Environment: WindowsXP SP2
> rhds-win32-1.0.0.beta1.jar
> Red Hat Developer Studio
> Version: 1.0.0 BETA1
> Build: 200709130228-nightly
> JDK 1.5_08
>            Reporter: Aliaksey Nis
>         Assigned To: Viacheslav Kabanovich
>             Fix For: 2.0.0.CR1
>
>
> 1. Create JSF 1.2 Kickstart project 
> 2. Package explorer > Export > Web > WAR file
> 3. Export file as test1.war
> 4. In project Archives view > New archive > WAR
> 5 Make WAR archive for same Kickstart project with compressed zip option. Name it test2.war
> 6. Look at size of test1.war and test2.war. 
> test2.war 2 times bigger then test1.war
> 7. Open test2.war. 
> ..\test2.war\WEB-INF\lib\ - folder containing libs
> ..\test2.war\WEB-INF\lib\WebContent\WEB-INF\lib\ - folder contain same libs (duplicated). 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbosstools-issues mailing list