Closed rsoika closed 2 years ago
I am also wondering what the progress on the Jakarta EE Starter is. Last time I asked and provided some of these same suggestions there was a small flurry of activity but no tangible progress followed by a renewed long period of inactivity. Cargo Tracker is winding down. I would like to take an active role in moving this vital project forward in a consistent fashion - ideally utilizing a Maven Archetype and Web UI approach. What are thoughts on this?
If you take a short look at my current jakarta ee 9 template my ideas are as followed:
If each template full fills these requirements we could provide a general startup guide because the setup procedure is always the same:
So this is for Jakarta EE beginners. Jakarta developers with years of experience did not need such a starter help. And we should not think about this group of users if we provide templates and scripts.
In my opinion, Docker is a prerequisite, because every developer has to deploy his application to a container environment at the end. So why not start with it. I find the idea of a single jar file childish, especially with regard to enterprise development.
If we can such a generic basic concept for a Jakarta EE beginners template it would allow us to write one and only one description how to start.
I have created a template project for Jakarta EE 9 and Jakarta EE 9 Servlet container, check the following links.
In these template projects, it includes simple code samples, and maven plugin configs to run the application on varied popular application servers, and full Arquillian testing config for almost all popular application server adapters(if it is supported). More details, check the readme files of these repositories.
I will hopefully be soon joining as a committer to help move some of these things forward. Please stay tuned. I should be issuing an important PR by next weekend to begin to get things rolling forward.
I think it is best to wait a bit to incorporate Jakarta EE 9, until a few more of the implementations have really made it production ready. We are waiting for the same thing in Cargo Tracker. The first priority should be firming up this project a bit first using just Jakarta EE 8.
Yes I totally agree by starting with Jakarat EE8. Its easy to later upgrade the template code to EE9. Have you seen my posting about EE8/EE9? I posted this because I also was a bit confused the last days... https://ralph.blog.imixs.com/2022/01/17/jakarta-ee8-ee9-ee9-1-what/
Here are some thoughts from my side what the templates should focus on.
In general, I think that the templates should be very simple to simplify the entry for newcomers. Of course, Jakarta and Microprofile offers a lot of technologies. However, these should not all be used in every template just because we can.
For example when I think about a super simple Rest API example which sets and gets a Person
object. Than I see separate templates like:
In this way also the documentation (which only should be one README.md) of each Template can be very strait forward and quick to read (which seems today the most important aspect ;-)
Firstly, I hope we can build a project domain model(java version, language, application servers(with Dockfile etc), Jakarta EE version, build tools/scripts(Maven, Gradle, Gradle with Kotlin Script)) with the Maven project model in this project for generating a new JakartaEE/MP project and modifying the project fragments that affect the generated files.
Secondly, this project itself should includes good tests, and run continuous testing on a CI server and publish to a running server as a real project development.
The thirdly, the generated project should contain a readme file with guides linked to some official getting started docs(FirstCup Jakarta EE tutorial is good), and the project should be configured with great tests(eg. Arquillian/Mockito/AssertJ/JUnit5/RestAssured), and configurations to run on application servers/container via simple commands(Cargo Maven plugin, etc).
@hantsy I'm not sure if I understand you correct. Of course, the project should be based on a uniform template model. But I would keep the individual templates as simple as possible. Yes, we can also setup a template with test examples and frameworks for mock and integration testing. But a beginner template should not contain such a things in my opinion.
@rsoika For Jakarta EE, I think only needs add two options for generating deps, Web Profile and Full Profile, and maybe add example options as you described here.
But firstly, I hope this project itself should be fully tested and apply a Github actions to automate the deployment progress.
Some progress to report on this. The initial code example is done: https://github.com/m-reza-rahman/starter. The next step is to add a nice index page. Then I'll convert this into the initial simple Maven Archetype with a readme and a nice GH page. Reviews welcome. I think it's a bit too early for contributions.
My idea is to add in the starter main page some general informations. This would include a short guide how to generate an Maven Archetype. Something like this:
You can generate a custom project template out from each of the projects using a Maven Archetype.
First go into the starter project you like to copy. Than generate a local Maven Archetype:
$ mvn archetype:create-from-project
This will generate a new archetype from the current project. Next navigate to target\generated-sources\archetype and run:
$ mvn install archetype:update-local-catalog
Now the new archetype is installed locally. In the next step you can create a new project with:
$ cd my-project-folder
$ mvn archetype:generate -DarchetypeCatalog=local
Choose the number of your generated project.
Or run:
$ mvn archetype:generate -DarchetypeCatalog=local -DarchetypeGroupId=com.rsoika -DarchetypeArtifactId=hello-world-jakarta9-archetype
Alternately we can provide a shell script to do this.
Some progress to report on this. The initial code example is done: https://github.com/m-reza-rahman/starter. The next step is to add a nice index page. Then I'll convert this into the initial simple Maven Archetype with a readme and a nice GH page. Reviews welcome. I think it's a bit too early for contributions.
It is a Jakarta EE template, not like this eclipse-ee4j/starter which provides REST API and UI to generate a Jakarta EE project.
To come back to my inital thought: If a new young developer clicks on the following page: https://start.jakarta.ee/ He/She will not find much help.
From that 'Starter' page it is impossible to find things like
https://github.com/hantsy/jakartaee9-starter-boilerplate
https://github.com/hantsy/jakartaee9-servlet-starter-boilerplate
Isn't that's the problem?
The idea form Reza and me is to provide a simple easy to understand downloadable set of project templates. Also the content from https://github.com/hantsy/jakartaee9-starter-boilerplate would be very helpful if this information is directly available at start.jakarta.ee
What I am always missing is a documentation explaining the background to a code example. How it's working and what benefits it gives.
I want to point again to one of my own templates about using Metrics in Jakarta EE: https://github.com/rsoika/ralphs-microservices/tree/main/metrics
It's not perfect and maybe you find it childish. But sometimes I have the impression that in the java enterprise world we feel ourself only cool if we show uncommented code - just to show how stupid other people are.
I would like to change this situation. I hope you don't get me wrong
One thing at a time folks. It it’s possible to go from zero to a hundred in a second. I do indeed have all you mentioned in the pipeline, but it will take time. What I could use help on right now is a review of the code example to see if it makes sense as an initial starting point before I move on to creating a nice index page for the example and then the Maven Archetype. The GH page and README will be after that.
Anyway, I’ll just keep moving forward along these lines until I have something that improves upon what is there right now. I’ll then issue the initial PR to replace what’s there currently.
@ivargrimstad, I have now completed the index page for the application to be generated: https://github.com/m-reza-rahman/starter. Could I kindly ask for a review? I would say the first sample application the starter will generate is now done short of significant review feedback. If things seem fine, I will nest the application into the first version of the Maven Archetype next.
Bear in mind, I know the look and feel is quite basic. I am hoping somewhere down the line, perhaps Eclipse Foundation designers could help me improve the look and feel?
I briefly chatted with @jeyvison and decided to move things further forward. I added the Maven Archetype layer with a brief README: https://github.com/m-reza-rahman/starter. Can you please review?
If this all seems OK, the next step is to write a GitHub page and issue the initial PR.
LGTM
Great, I will keep moving forward and hopefully get ready to issue a PR shortly. Before accepting the PR, I suggest creating a 1.0 branch and archiving the current work on the project there. That will allow us to gradually move that work forward while making some progress now with my PR.
@m-reza-rahman that's great. I tested it already, and every thing is fine.
Just one note for an improvement: Why not add the openapi-ui
extension. Than the project comes with a swagger UI which will improve the acceptance for beginners.
For that the following 2 dependencies need to be added:
<!-- Eclipse Microprofile -->
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>3.2</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<!-- swagger -->
<dependency>
<groupId>org.microprofile-ext.openapi-ext</groupId>
<artifactId>openapi-ui</artifactId>
<version>1.1.3</version>
</dependency>
And in the ressource class an openApi annotation to map the localhost:
@OpenAPIDefinition(info = @Info(
title = "JakartaEE Cafe Template",
version = "1.0.0",
contact = @Contact(
name = "Duke",
email = "duke@foo.com")
),
servers = {
@Server(url = "/rest",description = "localhost")
}
)
I would like to hold off adding MicroProfile to the project too heavily for now. One practical issue is that runtimes like GlassFish and WebLogic do not officially support it yet. Another issue is that Jakarta EE/MicroProfile alignment is very far from clear (in fact it is a rather contentious issue). Since this is an official project under EE4J, I think we need to take a more cautious approach than a third part open source initiative.
I think what you are suggesting would be great for the MicroProfile starter.
I hope this is sensible. It’s not ideal, but I think it’s reality at the moment. For now it’s best to remain on solid ground. I am sure it all could be sorted via the Cloud Native for Java initiative soon enough.
Either way for now I have mentioned OpenAPI as a Payara specific extension without adding an explicit MicroProfile dependency. This already raises a challenge in supporting all the major runtimes in a subsequent release of the project beyond just Payara.
Closed due to #77
Hi,
in my current Java Enterprise Project I actually find myself back in this annoying discussion about: Should we use SpringBoot or Jakarta EE? In this discussion, there are these loud claims that Spring Boot is more easy to use, more modern and simply THE standard.
And even inexperienced developers could easily get started with SpringBoot. In fact this is not true and in this mentioned project we have the old problem that the inexperienced developers produce rather more unproductive and non-functional code - especially working with SpringBoot. But SpringBoot has this fancy 'Spring Boot initializr' page to get started.
When I take a look at the Eclispe Jakarte EE Starter Page I found in contrast the following advice:
As a Java EE developer for many years, I am personally fine with that. But is it possible to improve this way how a Jakarta EE project can be started?
Let's assume that a developer today knows Docker & Maven. A modern project setup should look like this:
I have created this simple RestService example based on Jakarta EE 9: https://github.com/rsoika/ralphs-microservices/tree/main/jakarta9 The Jakarta EE 9 artefact in this project can be started with one command. The project runs with Docker ( on Payara or Wildfly or any other Jakata EE server).
I am not sure if this forum is the right place but it seems to be related to https://start.jakarta.ee/
Now my idea is as followed:
Finally we can provide a catalogue listing simple startup templates where each template behaves in the same way and gives also inexperienced developers an easy start.
At the end we could also provide some generator app which generates the users project from a maven archetype and provide a download - similar to the SpringBoot initializr concept.
Let me know what you are thinking about that.
Regards Ralph