diff --git a/.github/workflows/java-platform.yml b/.github/workflows/java-platform.yml index dee9bd527b2..6ca2400c640 100644 --- a/.github/workflows/java-platform.yml +++ b/.github/workflows/java-platform.yml @@ -132,7 +132,7 @@ jobs: # Note: due to github has no concept of recovering from a fail even if we have our fallback below we append a second un-parallel run behind this to be sure that it works with all checks. Only if that fails too we are ok with a "red" (which should be yellow) cross indicating a problem - name: Run mvnw run: | - ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} ${{ steps.extra_options.outputs.extra_options }} -B -P'enable-all-checks,update-generated-code' ${{ steps.platform_opts.outputs.platform_opts }} install + ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} ${{ steps.extra_options.outputs.extra_options }} -B -P'with-java,enable-all-checks,update-generated-code' ${{ steps.platform_opts.outputs.platform_opts }} install - name: Upload Test Report (first failure) uses: actions/upload-artifact@v4 @@ -145,7 +145,7 @@ jobs: - name: Run mvnv without BacNet regression tests if: ${{ failure() }} - run: ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} ${{ steps.extra_options.outputs.extra_options }} -B -P'skip-bacnet-regression-test,update-generated-code' ${{ steps.platform_opts.outputs.platform_opts }} install + run: ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} ${{ steps.extra_options.outputs.extra_options }} -B -P'with-java,skip-bacnet-regression-test,update-generated-code' ${{ steps.platform_opts.outputs.platform_opts }} install - name: Upload Test Report uses: actions/upload-artifact@v4 diff --git a/Jenkinsfile b/Jenkinsfile index 1b3a5b5b67b..b90a8dc85e8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,7 +94,7 @@ pipeline { } steps { echo 'Building' - sh './mvnw -B -P${JENKINS_PROFILE},skip-prerequisite-check,with-sandbox,with-c,with-go ${MVN_TEST_FAIL_IGNORE} ${MVN_LOCAL_REPO_OPT} clean install' + sh './mvnw -B -P${JENKINS_PROFILE},skip-prerequisite-check,with-sandbox,with-c,with-go,with-java ${MVN_TEST_FAIL_IGNORE} ${MVN_LOCAL_REPO_OPT} clean install' } post { always { @@ -117,7 +117,7 @@ pipeline { // We'll deploy to a relative directory so we can save // that and deploy in a later step on a different node - sh './mvnw -U -P${JENKINS_PROFILE},skip-prerequisite-check,with-sandbox,with-c,with-go,enable-all-checks ${MVN_TEST_FAIL_IGNORE} ${JQASSISTANT_NEO4J_VERSION} -DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir clean deploy' + sh './mvnw -U -P${JENKINS_PROFILE},skip-prerequisite-check,with-sandbox,with-c,with-go,with-java,enable-all-checks ${MVN_TEST_FAIL_IGNORE} ${JQASSISTANT_NEO4J_VERSION} -DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir clean deploy' // Stash the build results so we can deploy them on another node stash name: 'plc4x-build-snapshots', includes: 'local-snapshots-dir/**' @@ -138,7 +138,7 @@ pipeline { echo 'Checking Code Quality on SonarCloud' withCredentials([string(credentialsId: 'chris-sonarcloud-token', variable: 'SONAR_TOKEN')]) { //sh './mvnw -B -P${JENKINS_PROFILE},skip-prerequisite-check,with-python,with-proxies,with-sandbox sonar:sonar ${SONARCLOUD_PARAMS} -Dsonar.login=${SONAR_TOKEN}' - sh './mvnw -B -P${JENKINS_PROFILE},skip-prerequisite-check,with-c,with-go,with-sandbox sonar:sonar ${SONARCLOUD_PARAMS} -Dsonar.token=${SONAR_TOKEN}' + sh './mvnw -B -P${JENKINS_PROFILE},skip-prerequisite-check,with-c,with-go,with-java,with-sandbox sonar:sonar ${SONARCLOUD_PARAMS} -Dsonar.token=${SONAR_TOKEN}' } } } diff --git a/README.md b/README.md index 1242e2bd603..996ec95d97a 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,12 @@ The `Go` drivers can be built by enabling the `with-go` profile: ./mvnw -P with-go install ``` +The `Java` drivers can be built by enabling the `with-java` profile: + +``` +./mvnw -P with-java install +``` + The `C# / .Net` implementation is currently in a `work in progress` state. In order to be able to build the `C# / .Net` module, you currently need to activate the: `with-dotnet` profiles. @@ -203,7 +209,7 @@ In order to be able to build the Python module, you currently need to activate t In order to build everything the following command should work: ``` -./mvnw -P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks install +./mvnw -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks install ``` ## Community diff --git a/build-reproducible.sh b/build-reproducible.sh index c8c381ac646..0b7f99813f2 100644 --- a/build-reproducible.sh +++ b/build-reproducible.sh @@ -38,7 +38,7 @@ # Run a standard build function build() { echo "Building ..." - mvn -U -P apache-release,with-c,with-dotnet,with-go,with-python,with-sandbox -DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir clean deploy + mvn -U -P apache-release,with-c,with-dotnet,with-go,with-java,with-python,with-sandbox -DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir clean deploy echo "Done" } diff --git a/code-generation/pom.xml b/code-generation/pom.xml index 3e436733744..38710ef2810 100644 --- a/code-generation/pom.xml +++ b/code-generation/pom.xml @@ -39,7 +39,6 @@ language-base-freemarker - language-java protocol-base-mspec protocol-test @@ -66,6 +65,13 @@ + + with-java + + language-java + + + with-python diff --git a/code-generation/tests/pom.xml b/code-generation/tests/pom.xml index 9f852ecb422..af675f4f487 100644 --- a/code-generation/tests/pom.xml +++ b/code-generation/tests/pom.xml @@ -60,6 +60,12 @@ + + with-java + + + + with-python diff --git a/docker-compose.yaml b/docker-compose.yaml index 8014e944bf9..f1346a7caf8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -23,7 +23,7 @@ services: build: context: . dockerfile: Dockerfile - command: ["/ws/mvnw", "-e", "-Dskip-pgp-signing=true", "-P", "with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks,apache-release", "-Dmaven.repo.local=/ws/out/.repository", "clean", "install"] + command: ["/ws/mvnw", "-e", "-Dskip-pgp-signing=true", "-P", "with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks,apache-release", "-Dmaven.repo.local=/ws/out/.repository", "clean", "install"] volumes: # Bind the local directory as "/ws" - type: bind diff --git a/plc4j/examples/hello-docker/Dockerfile b/plc4j/examples/hello-docker/Dockerfile index b2d028929c0..b9259256b67 100644 --- a/plc4j/examples/hello-docker/Dockerfile +++ b/plc4j/examples/hello-docker/Dockerfile @@ -63,10 +63,10 @@ RUN dos2unix .mvn/wrapper/maven-wrapper.properties # Tell Maven to fetch all needed dependencies first, so they can get cached # (Tried a patched version of the plugin to allow exclusion of inner artifacts. # See https://issues.apache.org/jira/browse/MDEP-568 for details) -RUN ./mvnw -P with-c,with-dotnet,with-go,with-sandbox com.offbytwo.maven.plugins:maven-dependency-plugin:3.1.1.MDEP568:go-offline -DexcludeGroupIds=org.apache.plc4x,org.apache.plc4x.examples,org.apache.plc4x.sandbox +RUN ./mvnw -P with-c,with-dotnet,with-go,with-java,with-sandbox com.offbytwo.maven.plugins:maven-dependency-plugin:3.1.1.MDEP568:go-offline -DexcludeGroupIds=org.apache.plc4x,org.apache.plc4x.examples,org.apache.plc4x.sandbox # Build everything with all tests -RUN ./mvnw -P with-c,with-dotnet,with-go,with-sandbox install +RUN ./mvnw -P with-c,with-dotnet,with-go,with-java,with-sandbox install # Get the version of the project and save it in a local file on the container RUN ./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -DforceStdout -q -pl . > project_version diff --git a/pom.xml b/pom.xml index 1bedf246ecd..eddf9dbe40c 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,8 @@ specific language governing permissions and limitations under the License. --> - + 4.0.0 @@ -96,7 +97,8 @@ **/generated-sources - ${project.basedir}/plc4c/target/build-wrapper-output + ${project.basedir}/plc4c/target/build-wrapper-output + 1.7.0 @@ -170,9 +172,6 @@ protocols - - - plc4j @@ -929,7 +928,7 @@ - + @@ -1240,9 +1239,11 @@ 3.2.4 - ${project.build.directory}/${project.artifactId}-${project.version}-uber-jar.${project.packaging} + + ${project.build.directory}/${project.artifactId}-${project.version}-uber-jar.${project.packaging} + - + @@ -1258,7 +1259,8 @@ - ${project.build.directory}/dependency-reduced-pom.xml + ${project.build.directory}/dependency-reduced-pom.xml + @@ -1474,7 +1476,7 @@ https://issues.apache.org/jira/browse/%ISSUE% - + @@ -1584,6 +1586,14 @@ + + + with-java + + plc4j + + + with-dotnet @@ -1767,7 +1777,7 @@ false true - + @@ -1776,7 +1786,7 @@ false true - + diff --git a/src/main/script/prerequisiteCheck.groovy b/src/main/script/prerequisiteCheck.groovy index b93af0a5676..ac46ed78686 100644 --- a/src/main/script/prerequisiteCheck.groovy +++ b/src/main/script/prerequisiteCheck.groovy @@ -376,7 +376,7 @@ def cEnabled = false def dotnetEnabled = false def goEnabled = false // Java is always enabled ... -def javaEnabled = true +def javaEnabled = false def pythonEnabled = false def sandboxEnabled = false def apacheReleaseEnabled = false @@ -388,6 +388,8 @@ for (def activeProfile : activeProfiles) { dotnetEnabled = true } else if (activeProfile == "with-go") { goEnabled = true + } else if (activeProfile == "with-java") { + javaEnabled = true } else if (activeProfile == "with-python") { pythonEnabled = true } else if (activeProfile == "with-sandbox") { diff --git a/src/site/asciidoc/developers/building.adoc b/src/site/asciidoc/developers/building.adoc index d437704b79a..7bb9e547a55 100644 --- a/src/site/asciidoc/developers/building.adoc +++ b/src/site/asciidoc/developers/building.adoc @@ -70,6 +70,7 @@ The following profiles are available (*They have to be enabled additionally to t - `with-c`: Builds all C related modules, integrations and examples - `with-dotnet`: Builds all C# and .Net related modules, integrations and examples - `with-go`: Builds all Go related modules, integrations and examples +- `with-java`: Builds all Java related modules, integrations and examples - `with-python`: Builds all Python related modules, integrations and examples (Also requires `with-sandbox`) - `with-sandbox`: Builds the modules which are not yet considered stable enough to become part of the main distribution @@ -95,13 +96,13 @@ If you want to skip the running of tests (even if this is not encouraged) you ca All Apache PLC4X modules are built by executing the following command: - mvn -P with-c,with-dotnet,with-go,with-python,with-sandbox install + mvn -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox install This not only builds the artifacts and creates the jar files, but also runs all unit- and integration-tests. If you want to skip the running of tests (even if this is not encouraged) you can skip them all together. - mvn -P with-c,with-dotnet,with-go,with-python,with-sandbox install -DskipTests + mvn -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox install -DskipTests This will not skip the compilation of tests, however. diff --git a/src/site/asciidoc/developers/release/release.adoc b/src/site/asciidoc/developers/release/release.adoc index 2accb0baced..86b34b63afa 100644 --- a/src/site/asciidoc/developers/release/release.adoc +++ b/src/site/asciidoc/developers/release/release.adoc @@ -29,14 +29,14 @@ IMPORTANT: Please be sure to execute the release with a Java version 11 or the K * [ ] Create release branch: [subs="verbatim,attributes"] ---- - mvn release:branch -P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks -DbranchName=rel/{current-short-version} + mvn release:branch -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks -DbranchName=rel/{current-short-version} ---- [%interactive] * [ ] Add a new section to the `RELEASE_NOTES` on `develop` * [ ] Prepare the release: [subs="verbatim,attributes"] ---- - mvn release:prepare -P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks + mvn release:prepare -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks ---- [%interactive] * [ ] Perform the release: @@ -157,14 +157,14 @@ This is the version the `develop` branch will be changed to. In contrast to normal builds, it is important to enable all profiles when creating the branch as only this way will all modules versions be updated. Otherwise, the non-default modules on develop will reference the old version which will cause problems when building. - mvn release:branch -P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks -DbranchName=rel/{minor-version} + mvn release:branch -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks -DbranchName=rel/{minor-version} Per default the plugin suggests the next bugfix version as working version, however we want it to use the next minor version. So in case of preparing the release branch for `{current-full-version}-SNAPSHOT` the command would be the following: [subs="verbatim,attributes"] ---- - mvn release:branch -P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks -DbranchName=rel/{current-short-version} + mvn release:branch -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks -DbranchName=rel/{current-short-version} ---- The plugin will then aks for the version: @@ -229,9 +229,9 @@ In order to prepare a release-candidate, the first step is switching to the corr After that, the following command will to all preparation steps for the release: - mvn release:prepare -P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks + mvn release:prepare -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks -(The `-P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks` tells maven to activate the all profiles that partition the build and makes sure the versions of all modules are updated as part of the release) +(The `-P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks` tells maven to activate the all profiles that partition the build and makes sure the versions of all modules are updated as part of the release) In general the plugin will now ask you 3 questions: 1. The version we want to release as (It will suggest the version you get by omitting the `-SNAPSHOT` suffix) @@ -279,7 +279,7 @@ NOTE: If the commit history doesn't look like this, something went wrong. If something goes wrong, you can always execute: - mvn release:rollback -P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks + mvn release:rollback -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks It will change the versions back and commit and push things. @@ -464,7 +464,7 @@ If however for some reason it is needed to prepare a new RC for the release. Ple - Set the versions of the release branch to the previous version by using the `versions:set` plugin: - mvn versions:set -DprocessAllModules=true -P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks + mvn versions:set -DprocessAllModules=true -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks - Delete the tag locally: diff --git a/tools/docker-compose.yaml b/tools/docker-compose.yaml index a6d974c7308..af8a112cb97 100644 --- a/tools/docker-compose.yaml +++ b/tools/docker-compose.yaml @@ -24,7 +24,7 @@ services: context: .. dockerfile: Dockerfile # Builds all modules and uses an alternate maven local repo and deploys artifacts to a local directory. - command: ["/ws/mvnw", "-e", "-Dskip-pgp-signing=true", "-P", "with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks,apache-release", "-Dmaven.repo.local=/ws/out/.repository", "-DaltDeploymentRepository=snapshot-repo::default::file:/ws/out/.local-snapshots-dir", "clean", "deploy"] + command: ["/ws/mvnw", "-e", "-Dskip-pgp-signing=true", "-P", "with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks,apache-release", "-Dmaven.repo.local=/ws/out/.repository", "-DaltDeploymentRepository=snapshot-repo::default::file:/ws/out/.local-snapshots-dir", "clean", "deploy"] volumes: # Bind the local directory as "/ws" - type: bind diff --git a/tools/release-0-update-generated-code.sh b/tools/release-0-update-generated-code.sh index 2ef80cbb73e..6e456ea8242 100755 --- a/tools/release-0-update-generated-code.sh +++ b/tools/release-0-update-generated-code.sh @@ -46,7 +46,7 @@ rm -r "$DIRECTORY/plc4c/generated-sources" # TODO: Possibly check, if the year in the NOTICE is outdated # 3. Run the maven build for all modules with "update-generated-code" enabled (Docker container) -docker compose run --rm releaser bash /ws/mvnw -e -P with-c,with-dotnet,with-go,with-python,with-sandbox,enable-all-checks,update-generated-code -Dmaven.repo.local=/ws/out/.repository clean package +docker compose run --rm releaser bash /ws/mvnw -e -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox,enable-all-checks,update-generated-code -Dmaven.repo.local=/ws/out/.repository clean package if [ $? -ne 0 ]; then echo "Got non-0 exit code from docker compose, aborting." exit 1 diff --git a/tools/release-1-create-branch.sh b/tools/release-1-create-branch.sh index 259a67728f9..5f71ff362b7 100755 --- a/tools/release-1-create-branch.sh +++ b/tools/release-1-create-branch.sh @@ -49,7 +49,7 @@ case $yn in esac # 3. Do a simple maven branch command with pushChanges=false (inside the Docker container) -docker compose run --rm releaser bash /ws/mvnw -e -P with-c,with-dotnet,with-go,with-python,with-sandbox -Dmaven.repo.local=/ws/out/.repository release:branch -DautoVersionSubmodules=true -DpushChanges=false -DdevelopmentVersion="$NEW_VERSION" -DbranchName="$BRANCH_NAME" +docker compose run --rm releaser bash /ws/mvnw -e -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox -Dmaven.repo.local=/ws/out/.repository release:branch -DautoVersionSubmodules=true -DpushChanges=false -DdevelopmentVersion="$NEW_VERSION" -DbranchName="$BRANCH_NAME" if [ $? -ne 0 ]; then echo "Got non-0 exit code from docker compose, aborting." exit 1 diff --git a/tools/release-2-prepare-release.sh b/tools/release-2-prepare-release.sh index 1bd91423d85..a3157dc5e24 100755 --- a/tools/release-2-prepare-release.sh +++ b/tools/release-2-prepare-release.sh @@ -32,7 +32,7 @@ IFS='.' read -ra VERSION_SEGMENTS <<< "$RELEASE_VERSION" NEW_VERSION="${VERSION_SEGMENTS[0]}.${VERSION_SEGMENTS[1]}.$((VERSION_SEGMENTS[2] + 1))-SNAPSHOT" # 1. Do a simple release-prepare command with pushChanges=false (inside the Docker container) -docker compose run --rm releaser bash /ws/mvnw -e -P with-c,with-dotnet,with-go,with-python,with-sandbox -Dmaven.repo.local=/ws/out/.repository release:prepare -DautoVersionSubmodules=true -DpushChanges=false -DreleaseVersion="$RELEASE_VERSION" -DdevelopmentVersion="$NEW_VERSION" -Dtag="v$RELEASE_VERSION" +docker compose run --rm releaser bash /ws/mvnw -e -P with-c,with-dotnet,with-go,with-java,with-python,with-sandbox -Dmaven.repo.local=/ws/out/.repository release:prepare -DautoVersionSubmodules=true -DpushChanges=false -DreleaseVersion="$RELEASE_VERSION" -DdevelopmentVersion="$NEW_VERSION" -Dtag="v$RELEASE_VERSION" if [ $? -ne 0 ]; then echo "Got non-0 exit code from docker compose, aborting." exit 1