I post here because I question myself about the structure of a future project.
I will wish to make a Java EE application by following the same model as the major software such as Jenkins / Hudson, which provide a .war/ear deployable and which embeds their own database and plugin management.
The final goal is that the user download and deploy the war/ear “ready-to-use”
My questions are :
-
I want to use EJB, how should I structure my project into my IDE ? core-project + war-project ?
-
When i want to use an embedded database HSQL or Derby style, the tutorials I’ve found indicates that I have to addesome jar / xml in my container which is against the “ready-to-use” idea.
-
Last question, and not least, a plugin that will come in the form of a jar, how it can be used by my application? Some idea/tutorials about this plugins management in my case are welcome.
This project is for educational purposes.
In Java EE there are more or less two schools that advocate different approaches.
The first school, the traditional school, advocates that Java EE applications should always be incomplete, e.g. having “unresolved dependencies”. A chain of persons (roles), from application packager to deployer then gradually and iteratively prepares the application to be actually runnable.
This school shuns having embedded data source definitions, security (mainly authentication) and JMS queues (even if those last ones are completely internal to the application) inside an application archive. According to some members of this first school, applications containing these are not Java EE applications anymore (see e.g. https://community.jboss.org/thread/164554)
But there’s also another school, one that’s of the opinion that there exist use cases where having all of these in a Java EE archive is actually the best way. The fact that
@DataSourceDefinitionwas added to the spec is indicative of this, and Java EE 7 will standardize the embedding of additional types of resources (like JMS queues).These two blog posts describes a Java EE example that use an embedded database:
In many application servers, the idea of embedded standardized datasources is a bit of an afterthought, and is most likely not covered by the TCK. To sum up, support is currently as follows: