Build multiple project configurations with eclipse

2019-07-04 17:11发布

问题:

Is there a way to make Eclipse able to export multiple configurations of a single project?

My problem is the following:

I have several java web applications which I develop in Eclipse. Before I put new versions onto my production server I publish the new versions to a test server, where the apps run with a slightly different configuration (database server name, etc.).

Is there a way to something like 'export war for TEST env' and 'export war for PROD env'? Eclipse only would have to take another properties file...

I guess there is a way, I just can't figure it out.

Any ideas / hints ?

回答1:

There are actually plugins for this out there:

Maven4Eclipse



回答2:

You would get much better results by having an Ant or Maven build.

These are build systems, rather than IDEs, so all you have to do is run a shell command, with parameters, if needed.


Update: as for the question of integrating Ant or Maven with Eclipse, see my answer on Best way to share jars across multiple projects.