Skip to content

Commit

Permalink
Fix archetypes module (helidon-io#7803)
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <[email protected]>
  • Loading branch information
tvallin authored and dalexandrov committed Oct 17, 2023
1 parent 6c3d2a6 commit edda695
Show file tree
Hide file tree
Showing 22 changed files with 113 additions and 94 deletions.
6 changes: 3 additions & 3 deletions archetypes/helidon/src/main/archetype/common/extra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<value key="artifactId">helidon-webclient</value>
</map>
</list>
<list key="modules">
<list key="module-requires">
<value>io.helidon.webclient</value>
</list>
<list key="Abstract-tests">
Expand Down Expand Up @@ -102,7 +102,7 @@ java -cp "target/classes:target/libs/*" {{package}}.WebClientMain PORT
<value key="artifactId">helidon-microprofile-metrics</value>
</map>
</list>
<list key="modules">
<list key="module-requires">
<value if="${flavor} == 'mp'">io.helidon.microprofile.faulttolerance</value>
</list>
<list key="maven-plugins" if="${flavor} == 'mp'">
Expand Down Expand Up @@ -151,7 +151,7 @@ java -cp "target/classes:target/libs/*" {{package}}.WebClientMain PORT
<value>jakarta.ws.rs.core.Response</value>
<value>jakarta.ws.rs.HttpMethod</value>
</list>
<list key="modules">
<list key="module-requires">
<value if="${flavor} == 'mp'">io.helidon.microprofile.cors</value>
<value if="${flavor} == 'se'">io.helidon.webserver.cors</value>
<value if="${flavor} == 'se'">io.helidon.cors</value>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
- abac:
# prepares environment
# executes attribute validations
# validates that attributes were processed
# grants/denies access to resource
#
####
# Combinations:
# # Will fail if any attribute is not validated and if any has failed validation
# fail-on-unvalidated: true
# fail-if-none-validated: true
#
# # Will fail if there is one or more attributes present and NONE of them is validated or if any has failed validation
# # Will NOT fail if there is at least one validated attribute and any number of not validated attributes (and NONE failed)
# fail-on-unvalidated: false
# fail-if-none-validated: true
#
# # Will fail if there is any attribute that failed validation
# # Will NOT fail if there are no failed validation or if there are NONE validated
# fail-on-unvalidated: false
# fail-if-none-validated: false
####
# fail if an attribute was not validated (e.g. we do not know, whether it is valid or not)
# defaults to true
fail-on-unvalidated: true
# fail if none of the attributes were validated
# defaults to true
fail-if-none-validated: true
- abac:
# prepares environment
# executes attribute validations
# validates that attributes were processed
# grants/denies access to resource
#
####
# Combinations:
# # Will fail if any attribute is not validated and if any has failed validation
# fail-on-unvalidated: true
# fail-if-none-validated: true
#
# # Will fail if there is one or more attributes present and NONE of them is validated or if any has failed validation
# # Will NOT fail if there is at least one validated attribute and any number of not validated attributes (and NONE failed)
# fail-on-unvalidated: false
# fail-if-none-validated: true
#
# # Will fail if there is any attribute that failed validation
# # Will NOT fail if there are no failed validation or if there are NONE validated
# fail-on-unvalidated: false
# fail-if-none-validated: false
####
# fail if an attribute was not validated (e.g. we do not know, whether it is valid or not)
# defaults to true
fail-on-unvalidated: true
# fail if none of the attributes were validated
# defaults to true
fail-if-none-validated: true
# policy-validator:
# validators:
# - class: "io.helidon.security.abac.policy.DefaultPolicyValidator"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
- atn-token:
jwk.resource.resource-path: "verifying-jwk.json"
jwt-audience: "http://my.service"
- sign-token:
jwk.resource.resource-path: "signing-jwk.json"
jwt-issuer: "http://my.server/identity"
outbound:
- name: "propagate-token"
hosts: ["*.internal.org"]
- name: "generate-token"
hosts: ["1.partner-service"]
jwk-kid: "partner-1"
jwt-kid: "helidon"
jwt-audience: "http://1.partner-service"
- jwt:
atn-token:
jwk.resource.resource-path: "verifying-jwk.json"
jwt-audience: "http://my.service"
sign-token:
jwk.resource.resource-path: "signing-jwk.json"
jwt-issuer: "http://my.server/identity"
outbound:
- name: "propagate-token"
hosts: ["*.internal.org"]
- name: "generate-token"
hosts: ["1.partner-service"]
jwk-kid: "partner-1"
jwt-kid: "helidon"
jwt-audience: "http://1.partner-service"
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

module {{package}} {
{{#modules}}
{{#module-requires}}
requires {{.}};
{{/modules}}
{{/module-requires}}

exports {{package}};

{{#module-opens}}
opens {{package}};
{{/module-opens}}
}
20 changes: 15 additions & 5 deletions archetypes/helidon/src/main/archetype/common/media.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
]]></value>
</list>
<list key="modules">
<list key="module-requires">
<value>jakarta.json</value>
</list>
</model>
Expand All @@ -84,9 +84,15 @@
<value key="artifactId">jersey-media-json-jackson</value>
<value key="scope">runtime</value>
</map>
<map order="500" if="${flavor} == 'mp'">
<value key="groupId">jakarta.xml.bind</value>
<value key="artifactId">jakarta.xml.bind-api</value>
</map>
</list>
<list key="modules">
<list key="module-requires">
<value>com.fasterxml.jackson.annotation</value>
<value>com.fasterxml.jackson.core</value>
<value if="${flavor} == 'mp'">jakarta.xml.bind</value>
</list>
</model>
</output>
Expand Down Expand Up @@ -128,8 +134,9 @@
}
]]></value>
</list>
<list key="modules">
<list key="module-requires">
<value>jakarta.json</value>
<value>jakarta.json.bind</value>
</list>
</model>
</output>
Expand Down Expand Up @@ -162,12 +169,12 @@
<value key="artifactId">jakarta.json-api</value>
</map>
</list>
<list key="modules" if="${flavor} == 'se'">
<list key="module-requires" if="${flavor} == 'se'">
<value>jakarta.json</value>
<value>io.helidon.http.media.multipart</value>
<value>io.helidon.webserver.staticcontent</value>
</list>
<list key="modules" if="${flavor} == 'mp'">
<list key="module-requires" if="${flavor} == 'mp'">
<value>jakarta.json</value>
<value>jersey.media.multipart</value>
</list>
Expand Down Expand Up @@ -199,6 +206,9 @@
}
]]></value>
</list>
<list key="module-requires">
<value if="${flavor} == 'mp'">org.jvnet.mimepull</value>
</list>
</model>
</output>
</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
@Inject
private MetricRegistry registry;]]></value>
</list>
<list key="modules">
<list key="module-requires">
<value>io.helidon.microprofile.metrics</value>
</list>
</model>
Expand Down Expand Up @@ -238,7 +238,7 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
<list key="MainTest-static-imports">
<value>static org.junit.jupiter.api.Assertions.assertEquals</value>
</list>
<list key="modules">
<list key="module-requires">
<value>io.helidon.microprofile.metrics</value>
</list>
</model>
Expand Down Expand Up @@ -276,7 +276,7 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
}
]]></value>
</list>
<list key="modules">
<list key="module-requires">
<value if="${flavor} == 'se'">io.helidon.webserver.observe.metrics</value>
<value if="${flavor} == 'se'">io.helidon.metrics.api</value>
</list>
Expand Down Expand Up @@ -421,7 +421,7 @@ curl -X GET http://localhost:8080/observe/observe/health/ready
]]></value>
</list>
<list key="modules" if="${flavor} == 'se'">
<list key="module-requires" if="${flavor} == 'se'">
<value>io.helidon.webserver.observe.health</value>
<value>io.helidon.health.checks</value>
</list>
Expand Down
45 changes: 20 additions & 25 deletions archetypes/helidon/src/main/archetype/common/security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@
<value key="groupId">io.helidon.security.providers</value>
<value key="artifactId">helidon-security-providers-idcs-mapper</value>
</map>
<map if="${flavor} == 'se'">
<value key="groupId">io.helidon.config</value>
<value key="artifactId">helidon-config-encryption</value>
</map>
</list>
<list key="Main-java-imports" if="${flavor} == 'se'">
<value>java.util.Optional</value>
Expand Down Expand Up @@ -125,20 +121,27 @@
})
.get("/loggedout", (req, res) -> res.send("You have been logged out"))]]></value>
</list>
<list key="modules" if="${flavor} == 'se'">
<list key="module-requires" if="${flavor} == 'se'">
<value>io.helidon.security.providers.oidc</value>
</list>
<list key="modules">
<list key="module-requires">
<value if="${flavor} == 'se'">io.helidon.security</value>
</list>
</model>
</output>
</option>
<option value="jwt" name="JWT" description="JSON Web Token">
<output>
<files>
<directory>files</directory>
<includes>
<include>src/*/resources/**/signing-jwk.json</include>
<include>src/*/resources/**/verifying-jwk.json</include>
</includes>
</files>
<model>
<list key="providers-config-entries">
<value file="files/application.jwt.yaml" if="${flavor} == 'mp'"/>
<value file="files/application.jwt.yaml"/>
</list>
<list key="dependencies">
<map if="${flavor} == 'mp'">
Expand All @@ -162,7 +165,7 @@
<value key="artifactId">helidon-bundles-config</value>
</map>
</list>
<list key="modules">
<list key="module-requires">
<value if="${flavor} == 'se'">io.helidon.webclient.security</value>
<value>io.helidon.security.providers.jwt</value>
<value>io.helidon.webserver.context</value>
Expand Down Expand Up @@ -202,10 +205,6 @@
<value key="groupId">io.helidon.security.providers</value>
<value key="artifactId">helidon-security-providers-google-login</value>
</map>
<map if="${flavor} == 'se'">
<value key="groupId">io.helidon.config</value>
<value key="artifactId">helidon-config-encryption</value>
</map>
<map if="${flavor} == 'se'">
<value key="groupId">io.helidon.bundles</value>
<value key="artifactId">helidon-bundles-config</value>
Expand All @@ -216,11 +215,11 @@
</map>
</list>
<list key="paths-config-entries">
<value><![CDATA[ - path: "/rest/profile"
methods: ["get"]
authenticate: true]]></value>
<value><![CDATA[ - path: "/rest/profile"
methods: ["get"]
authenticate: true]]></value>
</list>
<list key="modules">
<list key="module-requires">
<value>io.helidon.webserver.context</value>
<value>io.helidon.webserver.staticcontent</value>
<value>io.helidon.security.providers.google.login</value>
Expand Down Expand Up @@ -257,12 +256,8 @@
<value key="groupId">io.helidon.config</value>
<value key="artifactId">helidon-config-hocon</value>
</map>
<map if="${flavor} == 'se'">
<value key="groupId">io.helidon.config</value>
<value key="artifactId">helidon-config-hocon</value>
</map>
</list>
<list key="modules" if="${flavor} == 'se'">
<list key="module-requires" if="${flavor} == 'se'">
<value>io.helidon.webclient.http1</value>
<value>io.helidon.common.pki</value>
<value>io.helidon.webserver.context</value>
Expand Down Expand Up @@ -318,9 +313,9 @@
</map>
</list>
<list key="paths-config-entries">
<value if="${flavor} == 'mp'"><![CDATA[ - path: "/simple-greet"
methods: ["get"]
authenticate: true]]></value>
<value if="${flavor} == 'mp'"><![CDATA[ - path: "/simple-greet"
methods: ["get"]
authenticate: true]]></value>
</list>
<list key="config-test" if="${flavor} == 'se'">
<value><![CDATA[
Expand All @@ -341,7 +336,7 @@ security:
{{/paths-config-entries}}
]]></value>
</list>
<list key="modules" if="${flavor} == 'se'">
<list key="module-requires" if="${flavor} == 'se'">
<value>io.helidon.security.integration.common</value>
<value>io.helidon.webserver.security</value>
</list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@
<value key="artifactId">helidon-microprofile-core</value>
</map>
</list>
<list key="modules">
<list key="module-requires">
<value>jakarta.cdi</value>
<value>jakarta.inject</value>
<value>jakarta.ws.rs</value>
<value>io.helidon</value>
<value>io.helidon.microprofile.config</value>
<value>io.helidon.microprofile.server</value>
</list>
<value key="module-opens">true</value>
</model>
</output>
</archetype-script>
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ docker run --rm --name xe -p 1521:1521 -p 8888:8080 -e ORACLE_PWD=oracle wnamele
<value key="scope">runtime</value>
</map>
</list>
<list key="modules">
<list key="module-requires">
<value>jakarta.xml.bind</value>
</list>
<list key="maven-plugins">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</map>
</list>
<list key="microprofile-config-entries">
<value>tracing.service=helidon-service</value>
<value>tracing.service=helidon-tracing-service</value>
<value>tracing.components.web-server.spans.0.name="HTTP Request"</value>
</list>
<list if="${tracing.provider} == 'jaeger'" key="microprofile-config-entries">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<list key="readme-exercise-the-application">
<value file="files/README.md"/>
</list>
<list key="modules">
<list key="module-requires">
<value>jakarta.annotation</value>
<value>jakarta.persistence</value>
<value>jakarta.transaction</value>
Expand Down
Loading

0 comments on commit edda695

Please sign in to comment.