forked from helidon-io/helidon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.0 archetypes minor issues : Multiple fix to templates (helidon-io#4556
) * Multiple fix to templates Signed-off-by: tvallin <[email protected]> * readme sections for native image and jlink + enable tests Signed-off-by: tvallin <[email protected]> * readme sections for native image and jlink left over for bare Signed-off-by: tvallin <[email protected]> * readme sections for metrics left over Signed-off-by: tvallin <[email protected]> * remove db mp filter and corresponding unit tests Signed-off-by: tvallin <[email protected]> * fix docker.native-image unresolved properties Signed-off-by: tvallin <[email protected]>
- Loading branch information
1 parent
0a73810
commit 7b8e895
Showing
32 changed files
with
555 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
archetypes/helidon/src/main/archetype/mp/custom/files/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
## Exercise the application | ||
|
||
``` | ||
curl -X GET http://localhost:8080/greet | ||
curl -X GET http://localhost:8080/simple-greet | ||
{"message":"Hello World!"} | ||
``` |
20 changes: 20 additions & 0 deletions
20
archetypes/helidon/src/main/archetype/mp/custom/files/README.native.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Make sure you have GraalVM locally installed: | ||
|
||
``` | ||
$GRAALVM_HOME/bin/native-image --version | ||
``` | ||
|
||
Build the native image using the native image profile: | ||
|
||
``` | ||
mvn package -Pnative-image | ||
``` | ||
|
||
This uses the helidon-maven-plugin to perform the native compilation using your installed copy of GraalVM. It might take a while to complete. | ||
Once it completes start the application using the native executable (no JVM!): | ||
|
||
``` | ||
./target/{{artifactId}} | ||
``` | ||
|
||
Yep, it starts fast. You can exercise the application’s endpoints as before. |
55 changes: 55 additions & 0 deletions
55
...rc/main/archetype/mp/custom/files/src/main/java/__pkg__/SimpleGreetResource.java.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
package {{package}}; | ||
|
||
import java.util.Collections; | ||
|
||
{{#SimpleGreetService-imports}} | ||
import {{.}}; | ||
{{/SimpleGreetService-imports}} | ||
|
||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.inject.Inject; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
import org.eclipse.microprofile.config.inject.ConfigProperty; | ||
|
||
/** | ||
* A simple JAX-RS resource to greet you. Examples: | ||
* | ||
* Get default greeting message: | ||
* curl -X GET http://localhost:8080/simple-greet | ||
* | ||
* The message is returned as a JSON object. | ||
*/ | ||
@Path("/simple-greet") | ||
public class SimpleGreetResource { | ||
{{#SimpleGreetResource-static-fields}} | ||
{{.}} | ||
{{/SimpleGreetResource-static-fields}} | ||
|
||
private final String message; | ||
|
||
@Inject | ||
public SimpleGreetResource(@ConfigProperty(name = "app.greeting") String message) { | ||
this.message = message; | ||
} | ||
|
||
/** | ||
* Return a worldly greeting message. | ||
* | ||
* @return {@link JsonObject} | ||
*/ | ||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String getDefaultMessage() { | ||
return String.format("%s %s!", message, "World"); | ||
} | ||
|
||
{{#SimpleGreetService-methods}} | ||
{{.}} | ||
{{/SimpleGreetService-methods}} | ||
|
||
} |
Oops, something went wrong.