Adarsh Singh
Adarsh Singh

Reputation: 9

Can we configure the folders to be deployed in respective places in webapp directory in Tomcat?

I have a web project where the structural architecture is not standard like following

- src
  - main
  - test
- Web-INF
etc.

The folders are pretty random and we were using ant to manually copy class files and jars from respective locations to webapp folder inside Tomcat and pasting in respective places.

Is there a way in tomcat itself which lets us configure what and where to pick the files for respective folders inside webapps?

Upvotes: 0

Views: 34

Answers (1)

Olaf Kock
Olaf Kock

Reputation: 48087

I'm not aware of such an option, and would be severely confused if I came new into an organization that did this. The layout of a web application is pretty much standardized, and there's not much benefit from reinventing the wheel. I feel that personal effort is better spent elsewhere than configuring runtime environments in a way that new people on the team need an intense onboarding and unlearn whatever they've learned about the technology.

You're not stating a reason for your code to be in that organization - but the use of Ant makes me expect that it's been this way for a pretty long time. Is the build process a pain? What problem would you expect to solve with a nonstandard layout on tomcat?

If I can prescribe something: Don't go this route, stick with the standard. If the difference between your source tree and the final WAR file bothers you: Change the source tree organization. But really, it doesn't matter: The source should be organized in a way that makes sense for the source, the build process is there so that you don't need to think twice about the deployment format. It's a non-issue.

Upvotes: 1

Related Questions