I am currently migrating our build process from Eclipse/Ant to Maven/M2Eclipse/Artifactory. I have a Webapp as a WTP project in Eclipse. I have migrated it to Maven with m2eclipse.
The compilation runs fine from the Eclipse IDE.
However, when I try to compile from Maven CLI (mvn clean & mvn compile
), Maven complains about not finding the libraries provided by the Tomcat Environment (like annotations-api, servlet-api, etc, ...).
Fair enough : Indeed, these dependencies are provided by WTP, as Java resources / Libraries / ApacheTomcat6
. Maven is not aware of them.
I could deactivate this in the build path, and add each corresponding dependency in my POM, but I'm afraid this would lead Maven to deploy them again in my webapp (WEB-INF/libs
).
So, what is the good way to say to maven "this application will run in a well known environment, providing the following libraries ". Is there some common Tomcat POM that I could add as a dependency ?
Thanks in advance for your advice. regards,
Raphael