简体   繁体   中英

Which Maven archetype for webapp

I am pretty new to Maven and I have the following question when I shall:

Build a web application (Java EE 6) and use web-services. If I use one of the maven arcetypes I get a src/java/main & src/java/test and a web app folder. This is packaged as a WAR, but can I use webservice API when the package is WAR? How do you use Maven when you want to use all API's and create a web app?

Not sure I'd I understand your question, but the archetype you use to create the project is of no importance. It is a simple way to create some of the artifacts that is needed. If you want to use Webservices add the appropriate dependencies (most likely scoped as 'provided' since your container will already supply the implementation.

If you package it as a WAR you will not be able to use the full EE stack (only servlets) unless you're deploying to a EE6 compliant application server. If you want to use EJBs and REsource Adapters you need to package it as an EAR (EJB supported in WAR as o EE6 as mentioned above).

I think there is an archetype for a "full" EE application as well if you want more modules and packaging :)

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM