"In space" maven deployement

I have configured my build script to publish Jar in Maven inside Space:

 

build.gradle:


publishing {
   
publications {
       
maven(MavenPublication) {
           
groupId = 'one.empty3'
            artifactId = 'libraries-k'
            version = "1.1"
            from components.java

            pom {
               
name = 'My  Empty3 Graphics Library'
                description = 'Graphics, image processing '

            }
        }
    }
//In the publishing section, in repositories, specify the repository URL and credentials using the environment variables:

    repositories {
       
maven {
           
credentials {
               
// Automation has a special account for authentication in Space
                // account credentials are accessible via env vars
                username = System.getenv("JB_SPACE_CLIENT_ID")
                password = System.getenv("JJB_SPACE_CLIENT_SECRET")
            }

           
url = "https://maven.pkg.jetbrains.space/empty3/p/empty3/maven/maven"
        }
    }
}

In .space.kts:(???)

/**
* JetBrains Space Automation
* This Kotlin-script file lets you automate build activities
* For more info, refer to https:*/

job("Build and publish") {
   
container(displayName = "Run publish script", image = "gradle") {
       
kotlinScript { api ->
           
api.gradle("build")
            api.gradle("publish")
        }
    }
   
   
   
container(displayName = "Show key using api", image = "openjdk:11.0.3-jdk") {
       
kotlinScript { api ->
           
// get env var from system
            println("Project key: " + System.getenv("JB_SPACE_PROJECT_KEY"))
            // get env var using API
            println("Project key: " + api.projectKey())
        }
    }
}






 

Errors:

 

> Task :publishMavenPublicationToMavenRepository FAILED

09:55:07

9 actionable tasks: 5 executed, 4 up-to-date

09:55:07

[a-gradle-support-threads-1] INFO libraries.process.ProcessGroup - Process a-gradle-support-2[pid 255] finished in 23396 ms. Exit code 1. Still waiting for process stream readers...

09:55:07

[a-gradle-support-threads-1] INFO libraries.process.ProcessGroup - Process a-gradle-support-2[pid 255] handling completed in 23396 ms. Exit code 1. a-gradle-support-2[pid 255]::stdout 3963 bytes. a-gradle-support-2[pid 255]::stderr 20490 bytes

09:55:07

Gradle finishes with code 1

09:55:07

Exception in thread "main" circlet.pipelines.script.GradleException: Gradle finishes with code 1

09:55:07

                at circlet.pipelines.script.ScriptApiImpl$gradle$1.invokeSuspend(ScriptApiImpl.kt:60)

09:55:07

                at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)

09:55:07

                at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)

09:55:07

                at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)

09:55:07

                at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)

09:55:07

                at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)

09:55:07

                at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)

09:55:07

                at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)

09:55:07

                at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)

09:55:07

                at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:279)

09:55:07

                at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)

09:55:07

                at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)

09:55:07

                at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)

09:55:07

                at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)

09:55:07

                at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)

09:55:07

                at circlet.pipelines.script.ScriptApiImpl.gradle(ScriptApiImpl.kt:57)

09:55:07

                at _space$1$1$1.invokeSuspend(.space.kts:10)

09:55:07

                at _space$1$1$1.invoke(.space.kts)

09:55:07

                at _space$1$1$1.invoke(.space.kts)

09:55:07

                at circlet.pipelines.config.dsl.api.KotlinScriptActionBuilder$build$1.invokeSuspend(ContainerStep.kt:404)

09:55:07

                at circlet.pipelines.config.dsl.api.KotlinScriptActionBuilder$build$1.invoke(ContainerStep.kt)

09:55:07

                at circlet.pipelines.config.dsl.api.KotlinScriptActionBuilder$build$1.invoke(ContainerStep.kt)

09:55:07

                at circlet.pipelines.config.dsl.api.ProjectScriptContextImpl.runKotlinScript(dsl.kt:477)

09:55:07

                at circlet.pipelines.script.runner.AutomationKotlinScriptRunner.runScript(AutomationKotlinScriptRunner.kt:57)

09:55:07

                at circlet.pipelines.script.runner.AutomationKotlinScriptRunnerKt.main(AutomationKotlinScriptRunner.kt:18)

09:55:07

                at circlet.pipelines.script.runner.AutomationKotlinScriptRunnerKt$main$2.invoke(AutomationKotlinScriptRunner.kt)

09:55:07

                at circlet.pipelines.script.runner.AutomationKotlinScriptRunnerKt$main$2.invoke(AutomationKotlinScriptRunner.kt)

09:55:07

                at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:205)

09:55:07

                at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)

09:55:07

                at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)

09:55:07

                at kotlin.coroutines.jvm.internal.RunSuspendKt.runSuspend(RunSuspend.kt:19)

09:55:07

                at circlet.pipelines.script.runner.AutomationKotlinScriptRunnerKt.main(AutomationKotlinScriptRunner.kt)

09:55:07

[Kotlin Agent] Kotlin script failed with exit code 1

 

0
2 comments

Hi Manuel Dahmen, it seems that there's a typo in one of the variables specified in the script: JJB_SPACE_CLIENT_SECRET. In fact, this is the root cause of the error you get. Just to double-check: would you like to fix the build issue itself, or make the typo intentionally to highlight that the logs include unrelated errors showing up? Thanks!

0

No it was a typo, I copy/paste and made an error.

I have errors in my unit tests, I think it's the JDK version. Locally I use JDK 17.

0

Please sign in to leave a comment.