diff --git a/.github/workflows/build_deploy_edge.yml b/.github/workflows/build_deploy_edge.yml
index 1681d91a..0d6a5d22 100644
--- a/.github/workflows/build_deploy_edge.yml
+++ b/.github/workflows/build_deploy_edge.yml
@@ -45,6 +45,26 @@ jobs:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
+ - name: Get CodeArtifact Repository Authentication Token
+ run: |
+ TOKEN=$(aws codeartifact get-authorization-token \
+ --domain ${{ vars.CODEARTIFACT_DOMAIN }} \
+ --domain-owner ${{ steps.aws_auth.outputs.aws-account-id }} \
+ --region ${{ vars.AWS_REGION }} \
+ --query authorizationToken \
+ --output text)
+ echo "CODEARTIFACT_AUTH_TOKEN=$TOKEN" >> "$GITHUB_ENV"
+
+ - name: Get CodeArtifact Repository URL
+ run: |
+ REPO_URL=$(aws codeartifact get-repository-endpoint \
+ --domain ${{ vars.CODEARTIFACT_DOMAIN }} \
+ --repository ${{ vars.CODEARTIFACT_REPO }} \
+ --format maven \
+ --region ${{ vars.AWS_REGION }} \
+ --output text)
+ echo "CODEARTIFACT_REPO_URL=$REPO_URL" >> "$GITHUB_ENV"
+
- name: Build with Maven
run: mvn -B verify --file pom.xml
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 510aa52f..2c6f9c38 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -40,6 +40,36 @@ jobs:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
+ server-id: 'codeartifact'
+ server-password: 'CODEARTIFACT_AUTH_TOKEN'
+
+ - name: Configure AWS Credentials
+ id: aws_auth
+ uses: aws-actions/configure-aws-credentials@v4
+ with:
+ audience: sts.amazonaws.com
+ aws-region: ${{ vars.AWS_REGION }}
+ role-to-assume: ${{ vars.AWS_ROLE_ARN }}
+
+ - name: Get CodeArtifact Repository Authentication Token
+ run: |
+ TOKEN=$(aws codeartifact get-authorization-token \
+ --domain ${{ vars.CODEARTIFACT_DOMAIN }} \
+ --domain-owner ${{ steps.aws_auth.outputs.aws-account-id }} \
+ --region ${{ vars.AWS_REGION }} \
+ --query authorizationToken \
+ --output text)
+ echo "CODEARTIFACT_AUTH_TOKEN=$TOKEN" >> "$GITHUB_ENV"
+
+ - name: Get CodeArtifact Repository URL
+ run: |
+ REPO_URL=$(aws codeartifact get-repository-endpoint \
+ --domain ${{ vars.CODEARTIFACT_DOMAIN }} \
+ --repository ${{ vars.CODEARTIFACT_REPO }} \
+ --format maven \
+ --region ${{ vars.AWS_REGION }} \
+ --output text)
+ echo "CODEARTIFACT_REPO_URL=$REPO_URL" >> "$GITHUB_ENV"
- name: Build with Maven
run: mvn clean -B verify --file pom.xml
diff --git a/.mvn/codeartifact.env b/.mvn/codeartifact.env
new file mode 100644
index 00000000..a53b2773
--- /dev/null
+++ b/.mvn/codeartifact.env
@@ -0,0 +1,5 @@
+CA_DOMAIN=central-aodn-org-au
+CA_DOMAIN_OWNER=851725428481
+CA_REGION=ap-southeast-2
+CA_DURATION_SECONDS=43200
+CA_REPOSITORY=maven-aodn-store
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 00000000..7d479520
--- /dev/null
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1,3 @@
+wrapperVersion=3.3.4
+distributionType=only-script
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
diff --git a/README.md b/README.md
index 79f2aec4..f4ffd3b1 100644
--- a/README.md
+++ b/README.md
@@ -54,6 +54,31 @@ The server module contains the implementation of those interfaces, for details p
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| score | The min score value of the return record, the higher the value, the more relevance it will be. By default the score isn't set, it is Elastic Search field not STAC field |
+# Use AWS CodeArtifact
+We are using AWS CodeArtifact to get stacmodel dependency deployed by es-indexer.
+
+Since AWS CodeArtifact is private repository, and AWS CodeArtifact doesn't support direct mvn login,
+
+So, please use:`./mvnw-ca install` to instead`mvn install` for dependency installation at root of the project.
+
+Before running `./mvnw-ca install`, please make sure you have settings.xml in your ~/.m2 folder.
+If not, run the following command:
+```bash
+cd ~/.m2
+cat > settings.xml << 'EOF'
+
+
+
+
+ codeartifact
+ aws
+ ${env.CODEARTIFACT_AUTH_TOKEN}
+
+
+
+
+EOF
+```
# Sort
diff --git a/mvnw-ca b/mvnw-ca
new file mode 100755
index 00000000..aa3be595
--- /dev/null
+++ b/mvnw-ca
@@ -0,0 +1,40 @@
+#!/usr/bin/env sh
+# mvnw-ca: fetch AWS CodeArtifact token and repo URL
+
+[ -f ".mvn/codeartifact.env" ] && . ".mvn/codeartifact.env"
+
+if command -v aws >/dev/null 2>&1 &&
+ [ -n "${CA_DOMAIN:-}" ] && [ -n "${CA_DOMAIN_OWNER:-}" ] && [ -n "${CA_REGION:-}" ]; then
+
+ # Get auth token if not set
+ if [ -z "${CODEARTIFACT_AUTH_TOKEN:-}" ]; then
+ CA_DURATION_SECONDS="${CA_DURATION_SECONDS:-43200}"
+ CODEARTIFACT_AUTH_TOKEN="$(
+ aws codeartifact get-authorization-token \
+ --domain "$CA_DOMAIN" \
+ --domain-owner "$CA_DOMAIN_OWNER" \
+ --region "$CA_REGION" \
+ --duration-seconds "$CA_DURATION_SECONDS" \
+ --query authorizationToken --output text 2>/dev/null || true
+ )"
+ export CODEARTIFACT_AUTH_TOKEN
+ fi
+
+ # Get repository URL if not set
+ if [ -z "${CODEARTIFACT_REPO_URL:-}" ] && [ -n "${CA_REPOSITORY:-}" ]; then
+ CODEARTIFACT_REPO_URL="$(
+ aws codeartifact get-repository-endpoint \
+ --domain "$CA_DOMAIN" \
+ --domain-owner "$CA_DOMAIN_OWNER" \
+ --repository "$CA_REPOSITORY" \
+ --region "$CA_REGION" \
+ --format maven \
+ --query repositoryEndpoint --output text 2>/dev/null || true
+ )"
+ export CODEARTIFACT_REPO_URL
+ else
+ echo
+ fi
+fi
+
+exec mvn "$@"
diff --git a/pom.xml b/pom.xml
index 2eb0c234..b4f27c51 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,6 +36,10 @@
repo.osgeo.org
https://repo.osgeo.org/repository/release/
+
+ codeartifact
+ ${env.CODEARTIFACT_REPO_URL}
+
common
@@ -175,6 +179,11 @@
log4j-layout-template-json
2.24.3
+
+ au.org.aodn
+ stacmodel
+ 0.0.52
+
diff --git a/server/pom.xml b/server/pom.xml
index 2237b46b..10294ba7 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -187,6 +187,10 @@
org.apache.logging.log4j
log4j-layout-template-json
+
+ au.org.aodn
+ stacmodel
+
org.springframework.boot
spring-boot-starter-test
diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/model/ThemeModel.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/model/ThemeModel.java
index 1a2adbcf..9b22ff1e 100644
--- a/server/src/main/java/au/org/aodn/ogcapi/server/core/model/ThemeModel.java
+++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/model/ThemeModel.java
@@ -1,10 +1,10 @@
package au.org.aodn.ogcapi.server.core.model;
+import au.org.aodn.stac.model.Citation;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
-
import java.util.List;
@Data
@@ -15,4 +15,9 @@ public class ThemeModel {
protected String scheme;
protected List concepts;
+ // This is just a test to make sure the stac model can be used in this module, we can remove it when all the stac models are using the stacmodel from es-indexer
+ private void testStacmodelReference() {
+ Citation citation = Citation.builder().build();
+ }
+
}