Bug 40943 - Binary weaving should copy non-Java resources from "-injars" to "-outjar"
Summary: Binary weaving should copy non-Java resources from "-injars" to "-outjar"
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.1   Edit
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: 1.1.1   Edit
Assignee: Mik Kersten CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 43454 43467 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-30 08:21 EDT by Matthew Webster CLA
Modified: 2012-04-03 16:18 EDT (History)
6 users (show)

See Also:


Attachments
Copy non-Java resources from "-injars" to "-outjar" (4.71 KB, patch)
2003-07-30 12:54 EDT, Matthew Webster CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Webster CLA 2003-07-30 08:21:56 EDT
Currently during a binary weave only .class files are wriiten to the -outjar. 
Unfortunately most non-trival Java programs also comprise properties files, 
messages, XML, images etc. These are not copied and programs are most likely 
to fail without them.

This problem has been raised on the aspectj-users mailing 
list: "http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg00101.html"
Comment 1 Mik Kersten CLA 2003-07-30 10:52:31 EDT
Reassigning it to myself since we can solve it at the same time as we 
implement copying resources from source path to the output path.
Comment 2 Matthew Webster CLA 2003-07-30 12:54:39 EDT
Created attachment 5585 [details]
Copy non-Java resources from "-injars" to "-outjar"
Comment 3 Mik Kersten CLA 2003-07-31 12:45:40 EDT
As a first pass we should avoid copying over anything in the META-INF 
directory (issue a warning that we didn't if it existed) and issue errors if 
clashing resources existed in multiple JARs.
 
Comment 4 Mik Kersten CLA 2003-08-06 17:05:46 EDT
Fixed for 1.1.1
Comment 5 Adrian Colyer CLA 2003-08-28 08:02:29 EDT
updated target milestone field to 1.1.1
Comment 6 Jim Hugunin CLA 2003-09-22 16:11:02 EDT
*** Bug 43454 has been marked as a duplicate of this bug. ***
Comment 7 Jim Hugunin CLA 2003-09-22 20:20:57 EDT
*** Bug 43467 has been marked as a duplicate of this bug. ***
Comment 8 Morten Christensen CLA 2003-09-24 13:21:00 EDT
The bug is marked as fixed in AspectJ1.1.1 but I can not get it to work. Can 
anyone else get it to work ?
 
More about my setup:
The 3rdparty.jar file contains a property file in the root and a etc root 
directory containing more non-java files. NONE OF these are copied to my output 
(which is the problem). Maybe it is because I am using the ajc task like this: 
<iajc injars="3rdparty.jar" outjar="${build}/out.jar" 
sourceRootCopyFilter="**/CVS/*">
 <srcDir path="${src}"/>
 ...
</iajc>


OR like this (which does not work either):

<iajc injars="3rdparty.jar" destDir="${build}/classes">
 <srcDir path="${src}"/>
  ...
</iajc>


I also tried some combination of the above, but nothing works. I.e. ajc still 
forget to copy the non-java stuff (only the processed *.class files are copied 
to output).

Is there still a bug or am I doing something wrong ?
 
Comment 9 Morten Christensen CLA 2003-09-25 17:38:54 EDT
Ok, found out that one more option copyInJars was needed (apparently is is 
false by default). It works when set to true!

Can someone set the bug back to resolved - apparently I am not allowed to do 
so.
Comment 10 Mik Kersten CLA 2003-09-25 18:21:22 EDT
Setting to "resolved" as requested by the re-opener.
Comment 11 Antony Joseph CLA 2003-11-19 10:09:42 EST
I am running into similar problems. I am using aspectj compiler 1.1.1 and 
eclipse 3.0m4.
The ant target is:
<target name="weave-struts" >
    <iajc fork="true" injars="${struts.jar}" outjar="${weaved-struts.jar}">
        <sourceroots>
            <pathelement location="${aspect.dir}"/>
        </sourceroots>
        <classpath refid="compile.classpath"/>
    </iajc>
</target>  

Here is the output: 
       [iajc] manifest not copied: 'META-INF/tlds/struts-html.tld' in 
JAR 'C:\eclipse-3.0m4-workspace\Tasag\WEB-INF\src\struts-lib\struts.jar'
        [iajc] manifest not copied: 'META-INF/tlds/struts-logic.tld' in 
JAR 'C:\eclipse-3.0m4-workspace\Tasag\WEB-INF\src\struts-lib\struts.jar'
        [iajc] manifest not copied: 'META-INF/tlds/struts-nested.tld' in 
JAR 'C:\eclipse-3.0m4-workspace\Tasag\WEB-INF\src\struts-lib\struts.jar'
        [iajc] manifest not copied: 'META-INF/tlds/struts-template.tld' in 
JAR 'C:\eclipse-3.0m4-workspace\Tasag\WEB-INF\src\struts-lib\struts.jar'
        [iajc] manifest not copied: 'META-INF/tlds/struts-tiles.tld' in 
JAR 'C:\eclipse-3.0m4-workspace\Tasag\WEB-INF\src\struts-lib\struts.jar'

I tried setting attribute copyinjars="true" but got the following output:
"copyInjars not required since 1.1.1".
Comment 12 Matthew Webster CLA 2003-11-21 14:15:37 EST
Please see bug#44190 whose fix should be included in the next version of AJDT.