From 2f63308046a20600ed1007664979c3dd368359f4 Mon Sep 17 00:00:00 2001 From: yamelsenih Date: Fri, 1 Nov 2024 13:07:18 -0400 Subject: [PATCH 1/2] Prevent NPE --- src/main/java/org/spin/processor/service/Service.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/spin/processor/service/Service.java b/src/main/java/org/spin/processor/service/Service.java index 9d4f589..247e806 100644 --- a/src/main/java/org/spin/processor/service/Service.java +++ b/src/main/java/org/spin/processor/service/Service.java @@ -14,6 +14,8 @@ ************************************************************************************/ package org.spin.processor.service; +import java.util.Optional; + import org.adempiere.exceptions.AdempiereException; import org.compiere.model.MProcess; import org.compiere.model.MRole; @@ -78,7 +80,7 @@ private static RunProcessorResponse.Builder runProcess(int processId, String par if(process == null || process.getAD_Process_ID() <= 0) { throw new AdempiereException("@AD_Process_ID@ @NotFound@"); } - if(!MRole.getDefault().getProcessAccess(process.getAD_Process_ID())) { + if(!Optional.ofNullable(MRole.getDefault().getProcessAccess(process.getAD_Process_ID())).orElse(false)) { if (process.isReport()) { throw new AdempiereException("@AccessCannotReport@"); } From 14494bdc4d1cfacb4723bbe3fe727117d560f3e3 Mon Sep 17 00:00:00 2001 From: EdwinBetanc0urt Date: Mon, 9 Dec 2024 11:10:48 -0400 Subject: [PATCH 2/2] fix: CI with public packages. --- .github/workflows/ci.yml | 7 +++++-- .github/workflows/publish.yml | 7 +++++-- .gitignore | 6 +++++- build.gradle | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 216840d..c3d87a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,8 +48,11 @@ jobs: - name: Build with Gradle uses: gradle/gradle-build-action@v3 env: - GITHUB_DEPLOY_USER: "${{ secrets.DEPLOY_USER }}" - GITHUB_DEPLOY_TOKEN: "${{ secrets.DEPLOY_TOKEN }}" + ORG_GRADLE_PROJECT_deployUsername: ${{ secrets.DEPLOY_USER }} + ORG_GRADLE_PROJECT_deployToken: ${{ secrets.DEPLOY_TOKEN }} + ORG_GRADLE_PROJECT_deplyRepository: ${{ secrets.DEPLOY_REPOSITORY }} + GITHUB_DEPLOY_USER: ${{ github.actor }} + GITHUB_DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }} with: gradle-version: 8.0.2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cccc7ce..dc3633c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,8 +33,11 @@ jobs: gradle-version: 8.0.2 arguments: createRelease env: - GITHUB_DEPLOY_USER: ${{ secrets.DEPLOY_USER }} - GITHUB_DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} + ORG_GRADLE_PROJECT_deployUsername: ${{ secrets.DEPLOY_USER }} + ORG_GRADLE_PROJECT_deployToken: ${{ secrets.DEPLOY_TOKEN }} + ORG_GRADLE_PROJECT_deplyRepository: ${{ secrets.DEPLOY_REPOSITORY }} + GITHUB_DEPLOY_USER: ${{ github.actor }} + GITHUB_DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }} - name: Upload descriptor file artifact diff --git a/.gitignore b/.gitignore index a9e8fe5..f113d09 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,9 @@ hs_err_pid* /bin/ /.gradle/ +/libs/ +/dependences/ /build/ -*.properties \ No newline at end of file +*.properties +# skip folder dependencies +!dependencies/*.jar diff --git a/build.gradle b/build.gradle index 45b7e5f..8501a93 100644 --- a/build.gradle +++ b/build.gradle @@ -41,7 +41,7 @@ repositories { // Adempiere GitHub Organization url = 'https://maven.pkg.github.com/adempiere/adempiere' credentials { - // project property, system properrty, enviroment variable + // project property, system property, enviroment variable username = findProperty("deployUsername") ?: System.properties['deploy.user'] ?: System.getenv("GITHUB_DEPLOY_USER") password = findProperty("deployToken") ?: System.properties['deploy.token'] ?: System.getenv("GITHUB_DEPLOY_TOKEN") }