문제

When you create a tomcat project in eclipse, it puts the server.xml file under Servers, which appears as a separate "Project" in the project explorer. My question is, how best to check this into source code control, so that when another user attempts to check out the project, the server.xml file is in the correct place.

I currently use the Perforce version control system, but I've experienced the same issue in the past with other systems.

It's been my experience that other users will end up creating their own tomcat server in eclipse, and then they will have to copy in the custom server.xml.

The best I've been able to do is save the server.xml into the WEB-INF or other directory inside the project, and then update that to source code control. However, this introduces risk, because you have to remember to save your server.xml changes back to WEB-INF. Not to mention that you have to document the copying of the server.xml as a setup step for users creating your project.

도움이 되었습니까?

해결책

I would create a folder under the web app project like etc/ where I'd put a big README and a hard link to the server.xml. So anyone checking out the project would be instructed to do the same (in the README) - and all changes to the server.xml would be versioned. I would not mess with WEB-INF - the server.xml has no place there.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top