English 中文(简体)
Dependency bundle (jar-files/sources/API docs) in Eclipse
原标题:

I m developing various in-house extensions for JIRA, the issue tracker we use. So far I worked with Netbeans and everything worked like a charm. However, now I need to switch to Eclipse and I m having struggle setting up the environment for this development project.

First a clarification why I m using the approach I m describing here: building JIRA (in an IDE) is not easily done and I m absolutely not interested in wasting my time to figure out how to do it. Besides, I don t need to build it, I just want to develop extensions and be able to use the IDE s auto-completion and help support (API docs). Atlassian (the company that develops JIRA) provides a "development" package, but it s just a sorry excuse rather than a real solution.

What I did with Netbeans was to create a library bundle with all relevant jar-files, the Java source files and the API documentation. This way I could use auto-completion, "jump to" the source and the API docs would pop-up when needed.

It seems Eclipse doesn t offer such a functionality, at least I couldn t figure out how to add the sources and the API docs to a "User Library" (which I d then add as a dependency to my project just as with Netbeans).

My next approach was to create a separate project that holds all the stuff and mark that project as a dependency of my project. This works, but it leaves me with another issue: now I get 37k errors reported (all within the "dependency project"). As said, correctly setting up building for this dependency is a major struggle and not my original goal, therefore I d happily ignore these errors. Automatic building is turned off and changing the "Errors/Warnings" settings under "Java Compiler" for the project didn t change a thing, so I m kind of lost now.

Okay, let me try to phrase this as questions:

  1. Maybe I just didn t find it: Is there a way to create a dependency bundle (call it whatever you want) in Eclipse that -- besides just carrying jar-files -- gives me the ability to use the API docs and "jump to" the declaration in the sources?

  2. If not, what s the common practice to do in such a situation?

  3. If the "dependency project" solution is the way to go, how can I completely disable compiler errors for that project?

最佳回答

Check this for illustration with images

Add the source code for jar

Add the Javadoc for a jar

Or just right-click on the jar file in the Package Explorer view. Select "Properties" then set the according paths in the "Java Source Attachment" and the "Javadoc Location" field.

问题回答

When you create user libs via window->preferences->java-build path->user libraries you can specify which jar you need, sources (in archive or folder) && javadoc (from internet, or local, or from archive). Then you can use this lib in your project via context menu on project->Build path->add library->user library-> choose your lib.

Here you acn pick up more info Eclipse help





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签