Bug 548448 - AJDT "output JAR" option does not export any resources (e.g. aop.xml)
Summary: AJDT "output JAR" option does not export any resources (e.g. aop.xml)
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: IDE (show other bugs)
Version: 1.9.2   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-19 21:20 EDT by Alexander Kriegisch CLA
Modified: 2019-06-24 11:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kriegisch CLA 2019-06-19 21:20:38 EDT
Some new findings: This is not just about aop.xml or aop-ajc.xml, respectively. Other resources, no matter whether I put them into the default 'src' folder or into a newly created and assigned source folder "resource", are also not packaged into the resulting JAR. The feature is thus seriously broken and should be either repaired or removed altogether.

In case of removal the documentation should mention that there is the option

  ** right-click project
  ** Export...
  ** JAR file (or JAR file with AspectJ support)
  ** and all the settings you like to have there including the option to
     save the settings into a file such as
     '/MyProjectName/my-jar.jardesc'
  ** with the subsequent option to just double-click the *.jardesc file
     from the Package Explorer and re-create the JAR with the exact same
     settings.

This will take care of adding all resources to the JAR.

One more open question here is the difference between exporting "JAR file" and "JAR file with AspectJ support" because the created JAR file looks completely identical to me and also the saved *.jardesc files are. Maybe one more candidate to remove from AJDT (or repair whatever additional functionality this used to have).

BTW, this seemingly useless double entry for creating JAR files is just as puzzling to me as the "Run as" options for applications, namely "Java application" vs. "AspectJ/Java application". I always use the former, never the latter, not knowing what it would offer that the former doesn't. I thinkl AJDT needs some serious clean-up.


Andy Clement:

> I couldn't honestly tell you if that used to work. Feel free to raise a
> bug, but I can't tell you it'd be at the top of my list ;) PRs welcome!
> 
> 
> Alexander Kriegisch:
> 
>> I just opened one of my old LTW projects in Eclipse with current
>> AJDT. I have src/META-INF/aop.xml and when I build to the default bin
>> folder I see that bin/META-INF/aop.xml exists as expected. But when I
>> activate "output JAR" in the AspectJ build settings, the generated
>> JAR only contains META-INF/MANIFEST.MF with content
>> 
>> Manifest-Version: 1.0
>> Created-By: AspectJ Compiler
>> 
>> but no aop.xml. This seems to be a bug, unless I am doing something
>> stupid, putting my META-INF directory into the wrong place or so. If
>> it is old or new I cannot remember. Anyway, it is a definite
>> shortcoming, no matter whether it is a regression or has always been
>> that way.
Comment 1 Andrew Clement CLA 2019-06-24 11:52:33 EDT
From what I recall run as aspectj app was better aware of being able to find main() if you'd put it somewhere (like in an aspect) that JDT couldn't find. But I'm having to cast my mind back here. This is another reason I'd like to remove code style syntax for aspectj, no longer need hacky jdt extensions if everything was annotation based...

I'm sure at the time there was a good reason for export jar file with aspectj support, but I can't remember what it was.