I have an eclipse dynamic web application project running on tomcat. The app is not using maven and I want to change it to maven. I can use eclipse' built-in feature like configure--> convert to maven to change it into a maven project, by doing that I found the "earth" icon (which shows it is a web application) disappeared and the "M" maven icon appears and it auto creates a pom.xml for me to edit. I am wondering how about a different approach -- Instead of using this eclipse built feature, can I simply add a pom.xml to the build and add folders like "target", in my pom.xml, I can specify the source and destination folder, etc, then I run maven install to create .war file. This way I maintain the project as a web application project. Which approach would be better ? If you think the 2nd approach wouldn't work please explain. Thanks.
Tim Moores wrote:What drawbacks do you see in converting it to a maven project? If the tool does the work for you, why fight it?
When you first created a dynamic web project in eclipse. You can deploy it this way to Tomcat --- Right click the server, Add and Remove project, drop the web app to the right side , then publish and start server.
After you use eclipse tool to convert it to maven project, it seems the project is no longer a dynamic web project (the earth icon is gone), and when you right click server to do add and remove project, you don't see that original web app anymore. I want to maintain the flexibility of deploying in old way but make the project be a maven.
If you do a quick try you may see what I mean. BTW, how do you deploy that web app after you convert it to maven project ?
Not sure if this issue is directly related to this thread but I just ask anyway --- While my log4j.xml works well with rolling and other logging stuff, I am still struggling with the question how to get those open source library (like spring, hibernate, etc) logging into the log file I specified in log4j.xml. I have set
but no luck. they all go to system out. I remember once someone questioned maybe these framework do not use log4j. But I do see some code example that using these frameworks and they set logger for them like how I set.. Wondering how it worked for them.
BTW, I used log4j-1.2.17 and org.apache.log4j.Logger in java.
Tim Holloway wrote:Yes, that's a problem in complex systems that use libraries from many sources. A log aggregator such as slf4j can handle the job of re-routing all those other log API requests into log4j.
Thanks. Could you give some resource link that talks about using slf4j to route open source ?
I forget where I got this. And the version numbers may be old. You may need to do some dependency foo, since it was rather sensitive to the versions of the components that interacted with it as I recall.
Note that there are 2 dependencies here. The slf4j API provides the standard interceptors for the different loggers. Then the slg4j log4j12 backend routes them through log4j. Other backends can also be used if you prefer to write your logs via some other logging framework.
Bjoke: A "Bully Joke". A Statement or action made with malicious intent - unless challenged. At which point it magically transforms into "I was just funnin'" or "What's the matter, can't take a joke?"
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop