开发者

How to attach the source in eclipse using java program? [closed]

开发者 https://www.devze.com 2023-01-14 08:44 出处:网络
开发者_如何学运维It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current for
开发者_如何学运维 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

How can i attach the source in eclipse using java program? Can anyone help me??? Thanks in advance..


Attached sources are stored in the .classpath file in the project root directory, which you can manipulate programmatically. Entries look like this:

<classpathentry kind="lib" path="lib/joda-time-1.6.jar" 
                           sourcepath="/lib/joda-time-1.6-sources.jar"/>


If you want automatically attached sources, you will probably want to use maven as a system for build and dependency management. It is the only system I know that supports this feature out of the box.

The integration with eclipse is great through either the m2eclipse eclipse plugin or the maven-eclipse-plugin on the maven side. Either way: when a jar mylib-1.2.3.jar is downloaded, maven will automatically look for a jar called mylib-1.2.3-sources.jar and attach it if present (and it is present for most open source projects). It really makes life a lot easier.

0

精彩评论

暂无评论...
验证码 换一张
取 消