You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by sh...@apache.org on 2022/11/11 05:18:25 UTC
[incubator-teaclave-java-tee-sdk] 45/48: [sdk] Update JavaEnclave archetype and readme.md
This is an automated email from the ASF dual-hosted git repository.
shaojunwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-java-tee-sdk.git
commit 990d99b0bf0a66fd866df4b8fd351e7ac09e4959
Author: jeffery.wsj <je...@alibaba-inc.com>
AuthorDate: Tue Oct 11 11:21:38 2022 +0800
[sdk] Update JavaEnclave archetype and readme.md
Summary: Refactor readme.md and archetype project structure.
Test Plan: all tests pass
Reviewers: lei.yul, cengfeng.lzy, sanhong.lsh
Issue: https://aone.alibaba-inc.com/task/45402810
CR: https://code.aone.alibaba-inc.com/java-tee/JavaEnclave/codereview/10357087
---
README.md | 8 ++++----
archetype/src/main/resources/archetype-resources/common/pom.xml | 2 +-
archetype/src/main/resources/archetype-resources/enclave/pom.xml | 4 ++--
archetype/src/main/resources/archetype-resources/host/pom.xml | 4 ++--
archetype/src/main/resources/archetype-resources/pom.xml | 6 +++---
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index f63c6d2..e2fbb77 100644
--- a/README.md
+++ b/README.md
@@ -68,13 +68,13 @@ Teaclave-java-tee-sdk Docker provides a compilation and deployment environment f
Teaclave-java-tee-sdk provides a java confidential computing archetype project to help us create a basic project structure.
-`mvn archetype:generate -DgroupId=com.sample.helloworld -DartifactId=helloworld -DarchetypeGroupId=org.apache.teaclave.javasdk -DarchetypeArtifactId=javaenclave-archetype -DarchetypeVersion=0.1.0 -DinteractiveMode=false`
+`mvn archetype:generate -DgroupId=com.sample -DartifactId=helloworld -DarchetypeGroupId=org.apache.teaclave.javasdk -DarchetypeArtifactId=javaenclave-archetype -DarchetypeVersion=0.1.0 -DinteractiveMode=false`
archetype creates a maven project with three submodules, a host submodule enclave submodule, and a common submodule.
#### 2. Define enclave service interface in the common submodule
-`cd helloworld/common/src/main/java/com/sample/helloworld/` and create a common package in this submodule `mkdir common`.
+`cd helloworld/common/src/main/java/com/sample/` and create a common package in this submodule `mkdir -p helloworld/common`.
then create a Service.java file to define an enclave service interface.
@@ -93,7 +93,7 @@ Note that we have to annotate this service interface with `@EnclaveService` whic
#### 3. Create enclave service interface provider in enclave submodule
-`cd helloworld/enclave/src/main/java/com/sample/helloworld` and create an enclave package in this submodule `mkdir enclave`.
+`cd helloworld/enclave/src/main/java/com/sample/` and create an enclave package in this submodule `mkdir -p helloworld/enclave`.
then create ServiceImpl.java to implement the service interface defined in the common package.
@@ -116,7 +116,7 @@ Note that we have to annotate this class with the annotation `@AutoService(Inter
#### 4. Develop host submodule to create and invoke enclave service
-`cd helloworld/host/src/main/java/com/sample/helloworld` and create an host package in this submodule `mkdir host`.
+`cd helloworld/host/src/main/java/com/sample/` and create an host package in this submodule `mkdir -p helloworld/host`.
then create Main.java to show how to create and invoke an enclave service.
diff --git a/archetype/src/main/resources/archetype-resources/common/pom.xml b/archetype/src/main/resources/archetype-resources/common/pom.xml
index 99ab92d..19166bf 100644
--- a/archetype/src/main/resources/archetype-resources/common/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/common/pom.xml
@@ -1,6 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
+ <groupId>${groupId}.${rootArtifactId}</groupId>
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
diff --git a/archetype/src/main/resources/archetype-resources/enclave/pom.xml b/archetype/src/main/resources/archetype-resources/enclave/pom.xml
index a7eb50f..925d297 100644
--- a/archetype/src/main/resources/archetype-resources/enclave/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/enclave/pom.xml
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
+ <groupId>${groupId}.${rootArtifactId}</groupId>
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
@@ -153,7 +153,7 @@
<artifactId>enclave</artifactId>
</dependency>
<dependency>
- <groupId>${groupId}</groupId>
+ <groupId>${groupId}.${rootArtifactId}</groupId>
<artifactId>common</artifactId>
</dependency>
<dependency>
diff --git a/archetype/src/main/resources/archetype-resources/host/pom.xml b/archetype/src/main/resources/archetype-resources/host/pom.xml
index 9c76841..2940570 100644
--- a/archetype/src/main/resources/archetype-resources/host/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/host/pom.xml
@@ -1,6 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
+ <groupId>${groupId}.${rootArtifactId}</groupId>
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
@@ -70,7 +70,7 @@
<artifactId>host</artifactId>
</dependency>
<dependency>
- <groupId>${groupId}</groupId>
+ <groupId>${groupId}.${rootArtifactId}</groupId>
<artifactId>common</artifactId>
</dependency>
<dependency>
diff --git a/archetype/src/main/resources/archetype-resources/pom.xml b/archetype/src/main/resources/archetype-resources/pom.xml
index f3f70ea..c0acba7 100644
--- a/archetype/src/main/resources/archetype-resources/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/pom.xml
@@ -30,17 +30,17 @@
<version>0.1.0</version>
</dependency>
<dependency>
- <groupId>${groupId}</groupId>
+ <groupId>${groupId}.${artifactId}</groupId>
<artifactId>common</artifactId>
<version>${version}</version>
</dependency>
<dependency>
- <groupId>${groupId}</groupId>
+ <groupId>${groupId}.${artifactId}</groupId>
<artifactId>enclave</artifactId>
<version>${version}</version>
</dependency>
<dependency>
- <groupId>${groupId}</groupId>
+ <groupId>${groupId}.${artifactId}</groupId>
<artifactId>host</artifactId>
<version>${version}</version>
</dependency>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org