Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x: Fix several issue in archetype and add native-image.properties to generated projects #7731

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add javadoc + native-image.properties
Signed-off-by: tvallin <thibault.vallin@oracle.com>
  • Loading branch information
tvallin committed Oct 5, 2023
commit 4617a1f3a824a2362f32f53bd437bd7a69672726
8 changes: 6 additions & 2 deletions archetypes/helidon/src/main/archetype/common/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@
<transformation id="multipart-mustache">
<replace regex="\.multipart.mustache$" replacement=""/>
</transformation>
<templates engine="mustache" transformations="mustache">
<transformation id="native-image">
<replace regex="groupid" replacement="${groupId/\./\/}"/>
<replace regex="artifactid" replacement="${artifactId/\./\/}"/>
</transformation>
<templates engine="mustache" transformations="mustache,packaged">
<directory>files</directory>
<includes>
<include>.helidon.mustache</include>
<include>README.md.mustache</include>
<include>src/main/java/*.java.mustache</include>
<include>src/main/java/**/*.java.mustache</include>
</includes>
</templates>
<model>
Expand Down
11 changes: 10 additions & 1 deletion archetypes/helidon/src/main/archetype/common/docker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@
name="GraalVM Native Image Support"
description="Add a native-image capable Dockerfile to your project"
default="false"
optional="true"/>
optional="true">
<output>
<templates engine="mustache" transformations="mustache,native-image">
<directory>files</directory>
<includes>
<include>src/*/resources/META-INF/**/*.mustache</include>
</includes>
</templates>
</output>
</boolean>
<boolean id="jlink-image" name="JLink Support"
description="Add a JLink capable Dockerfile to your project"
default="false"
Expand Down
3 changes: 0 additions & 3 deletions archetypes/helidon/src/main/archetype/common/extra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ java -cp "target/classes:target/libs/*" {{package}}.WebClientMain PORT
<list key="modules">
<value if="${flavor} == 'mp'">io.helidon.microprofile.faulttolerance</value>
</list>
<list key="Main-other-imports" if="${flavor} == 'mp'">
<value>java.util.concurrent.TimeoutException</value>
</list>
<list key="maven-plugins" if="${flavor} == 'mp'">
<value><![CDATA[
<plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Args=--initialize-at-build-time={{package}}
33 changes: 18 additions & 15 deletions archetypes/helidon/src/main/archetype/mp/common/common-mp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,27 @@
<value key="main-class-javadoc"><![CDATA[
/**
* Main entry point of the application.
* This class is registered as the main class in the jar manifest, as well as the main class of the module.
*/
]]></value>
* This class is required when using modules with Helidon MP.
* Since version 3.1.2, the maven-jar-plugin set module attribute such as `ModuleMainClass`. The main class must be
* in a package that is either exported or opened by the module. This means we cannot reference a built-in class and
* therefore this Main class is created with a simple implementation that calls the built-in one.
* See the Documentation for `--main-class` option used by maven-jar-plugin:
* <a href="https://docs.oracle.com/en/java/javase/21/docs/specs/man/jar.html#operation-modifiers-valid-only-in-create-and-update-modes">documentation</a>
*/]]></value>
<value key="main-method-javadoc"><![CDATA[
/**
* Main method. Starts CDI (and the application).
*
* @param args ignored
*/
]]></value>
/**
* Main method. Starts CDI (and the application).
*
* @param args ignored
*/]]></value>
<list key="main-class-fields">
<value><![CDATA[
/**
* Cannot be instantiated.
*/
private Main() {
}
]]></value>
/**
* Cannot be instantiated.
*/
private Main() {
}
]]></value>
</list>
<list key="main-method-content">
<value><![CDATA[ io.helidon.Main.main(args);]]></value>
Expand Down
23 changes: 11 additions & 12 deletions archetypes/helidon/src/main/archetype/se/common/common-se.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,20 @@ app:
</list>
<value key="main-class-javadoc"><![CDATA[
/**
* The application main class.
*/]]></value>
<value key="main-method-javadoc"><![CDATA[ /**
* The application main class.
*/]]></value>
<value key="main-method-javadoc"><![CDATA[/**
* Application main entry point.
* @param args command line arguments.
*/]]></value>
<list key="main-class-fields">
<value><![CDATA[
/**
* Cannot be instantiated.
*/
private Main() {
}
]]></value>
<value order="0"><![CDATA[
/**
* Cannot be instantiated.
*/
private Main() {
}
]]></value>
</list>
<list key="main-method-content">
<value template="mustache"><![CDATA[
Expand Down Expand Up @@ -146,8 +146,7 @@ private Main() {
{{#Main-routing-builder}}
{{.}}{{#last}}; {{/last}}
{{/Main-routing-builder}}
}
]]></value>
}]]></value>
</list>
</model>
</output>
Expand Down