netbeans - What are "Java EE 7 API Library" and "Java EE Web 7 API Library" and when to use them? -
i have full-fledged java ee project running on glassfish 4.1 / java ee 7 (netbeans 8.0.2) not using apache maven.
depending upon project functionality, cdi dependency has added both projects/modules namely ee module , web module (and class library, if any).
i have been confusing long time seeing people recommending add either "java ee 7 api library" or "java ee web 7 api library" compile-time class-path cdi dependency (these libraries bundled in netbeans , readily available out of box, when using netbeans).
since these libraries contain collection of apis possibly entire java ee stack starting servlet api, adding 1 of these libraries compile-time class-path (especially in ee project) not make sense, when cdi functionality needed in java ee applications.
why suggested many times in netbeans projects add 1 of these libraries, when cdi-api.jar
cdi dependency sufficient?
i not find canonical answer on site nor somewhere else library added in netbeans projects, when cdi functionality required in java ee applications. adding cdi-api.jar
goes fine, way.
all of javaee-api
, javaee-web-api
, cdi-api
api definitions. not contain functinality, contain necessary interfaces instead make code compile. result none of javaee-api
nor javaee-web-api
should included in application included application server. implementation provided application server, quite big, on 100mb of libraries.
if application depends on cdi, free put cdi-api
dependency. if want more javaee, better choose 1 of profiles (full or web). however, mind server provides @ least api included in web profile, therefore worth consider using too. picking dependencies selectively worth application servers, not support java ee (e.g. tom ee). in case, need include implementation application or put inside server.
Comments
Post a Comment