Giter Club home page Giter Club logo

maven-archetype-jakartaee9's Introduction

Maven archetype for Jakarta EE 9

This project provides a simple Maven archetype for generating a Jakarta EE 9 project.

The work of this project is being ported to Eclipse EE4J Starter, see: eclipse-ee4j/starter#63.

Guide

Generate a Jakarta EE 9 project skeleton from Maven archetype

Prerequisites

  • Java 8 +
  • Apache Maven 3.6

Generate a Jakarta EE 9 project

This archetype is uploaded the Maven Central Repository.

Using the following command to generate a Jakarta EE 9 project skeleton.

mvn -B  archetype:generate \
-DarchetypeGroupId=io.github.hantsy \
-DarchetypeArtifactId=maven-archetype-jakartaee9  \
-DarchetypeVersion=1.0  \
-DgroupId=com.example \
-Dpackage=com.example.demo \
-DartifactId=myapp \
-Dversion=1.0-SNAPSHOT 

I also uploaded a snapshot version to Github Packages. If you want to use the latst snapshot version. Add the follwing repositories settings in your ~/.m2/settings.xml.

<repositories>
  <repository>
    <id>github-public</id>
    <url>https://public:&#48;[email protected]/hantsy/*</url>
  </repository>
</repositories>

Once the project is generated, switch to the project root.

Run the application using the following command.

mvn clean package cargo:run

It will download a copy of Glassfish v6.0, and create a new domain for this project and start it immediately. After the Glassfish is running, then deploy the packaged application on the Glassfish.

Try to test the sample REST API endpoint.

curl http://localhost:8080/myapp/api/greeting/JakartaEE

It is a quick way to experience the Jakarta EE 9 stack.

To run the sample testing codes.

Firstly make sure there is a running Glassfish server. Then run the following command.

mvn clean verify -DskipTests=false

Build

If you want to explore the source codes or contribute this project, follow the below steps to build the project.

  1. Checkout the source codes.

    git clone https://github.com/hantsy/maven-archetype-jakartaee9
  2. Then build the project.

    mvn clean install

Resources

maven-archetype-jakartaee9's People

Contributors

hantsy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lcua-cup hagonma

maven-archetype-jakartaee9's Issues

Hello example

Hi, Thanks for sharing this example. I am sure I have the Glassfish container server running:
After I did mvn clean package cargo:run, I tried the endpoint:

http://localhost:8080/myapp/api/greeting/JakartaEE

Returns with:

{"message":"Say Hello to JakartaEE at 2021-10-07T14:15:07.938482"}

At the same time, since the container is running, I try mvn clean verify -DskipTests=false
but then I get:

Running com.example.demo.GreetingResourceTest
Oct 07, 2021 2:14:58 PM com.example.demo.GreetingResourceTest testGreeting
INFO:  client: null, baseURL: null
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.042 sec <<< FAILURE!
com.example.demo.GreetingResourceTest.testGreeting()  Time elapsed: 0.041 sec  <<< FAILURE!
java.net.MalformedURLException: no protocol: api/greeting/JakartaEE
	at java.base/java.net.URL.<init>(URL.java:627)
	at java.base/java.net.URL.<init>(URL.java:523)
	at com.example.demo.GreetingResourceTest.testGreeting(GreetingResourceTest.java:83)
...

Looks like client:null and baseURL:null can be the source of why the tests fail. I would really appreciate if you could help me with this. Any idea about what I did wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.