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

3.x Fix deps in jpa examples and do other cleanup #4132

Merged
merged 3 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
3 changes: 2 additions & 1 deletion etc/copyright-exclude.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
.MD
.p12
.txt
.sql
jaxb.index
/MANIFEST.MF
/README
Expand Down Expand Up @@ -53,4 +54,4 @@ target/
.git/
META-INF/services/
persistence_3_0.xjb
persistence_3_0.xsd
persistence_3_0.xsd
23 changes: 11 additions & 12 deletions examples/integrations/cdi/jpa/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2019, 2021 Oracle and/or its affiliates.
Copyright (c) 2019, 2022 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -92,17 +92,6 @@
<scope>runtime</scope>
</dependency>

<!-- Provided-scoped dependencies. -->
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- Compile-scoped dependencies. -->
<dependency>
Expand All @@ -125,6 +114,16 @@
<artifactId>jakarta.ws.rs-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2019, 2021 Oracle and/or its affiliates.
Copyright (c) 2019, 2022 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,10 +17,10 @@

-->
<persistence version="2.2"
barchetta marked this conversation as resolved.
Show resolved Hide resolved
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence
https://jakarta.ee/xml/ns/persistence/persistence_2_2.xsd">
barchetta marked this conversation as resolved.
Show resolved Hide resolved
<persistence-unit name="test" transaction-type="JTA">
<jta-data-source>test</jta-data-source>
<class>io.helidon.examples.integrations.cdi.jpa.Greeting</class>
Expand Down
10 changes: 10 additions & 0 deletions examples/integrations/cdi/pokemons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ mvn package
java -jar target/helidon-integrations-examples-pokemons-jpa.jar
```

## Exercise the application

```
curl -X GET http://localhost:8080/pokemon
[{"id":1,"type":12,"name":"Bulbasaur"}, ...]
curl -X GET http://localhost:8080/type
[{"id":1,"name":"Normal"}, ...]
curl -H "Content-Type: application/json" --request POST --data '{"id":100, "type":1, "name":"Test"}' http://localhost:8080/pokemon
```

---

Pokémon, and Pokémon character names are trademarks of Nintendo.
25 changes: 16 additions & 9 deletions examples/integrations/cdi/pokemons/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2020, 2021 Oracle and/or its affiliates.
Copyright (c) 2020, 2022 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,6 +53,15 @@
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
</dependency>


<!-- Runtime-scoped dependencies. -->
<dependency>
Expand Down Expand Up @@ -106,17 +115,15 @@
<artifactId>microprofile-config-api</artifactId>
<scope>runtime</scope>
</dependency>

<!-- Provided-scoped dependencies. -->
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<scope>provided</scope>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<scope>provided</scope>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<scope>runtime</scope>
</dependency>

<!-- Test-scoped dependencies. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
* Copyright (c) 2020 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

INSERT INTO POKEMONTYPE VALUES (1, 'Normal');
INSERT INTO POKEMONTYPE VALUES (2, 'Fighting');
INSERT INTO POKEMONTYPE VALUES (3, 'Flying');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2020, 2021 Oracle and/or its affiliates.
Copyright (c) 2020, 2022 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,10 +17,10 @@

-->
<persistence version="2.2"
barchetta marked this conversation as resolved.
Show resolved Hide resolved
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence
https://jakarta.eee/xml/ns/persistence/persistence_2_2.xsd">
barchetta marked this conversation as resolved.
Show resolved Hide resolved
<persistence-unit name="test" transaction-type="JTA">
<jta-data-source>test</jta-data-source>
<class>io.helidon.examples.integrations.cdi.pokemon.Pokemon</class>
Expand Down