Skip to content

Commit 652ec45

Browse files
Merge pull request #30 from Ensono/feat/upgrades-new-publish
feat: upgrades packages, moves to Ensono
2 parents b02f3a3 + c7ae1d2 commit 652ec45

File tree

23 files changed

+6068
-666
lines changed

23 files changed

+6068
-666
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: maven
4+
directory: "/java"
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
timezone: Europe/London
9+
open-pull-requests-limit: 10
10+
rebase-strategy: disabled

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
.gradle
1010

11+
gpg_private_key.asc
12+
13+
settings.xml
14+
1115
java/target/
1216
api-tests/target
1317
java/build/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Amido
3+
Copyright (c) 2024 Ensono
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 9 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## Module Overview
44

5-
This module provides common code used by more than one of the Stacks modules: Both [Events](https://github.com/amido/stacks-java-core-messaging/)
6-
and [CQRS Commands](https://github.com/amido/stacks-java-core-cqrs/) use the `OperationsContext` abstract
5+
This module provides common code used by more than one of the Stacks modules: Both [Events](https://github.com/Ensono/stacks-java-core-messaging/)
6+
and [CQRS Commands](https://github.com/Ensono/stacks-java-core-cqrs/) use the `OperationsContext` abstract
77
class and `StacksPersistence` provides a basic CRUD repository interface used in persistence related
8-
modules like[Stacks Cosmos](https://github.com/amido/stacks-java-cosmos). Please refer to these
8+
modules like[Stacks Cosmos](https://github.com/Ensono/stacks-java-cosmos). Please refer to these
99
modules as examples.
1010

1111
## Module Structure
@@ -17,27 +17,19 @@ deploy.
1717
### Project structure
1818

1919
java
20-
\_.mvn
21-
: |_settings.xml
22-
|_archetype.properties
2320
|_pom.xml
2421
\_src
2522
: \_main
2623
: \_java
27-
: \_com.amido.stacks.core
24+
: \_com.ensono.stacks.core
2825
: \_operations
2926
: |_OperationContext.java
3027
: \_repository
3128
: |_StacksPersistence.java
3229

3330
## How to use
3431

35-
There are four ways to integrate this module into your project:
36-
37-
- Use it as a [dependency](#use-it-as-a-dependency)
38-
- Create a localized solution using [Maven Archetypes artifacts](#localized-solution-using-maven-archetypes) available in our Artifactory repo
39-
- Clone this repo, [locally build](#building-the-module-locally-from-this-repository) and use it as a Maven dependency
40-
- Clone this repo, create a [custom archetype](#creating-an-archetype-from-this-repository) and then use it as a Maven dependency
32+
Use it as a dependency.
4133

4234
### Use it as a dependency
4335

@@ -47,12 +39,14 @@ In the `dependencies` section of your application's `pom.xml` add:
4739

4840
```xml
4941
<dependency>
50-
<groupId>com.amido.stacks.modules</groupId>
42+
<groupId>com.ensono.stacks.modules</groupId>
5143
<artifactId>stacks-core-commons</artifactId>
52-
<version>1.0.0</version>
44+
<version>2.0.0</version>
5345
</dependency>
5446
```
5547

48+
NOTE: You should check to see the latest version and use that.
49+
5650
Then you can do a `./mvnw clean compile` to fetch it; after that, you can use it like any other dependency.
5751

5852
```bash
@@ -63,48 +57,6 @@ Then you can do a `./mvnw clean compile` to fetch it; after that, you can use it
6357

6458
Use it as you'd use any dependency in your build tool.
6559

66-
### Localized solution using Maven Archetypes
67-
68-
If you wish to customise the module and use your organisation's namespaces instead of Amido's. You can create a
69-
[Maven archetype](https://maven.apache.org/archetype/index.html). Archetype is Maven's tool for
70-
scaffolding and offers lots of extra functionality. We suggest spending some time looking into them. We use Archetype to create a template and enable you to adopt this module under your organisation's namespace.
71-
To use the deployed archetypes:
72-
73-
1. Make and move to a new folder
74-
2. Then run
75-
76-
``` bash
77-
mvn archetype:generate \
78-
-DarchetypeGroupId='com.amido.stacks.modules' \
79-
-DarchetypeArtifactId='stacks-core-commons-archetype' \
80-
-DarchetypeVersion='<archetype version>' \
81-
-DgroupId='<your-group-id>' \
82-
-DartifactId='<your-artifact-id>' \
83-
-Dversion='<your-version>' \
84-
-Dpackage='<package-name>'
85-
```
86-
87-
- `<your-group-id>` is a placeholder for your group ID
88-
- `<your-artifact-id>` is a placeholder for your artefact ID
89-
- `<your-version>` is a placeholder for your version
90-
- `<package-name>` is a placeholder for the root package name and structure. It should start with your `groupdId` and continue with the name of the root package.
91-
92-
> For example, using `-DgroupId=com.test` and `-Dpackage=com.test.stacks` will instruct Maven to place the code in `src/main/java/com/test/stacks` and update all the relevant references accordingly (i.e. `imports`)
93-
94-
3. Go to the `pom.xml` file of the project you'll be using this module in and add it as a [dependency](#use-it-as-a-dependency)
95-
96-
**Example**: Using `-DgroupId=com.test` and `-Dpackage=com.test.stacks` will instruct Maven to place the code in `src/main/java/com/test/stacks` and update all the relevant references accordingly (i.e. `imports`)
97-
98-
> **If you previously had used this module under different namespace (i.e. the default `com.amido.stacks.core-commons`):**
99-
>
100-
> Maven ONLY updates the imports for the module you generated. Any references in other projects will remain to the previous namespace.
101-
>
102-
> You will need to
103-
>
104-
>- Update them manually
105-
>- Re-create the relevant `import` statements to use the new-made module instead
106-
>- If you plan to use this with Amido Stacks, include your namespace in the `@ComponentScan` annotation of the `Application` class.
107-
10860
### Building the module locally from this repository
10961

11062
To build the module locally:
@@ -113,65 +65,3 @@ To build the module locally:
11365
2. Navigate to the `java` folder
11466
3. run `./mvnw clean install` to install the module locally.
11567
4. Add it as any other [dependency](#use-it-as-a-dependency)
116-
117-
### Creating an Archetype from this repository
118-
119-
If you wish to customise the module and use your organisation's namespaces instead of Amido's. You can create a
120-
[Maven archetype](https://maven.apache.org/archetype/index.html). Archetype is Maven's tool for
121-
scaffolding and offers lots of extra functionality. We suggest spending some time looking into them. We use Archetype to create a template and enable you to adopt this module under your organisation's namespace.
122-
To use the deployed archetypes:
123-
To build, install and use the archetype follow these steps:
124-
125-
1. Clone this repo
126-
2. Navigate to the `<directory you cloned the project into>/java` in the terminal
127-
3. Then issue the following Maven commands, using the included wrapper:
128-
1. Create the archetype from the existing code
129-
130-
```bash
131-
./mvnw archetype:create-from-project -DpropertyFile='./archetype.properties'
132-
```
133-
134-
2. Navigate to the folder it was created in
135-
136-
```bash
137-
cd target/generated-sources/archetype
138-
```
139-
140-
3. Install the archetype locally
141-
142-
```bash
143-
..\..\..\mvnw install
144-
```
145-
146-
4. Make and navigate to a directory in which you'd like to create the localized project, ideally outside this project's root folder
147-
5. To create the project, use the command below:
148-
149-
```bash
150-
<path-to-mvn-executable>/mvnw archetype:generate \
151-
-DarchetypeGroupId='com.amido' \
152-
-DarchetypeArtifactId='stacks-core-commons' \
153-
-DarchetypeVersion='1.0.0-SNAPSHOT' \
154-
-DgroupId='<your-group-id>' \
155-
-DartifactId='<your-artifact-id>' \
156-
-Dversion='<your-version>' \
157-
-Dpackage='<package-name>'`
158-
```
159-
160-
1. `<your-group-id>` is a placeholder for your group ID
161-
2. `<your-artifact-id>` is a placeholder for your artefact ID
162-
3. `<your-version>` is a placeholder for your version
163-
4. `<package-name>` is a placeholder for the root package name and structure. It should start with your `groupdId` and continue with the name of the root package.
164-
> For example, using `-DgroupId=com.test` and `-Dpackage=com.test.stacks` will instruct Maven to place the code in `src/main/java/com/test/stacks` and update all the relevant references accordingly (i.e. `imports`)
165-
6. Go to the `pom.xml` file of the project you'll be using this module in and add it as a [dependency](#use-it-as-a-dependency)
166-
167-
**Example**: Using `-DgroupId=com.test` and `-Dpackage=com.test.stacks` will instruct Maven to place the code in `src/main/java/com/test/stacks` and update all the relevant references accordingly (i.e. `imports`)
168-
169-
> **If you previously had used this module under different namespace (i.e. the default `com.amido.stacks.core-commons`):**
170-
>
171-
> Maven ONLY updates the imports for the module you generated. Any references in other projects will remain to the previous namespace.
172-
>
173-
> You will need to
174-
>
175-
>- Update them manually
176-
>- Re-create the relevant `import` statements to use the new-made module instead
177-
>- If you plan to use this with Amido Stacks, include your namespace in the `@ComponentScan` annotation of the `Application` class.

0 commit comments

Comments
 (0)