Eclipse .classpath file. How to control server name entry?
I'm using Eclipse Galileo with a kind of well known plugins to develop Java Enterprise Applications. Now having a Java Project, Eclipse writes the following line to the .classpath file in the projects root folder:
<classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.generic.runtimeTarget/JBoss v4.2"/>
Now I'm wondering where does Eclipse get the information about the server 开发者_Go百科name from?
I opened the Server Runtime Environment (Window->Preferences->Server->Runtime Environment
) and added a new Server (Jboss v4.2 - as the classpath-entry shows). Creating a new local server I can provide a name for it and added it to the Java Build Path of the project. But I need to manipulate the name in the Runtime Environment since the classpath entry seems to refer to that.
Why am I bothering? I need to be able to have control of the entry in the .classpath file since the project folder is being shared using subversion ...
I hope you get the idea - thanks a lot in advance
The Runtime Environment wizard is very convenient for a single developer. With the click of a button he can define a server environment which includes a pre-configured library of JAR files that need to go on the classpath to support that particular server.
Unfortunately, this environment does not become part of your application; sharing the project only works if other users have exactly the same environment defined, under the same name.
Where I work, we mitigate the problem by creating a /lib
directory in the project and including in it all the JARs required by the project at runtime, including the server-specific JARs. In some cases, there are JARs only required at build/compile time, and these can either also go into /lib (which bloats the deployed project) or into a separate directory, say /build/lib
. Of course this /lib directory is also checked into source control - but we don't have a problem with the transfer sizes.
Given such a setup, you can modify the "libraries" entries in the project's build path to use only the files in your manually created libs, and remove the dependency on the locally installed server environment.
精彩评论