views:

80

answers:

1

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 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

+1  A: 

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.

Carl Smotricz
Your scenario might be a nice solution but only if you start a new project or have the power to actually cause a redesign.I'm new to a team which deals with the development of this application for quite a while. So the structure is fixed. The whole application is quite complex and I got a copy of a workspace and the eclipse folder as well. Unfortunately this copies on my PC don't act like they do on my colleague PC. All configs are maintained but publishing to the local server fails. Its a JBoss Community Server 4.2.0. Then adding the project to a new normal JBoss 4.2 publishing works fine.
I see. Well, I'm sorry but I don't have a better answer.
Carl Smotricz