Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ jobs:
cd maven-java
mvn -B archetype:generate -DgroupId=com.example -DartifactId=counter-value-entity -DarchetypeGroupId=com.akkaserverless -DarchetypeArtifactId=akkaserverless-maven-archetype -DarchetypeVersion=$SDK_VERSION
cd counter-value-entity
mvn -B -Dakkaserverless-sdk.version=$SDK_VERSION compile
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this anymore since #154, the archetype comes with the right version for the sdk

mvn -B compile
- run:
name: Run integration tests for Event Sourced Entity Archetype
command: |
cd maven-java
mvn -B archetype:generate -DgroupId=com.example -DartifactId=counter-event-sourced-entity -DarchetypeGroupId=com.akkaserverless -DarchetypeArtifactId=akkaserverless-maven-archetype-event-sourced-entity -DarchetypeVersion=$SDK_VERSION
cd counter-event-sourced-entity
mvn -B -Dakkaserverless-sdk.version=$SDK_VERSION compile
mvn -B compile
- save_deps_cache

samples-tests:
Expand All @@ -200,25 +200,25 @@ jobs:
command: |
cd samples/java-valueentity-shopping-cart
echo "Running mvn with SDK version: '$SDK_VERSION'"
mvn -Dakkaserverless-sdk.version=$SDK_VERSION -Dakkaserverless-maven-plugin.version=$SDK_VERSION verify -Pit
mvn versions:set -DnewVersion=$SDK_VERSION verify -Pit
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the samples now use ${project.version} as the sdk version, it suffice to call mvn versions:set.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so this works because we have <akkaserverless-sdk.version>${project.version}</akkaserverless-sdk.version> - which is perhaps OK for us, but would definitely be different for users.

I'm OK with it, but TBQH I don't see the advantage of using versions:set over -D for the samples. We're not publishing those, are we?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we are not publishing. But we do link them from the samples in the console. And users may checkout such a sample and run locally. In that case, we want the version to more or less aligned.

Also, if we use mvn versions:set we can from the script update the samples to run them locally for our own tests. Otherwise, we need to pass -D to maven, but then, if you want to open such a sample in intellij, you want it to have a fixed sdk version, not something to change with -D.

but would definitely be different for users.

That won't be different for users since this is just a sample. When a user starts a new project from the archetype, they get the sdk version fixed and independent from their project version.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want the version to more or less aligned.

We want the SDK version in the sample to be the latest, agreed!

if you want to open such a sample in intellij, you want it to have a fixed sdk version, not something to change with -D

I can see how that's useful. Using -D means the pom.xml don't have to change all the time (marking the git repo dirty), but I guess there's no easy way to have both advantages ;)

That won't be different for users since this is just a sample.

I meant, it's a bit confusing that the sample is different from what the user actually gets when they start a new project from the archetype. Not too big of a deal though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a bit confusing that the sample is different from what the user actually gets when they start a new project from the archetype

Yeah, it's true.
We can try to improve it. We can probably do some sed on the pom and fix the version from that same script.

- run:
name: Run integration tests for Shopping Cart Event Sourced Entity sample
command: |
cd samples/java-eventsourced-shopping-cart
echo "Running mvn with SDK version: '$SDK_VERSION'"
mvn -Dakkaserverless-sdk.version=$SDK_VERSION -Dakkaserverless-maven-plugin.version=$SDK_VERSION verify -Pit
mvn versions:set -DnewVersion=$SDK_VERSION verify -Pit
- run:
name: Run integration tests for Counter Value Entity sample
command: |
cd samples/valueentity-counter
echo "Running mvn with SDK version: '$SDK_VERSION'"
mvn -Dakkaserverless-sdk.version=$SDK_VERSION -Dakkaserverless-maven-plugin.version=$SDK_VERSION verify -Pit
mvn versions:set -DnewVersion=$SDK_VERSION verify -Pit
- run:
name: Run integration tests for Counter Replicated Entity sample
command: |
cd samples/replicatedentity-counter
echo "Running mvn with SDK version: '$SDK_VERSION'"
mvn -Dakkaserverless-sdk.version=$SDK_VERSION -Dakkaserverless-maven-plugin.version=$SDK_VERSION verify -Pit
mvn versions:set -DnewVersion=$SDK_VERSION verify -Pit
- save_deps_cache

publish:
Expand Down
15 changes: 12 additions & 3 deletions samples/java-customer-registry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
<akkasls.dockerTag>${project.version}</akkasls.dockerTag>
<akkasls.mainClass>customer.Main</akkasls.mainClass>
<jdk.target>11</jdk.target>
<akkaserverless-sdk.version>0.7.0-beta.10</akkaserverless-sdk.version>
<akkaserverless-maven-plugin.version>0.7.0-beta.10</akkaserverless-maven-plugin.version>
Comment on lines -20 to -21
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sdk.version is enough. All artifacts must align to it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had that on my mental note list but forgot to talk to anyone about it :)

<akkaserverless-sdk.version>${project.version}</akkaserverless-sdk.version>
<akka-grpc.version>1.1.1</akka-grpc.version>
</properties>

Expand Down Expand Up @@ -52,6 +51,16 @@
</configuration>
</plugin>

<plugin>
<!--
this plugin allow us to change the version of this projects and submodules
we use it in CI to align the project with the current SDK version
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
</plugin>

<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
Expand Down Expand Up @@ -203,7 +212,7 @@
<plugin>
<groupId>com.akkaserverless</groupId>
<artifactId>akkaserverless-maven-plugin</artifactId>
<version>${akkaserverless-maven-plugin.version}</version>
<version>${akkaserverless-sdk.version}</version>
<executions>
<execution>
<goals>
Expand Down
15 changes: 12 additions & 3 deletions samples/java-eventing-shopping-cart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
<akkasls.dockerTag>${project.version}</akkasls.dockerTag>
<akkasls.mainClass>shopping.Main</akkasls.mainClass>
<jdk.target>11</jdk.target>
<akkaserverless-sdk.version>0.7.0-beta.10</akkaserverless-sdk.version>
<akkaserverless-maven-plugin.version>0.7.0-beta.10</akkaserverless-maven-plugin.version>
<akkaserverless-sdk.version>${project.version}</akkaserverless-sdk.version>
<akka-grpc.version>1.1.1</akka-grpc.version>
</properties>

Expand Down Expand Up @@ -52,6 +51,16 @@
<target>${jdk.target}</target>
</configuration>
</plugin>

<plugin>
<!--
this plugin allow us to change the version of this projects and submodules
we use it in CI to align the project with the current SDK version
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
</plugin>

<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
Expand Down Expand Up @@ -204,7 +213,7 @@
<plugin>
<groupId>com.akkaserverless</groupId>
<artifactId>akkaserverless-maven-plugin</artifactId>
<version>${akkaserverless-maven-plugin.version}</version>
<version>${akkaserverless-sdk.version}</version>
<executions>
<execution>
<goals>
Expand Down
15 changes: 12 additions & 3 deletions samples/java-eventsourced-shopping-cart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
<jdk.target>11</jdk.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<akkaserverless-sdk.version>0.7.0-beta.10</akkaserverless-sdk.version>
<akkaserverless-maven-plugin.version>0.7.0-beta.10</akkaserverless-maven-plugin.version>
<akkaserverless-sdk.version>${project.version}</akkaserverless-sdk.version>
<akka-grpc.version>1.1.1</akka-grpc.version>
</properties>

Expand Down Expand Up @@ -53,6 +52,16 @@
<target>${jdk.target}</target>
</configuration>
</plugin>

<plugin>
<!--
this plugin allow us to change the version of this projects and submodules
we use it in CI to align the project with the current SDK version
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
</plugin>

<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
Expand Down Expand Up @@ -209,7 +218,7 @@
<plugin>
<groupId>com.akkaserverless</groupId>
<artifactId>akkaserverless-maven-plugin</artifactId>
<version>${akkaserverless-maven-plugin.version}</version>
<version>${akkaserverless-sdk.version}</version>
<executions>
<execution>
<goals>
Expand Down
15 changes: 12 additions & 3 deletions samples/java-valueentity-shopping-cart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
<jdk.target>11</jdk.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<akkaserverless-sdk.version>0.7.0-beta.10</akkaserverless-sdk.version>
<akkaserverless-maven-plugin.version>0.7.0-beta.10</akkaserverless-maven-plugin.version>
<akkaserverless-sdk.version>${project.version}</akkaserverless-sdk.version>
<akka-grpc.version>1.1.1</akka-grpc.version>
</properties>

Expand Down Expand Up @@ -53,6 +52,16 @@
<target>${jdk.target}</target>
</configuration>
</plugin>

<plugin>
<!--
this plugin allow us to change the version of this projects and submodules
we use it in CI to align the project with the current SDK version
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
</plugin>

<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
Expand Down Expand Up @@ -205,7 +214,7 @@
<plugin>
<groupId>com.akkaserverless</groupId>
<artifactId>akkaserverless-maven-plugin</artifactId>
<version>${akkaserverless-maven-plugin.version}</version>
<version>${akkaserverless-sdk.version}</version>
<executions>
<execution>
<goals>
Expand Down
15 changes: 12 additions & 3 deletions samples/replicatedentity-counter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
<jdk.target>11</jdk.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<akkaserverless-sdk.version>0.7.0-beta.10</akkaserverless-sdk.version>
<akkaserverless-maven-plugin.version>0.7.0-beta.10</akkaserverless-maven-plugin.version>
<akkaserverless-sdk.version>${project.version}</akkaserverless-sdk.version>
<akka-grpc.version>1.1.1</akka-grpc.version>
</properties>

Expand Down Expand Up @@ -53,6 +52,16 @@
<target>${jdk.target}</target>
</configuration>
</plugin>

<plugin>
<!--
this plugin allow us to change the version of this projects and submodules
we use it in CI to align the project with the current SDK version
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
</plugin>

<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
Expand Down Expand Up @@ -206,7 +215,7 @@
<plugin>
<groupId>com.akkaserverless</groupId>
<artifactId>akkaserverless-maven-plugin</artifactId>
<version>${akkaserverless-maven-plugin.version}</version>
<version>${akkaserverless-sdk.version}</version>
<executions>
<execution>
<goals>
Expand Down
15 changes: 12 additions & 3 deletions samples/valueentity-counter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
<jdk.target>11</jdk.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<akkaserverless-sdk.version>0.7.0-beta.10</akkaserverless-sdk.version>
<akkaserverless-maven-plugin.version>0.7.0-beta.10</akkaserverless-maven-plugin.version>
<akkaserverless-sdk.version>${project.version}</akkaserverless-sdk.version>
<akka-grpc.version>1.1.1</akka-grpc.version>
</properties>

Expand Down Expand Up @@ -53,6 +52,16 @@
<target>${jdk.target}</target>
</configuration>
</plugin>

<plugin>
<!--
this plugin allow us to change the version of this projects and submodules
we use it in CI to align the project with the current SDK version
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
</plugin>

<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
Expand Down Expand Up @@ -205,7 +214,7 @@
<plugin>
<groupId>com.akkaserverless</groupId>
<artifactId>akkaserverless-maven-plugin</artifactId>
<version>${akkaserverless-maven-plugin.version}</version>
<version>${akkaserverless-sdk.version}</version>
<executions>
<execution>
<goals>
Expand Down
33 changes: 33 additions & 0 deletions updatePomVersions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# this script updates all maven projects versions (maven-java and samples) to align with the current sdk version
# if SDK_VERSION env var is defined, it will use it, otherwise it will take the version from sbt
# after running this script, you may run local tests or simply send a PR with the updates.
# the script can also run publishM2 and mvn install to generate the artifacts with the new version.
Comment on lines +1 to +4
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this script we can test locally, but also update the pom after a release. We don't need to do it on each release though.



if [ -z ${SDK_VERSION+x} ]; then
SDK_VERSION=$(sbt "print sdk/version" | tail -1)
fi

if [ $1 ]; then
sbt publishM2
fi

cd maven-java
mvn versions:set -DnewVersion=$SDK_VERSION

if [ $1 ]; then
mvn install
fi

# cleanup
rm pom.xml.versionsBackup
rm */pom.xml.versionsBackup

for i in samples
do
(
cd $i
mvn versions:set -DnewVersion=$SDK_VERSION
rm pom.xml.versionsBackup
)
done