feat: samples uses project.version as sdk version#156
Conversation
2a8efbc to
0688344
Compare
octonato
left a comment
There was a problem hiding this comment.
left a few comments to explain the changes
| 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 |
There was a problem hiding this comment.
we don't need this anymore since #154, the archetype comes with the right version for the sdk
| 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 |
There was a problem hiding this comment.
because the samples now use ${project.version} as the sdk version, it suffice to call mvn versions:set.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| <akkaserverless-sdk.version>0.7.0-beta.10</akkaserverless-sdk.version> | ||
| <akkaserverless-maven-plugin.version>0.7.0-beta.10</akkaserverless-maven-plugin.version> |
There was a problem hiding this comment.
sdk.version is enough. All artifacts must align to it.
There was a problem hiding this comment.
I had that on my mental note list but forgot to talk to anyone about it :)
| # 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. |
There was a problem hiding this comment.
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.
|
@raboof, I will merge this one as such and improve it later one using |
Those changes will allows us to:
mvn versions:set