Java – ant: how to compile jars containing source attachments

How to create a jar containing source attachments using ant?

Maven did it, but I haven't been vivid since 2003 (well, 2009, but no rhythm)

I don't see any options in any javac tasks that do this

I tried to put the source Java files are included in the file set passed to the javac task, but this does not work When I try to view the source code through source code like eclipse, I still see the display of "no source code attachment"

Any suggestions?

Solution

You need two things to work in Eclipse:

>Include the source files in the file set so that each Java files are the same as those in jar Class file exists in the same folder. > In the < javac > task, add the following parameter: debug = "on" This allows you to encode information into Class file to associate two tools, such as those required by eclipse

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>