Maven build failure in Jenkins pipeline - maven

I've Jenkins as my CI/CD with over 30 multi-branch pipelines running and I have started getting this error at "artifactory configuration stage" when trying to deploy the artifactory to Jfrog. The snippet of my Jenkinsfile is as follows:
// Artifactory Intigration
stage('Artifactory configuration') {
container('mvn') {
// Obtain an Artifactory server instance, defined in Jenkins --> Manage:
server = Artifactory.server 'dlight-jfrog'
rtMaven = Artifactory.newMavenBuild()
rtMaven.tool = 'mvn' // Tool name from Jenkins configuration
rtMaven.opts = "-Denv=dev"
rtMaven.deployer releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local', server: server
rtMaven.resolver releaseRepo: 'libs-release', snapshotRepo: 'libs-snapshot', server: server
rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run
buildInfo = Artifactory.newBuildInfo()
}
}
// sonarqube configuration
stage('SonarQube analysis') {
withSonarQubeEnv('dlight sonar') {
//rtMaven.run pom: 'pom.xml', goals: 'package sonar:sonar -Dsonar.branch.name=develop', buildInfo: buildInfo
rtMaven.run pom: 'pom.xml', goals: 'package sonar:sonar', buildInfo: buildInfo
}
}
stage("Quality Gate"){
timeout(time: 1, unit: 'HOURS') {
def qg = waitForQualityGate()
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
// build artifact
stage ('MVN Install') {
rtMaven.run pom: 'pom.xml', goals: 'install', buildInfo: buildInfo
}
And the pipeline aborts with this error message
Downloaded from central: https://xxx.xxx.xxx.com/libs-release/org/apache/maven/surefire/surefire-junit4/2.18.1/surefire-junit4-2.18.1.jar (68 kB at 6.2 MB/s)
-------------------------------------------------------
T E S T S
-------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Skipping pipeline-name
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - This project has been banned from the build due to previous failures.
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD FAILURE
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 27.139 s
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: 2021-10-06T12:08:08Z
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Final Memory: 163M/962M
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] ERROR org.apache.maven.cli.MavenCli - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project pipeline-name: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[main] ERROR org.apache.maven.cli.MavenCli - Command was /bin/sh -c cd /home/jenkins/agent/workspace/piplelinename && /usr/local/openjdk-11/bin/java -javaagent:/home/jenkins/.m2/repository/org/jacoco/org.jacoco.agent/0.8.0/org.jacoco.agent-0.8.0-runtime.jar=destfile=/home/jenkins/agent/workspace/core-service-pipeline-name/target/jacoco.exec org.apache.maven.surefire.booter.ForkedBooter /home/jenkins/agent/workspace/core-service-pipelinename/target/surefire/surefire5994062267928659047tmp /home/jenkins/agent/workspace/pipeline-name/target/surefire/surefire_06380871570757565397tmp
[main] ERROR org.apache.maven.cli.MavenCli - -> [Help 1]
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - To see the full stack trace of the errors, re-run Maven with the -e switch.
[main] ERROR org.apache.maven.cli.MavenCli - Re-run Maven using the -X switch to enable full debug logging.
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - For more information about the errors and possible solutions, please read the following articles:
[main] ERROR org.apache.maven.cli.MavenCli - [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[Pipeline] }

Related

Spring-Boot project build fails if stored on Desktop MacOS

If I am trying to run my SpringBoot project while it is stored in any folder located on Desktop on my MacBook - build fails.
If I move project to any other directory except Desktop - it builds fine.
What can be the reason?
Error message after maven clean - install:
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # my-blog-springboot-v1 ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running ua.shamray.myblogspringbootv1.repository.AccountRepositoryTest
17:49:32.502 [main] DEBUG org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper - Neither #ContextConfiguration nor #ContextHierarchy found for test class [AccountRepositoryTest]: using SpringBootContextLoader
17:49:32.508 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [ua.shamray.myblogspringbootv1.repository.AccountRepositoryTest]: no resource found for suffixes {-context.xml, Context.groovy}.
17:49:32.509 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [ua.shamray.myblogspringbootv1.repository.AccountRepositoryTest]: AccountRepositoryTest does not declare any static, non-private, non-final, nested classes annotated with #Configuration.
17:49:32.804 [main] DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Failed to complete search in directory [/Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/test-classes/ua/shamray] for files matching pattern [*.class]: java.nio.file.NoSuchFileException: /Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/test-classes/ua/shamray
17:49:32.805 [main] DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Failed to complete search in directory [/Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/classes/ua/shamray] for files matching pattern [*.class]: java.nio.file.NoSuchFileException: /Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/classes/ua/shamray
17:49:32.806 [main] DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Failed to complete search in directory [/Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/test-classes/ua] for files matching pattern [*.class]: java.nio.file.NoSuchFileException: /Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/test-classes/ua
17:49:32.807 [main] DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Failed to complete search in directory [/Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/classes/ua] for files matching pattern [*.class]: java.nio.file.NoSuchFileException: /Users/nikitashamray/Desktop/IDEA%20Projects/my-blog-springboot-v1/target/classes/ua
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.012 s <<< FAILURE! - in ua.shamray.myblogspringbootv1.MyBlogSpringbootV1ApplicationTests
[ERROR] ua.shamray.myblogspringbootv1.MyBlogSpringbootV1ApplicationTests Time elapsed: 0.012 s <<< ERROR!
java.lang.IllegalStateException: Unable to find a #SpringBootConfiguration, you need to use #ContextConfiguration or #SpringBootTest(classes=...) with your test
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] MyBlogSpringbootV1ApplicationTests » IllegalState Unable to find a #SpringBoot...
[ERROR] AccountControllerTest » IllegalState Unable to find a #SpringBootConfiguration...
[ERROR] AccountRepositoryTest » IllegalState Unable to find a #SpringBootConfiguration...
[ERROR] AccountServiceImplUnitTest » IllegalState Unable to find a #SpringBootConfigur...
[ERROR] MyUserDetailsServiceImplUnitTest » IllegalState Unable to find a #SpringBootCo...
[ERROR] PostServiceImpUnitTest » IllegalState Unable to find a #SpringBootConfiguratio...
[ERROR] RoleServiceImplUnitTest » IllegalState Unable to find a #SpringBootConfigurati...
[INFO]
[ERROR] Tests run: 7, Failures: 0, Errors: 7, Skipped: 0
[INFO]

Trying to download JAR from Artifactory. Maven searches local repository instead of public maven server

My goal is to make a Jenkins job that downloads lastest jar from Artifactory.
I'm trying to use Maven default command clean and install but job fails.
Maven should be downloading them from https://repo1.maven.org/maven2/ but Jenkins tries to download them from my local Artifactory repository http://localhost:8081/artifactory/bpidev/.
Jenkins Fail Log :
Jenkins Artifactory Plugin version: 2.7.2
Artifactory integration is enabled
[S3_CbbCustom_Deploy_UAT] $ java -classpath /jenkins/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.6.0.jar -Dmaven.home=/jenkins/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven -DbuildInfoConfig.propertiesFile=/tmp/buildInfo6009671373604071834.properties -Dm3plugin.lib=/jenkins/jenkins/cache/artifactory-plugin/2.7.2 -Dclassworlds.conf=/tmp/classworlds1010245859327507063conf -Dmaven.multiModuleProjectDirectory=/jenkins/jenkins/workspace/S3_CbbCustom_Deploy_UAT/pom.xml org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml install
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
[main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorderLifecycleParticipant - [buildinfo] Properties file found at '/tmp/buildInfo6009671373604071834.properties'
[main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorder - Initializing Artifactory Build-Info Recording
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------< cbp.cbb:cbb-custom-3 >------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building cbb-custom-3 [4.3.3,)
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --------------------------------[ jar ]---------------------------------
Downloading from central: http://localhost:8081/artifactory/bpidev/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[main] WARNING org.codehaus.plexus.PlexusContainer - The POM for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 is missing, no dependency information available
Downloading from artifactory-release: http://localhost:8081/artifactory/bpidev/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD FAILURE
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 0.563 s
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: 2022-05-02T15:02:03+08:00
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] ERROR org.apache.maven.cli.MavenCli - Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-resources-plugin:jar:2.6 in artifactory-release (http://localhost:8081/artifactory/bpidev/) -> [Help 1]
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - To see the full stack trace of the errors, re-run Maven with the -e switch.
[main] ERROR org.apache.maven.cli.MavenCli - Re-run Maven using the -X switch to enable full debug logging.
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - For more information about the errors and possible solutions, please read the following articles:
[main] ERROR org.apache.maven.cli.MavenCli - [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Build step 'Invoke Artifactory Maven 3' changed build result to FAILURE
Build step 'Invoke Artifactory Maven 3' marked build as failure
Finished: FAILURE
Target jar
Jenkins configuration
pom.xml I used
Question 1. My goal is to make a Jenkins job that downloads lastest jar from Artifactory.
Am I doing it right? or is there a much simpler way?
Question 2. Why is Maven searching local Artifactory for its plugins? Where is the connnect?
Question 3. Can I make Maven to download its plugins from https://repo1.maven.org/maven2/? or should I just upload clean and install to my Artifactory repository?
It seems that your configuration for 'Resolution release repository' contains a local Artifactory repository.
Instead, you should point it to a virtual repository.
Virtual repositories will aggregate your local repository 'bpidev' and another remote repository which will point to https://repo1.maven.org/maven2/.
Maven depends on the settings.xml generated, so if it is configured to point to 'bpidev' only, he wont be able to reach the remote repository.
plugins resolution is also configured through the settings.xml as 'pluginRepository' which can also point to the same virtual repository in Artifactory which can aggregates the same remote repository so Maven will be able to download the plugins.

Bitbucket pipeline with Jfrog failing to download plugins for build

I'm trying to configure a bitbucket pipeline with a jfrog repository. I'm able to authenticate to the repository. The problem that I'm facing is that maven is failing to download plugins during the build. What am I missing?
This is my pipeline configuration.
image: atlassian/default-image:2
pipelines:
default:
- step:
script:
- pipe: jfrog/jfrog-setup-cli:1.0.0
- source ./jfrog-setup-cli.sh
- jfrog rt use myrepo-config
- jfrog rt config show
- jfrog rt ping
- jfrog rt mvnc --server-id-resolve=myrepo --repo-resolve-releases=myrepo-mvn --repo-resolve-snapshots=myrepo-mvn --server-id-deploy=myrepo --repo-deploy-releases=myrepo-mvn-dev-local --repo-deploy-snapshots=myrepo-mvn-dev-local
- jfrog rt mvn clean install
- jfrog rt bce
- jfrog rt bag --config=./issues-collection.yml
- jfrog rt bp
- jfrog rt bs
- jfrog rt bpr promotion-repo
In Jfrog I have configured a remote repository that points to https://repo.maven.apache.org and a virtual repository that includes the remote one.
But my build fails when maven tries to fetch a plugin.
+ jfrog rt mvn clean install
[Info] Running Mvn...
[Debug] Checking prerequisites.
[Info] Downloading build-info-extractor from https://myrepo.jfrog.io/artifactory/extractors/org/jfrog/buildinfo/build-info-extractor-maven3/2.17.0/build-info-extractor-maven3-2.17.0-uber.jar
[Debug] Usage Report: Sending info...
[Debug] Sending HTTP GET request to: https://myrepo.jfrog.io/artifactory/extractors/org/jfrog/buildinfo/build-info-extractor-maven3/2.17.0/build-info-extractor-maven3-2.17.0-uber.jar
[Debug] Sending HTTP GET request to: https://myrepo.jfrog.io/artifactory/api/system/version
[Debug] The Artifactory version is: 7.25.4
[Debug] Sending HTTP POST request to: https://myrepo.jfrog.io/artifactory/api/system/usage
[Debug] Usage Report: Artifactory response: 200 OK
[Debug] Usage Report: Usage info sent successfully.
[Debug] Saving build general details at: /tmp/jfrog/builds/Z3JlZ3NvdWxzYnktdXMtbW9kZWxkcml2ZXJzLXBsdWdpbi0wMDEtYWRkLXBpcGVsaW5lLWNvbmZpZ3J1YXRpb25fNDM=/partials
[Debug] Saving build general details at: /tmp/jfrog/builds/Z3JlZ3NvdWxzYnktdXMtbW9kZWxkcml2ZXJzLXBsdWdpbi0wMDEtYWRkLXBpcGVsaW5lLWNvbmZpZ3J1YXRpb25fNDM=/partials
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
[main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorder - Initializing Artifactory Build-Info Recording
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building us-myrepo-plugin-001 1.0-SNAPSHOT
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
Downloading: https://myrepo.jfrog.io/artifactory/myrepo-mvn/org/apache/maven/plugins/maven-checkstyle-plugin/3.1.2/maven-checkstyle-plugin-3.1.2.pom
Downloading: https://myrepo.jfrog.io/artifactory/myrepo-mvn/org/apache/maven/plugins/maven-checkstyle-plugin/3.1.2/maven-checkstyle-plugin-3.1.2.pom
Downloading: https://myrepo.jfrog.io/artifactory/myrepo-mvn/org/apache/maven/plugins/maven-checkstyle-plugin/3.1.2/maven-checkstyle-plugin-3.1.2.pom
[main] WARN org.codehaus.plexus.PlexusContainer - The POM for org.apache.maven.plugins:maven-checkstyle-plugin:jar:3.1.2 is missing, no dependency information available
Downloading: https://myrepo.jfrog.io/artifactory/myrepo-mvn/org/apache/maven/plugins/maven-checkstyle-plugin/3.1.2/maven-checkstyle-plugin-3.1.2.jar
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD FAILURE
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 2.833 s
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: 2021-10-26T00:22:03+00:00
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Final Memory: 9M/110M
[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[main] ERROR org.apache.maven.cli.MavenCli - Plugin org.apache.maven.plugins:maven-checkstyle-plugin:3.1.2 or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-checkstyle-plugin:jar:3.1.2 in artifactory-release (https://myrepo.jfrog.io/artifactory/myrepo-mvn) -> [Help 1]
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - To see the full stack trace of the errors, re-run Maven with the -e switch.
[main] ERROR org.apache.maven.cli.MavenCli - Re-run Maven using the -X switch to enable full debug logging.
[main] ERROR org.apache.maven.cli.MavenCli -
[main] ERROR org.apache.maven.cli.MavenCli - For more information about the errors and possible solutions, please read the following articles:
[main] ERROR org.apache.maven.cli.MavenCli - [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
[Error] exit status 1
2021-10-26T00:22:03.846245861Z stdout P
The URL of Maven Central is https://repo.maven.apache.org/maven2 not just https://repo.maven.apache.org.

maven-release plugin fails to create a release if parent pom uses ranges

I have a single module project, which I can create releases using maven-release-plugin
16:13:52 [INFO] Run maven with 'release:prepare release:perform -B -U -e -Dresume=false'
...
16:13:56 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
16:13:56 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-release-plugin:2.5.3:prepare (default-cli) # my-srv ---
16:13:57 [main] INFO org.apache.maven.shared.release.phase.ScmCheckModificationsPhase - Verifying that there are no local modifications...
16:13:57 [main] INFO org.apache.maven.shared.release.phase.ScmCheckModificationsPhase - ignoring changes on: **\pom.xml.next, **\release.properties, **\pom.xml.branch, **\pom.xml.tag, **\pom.xml.backup, **\pom.xml.releaseBackup
16:13:57 [main] INFO org.apache.maven.scm.manager.plexus.DefaultScmManager - Executing: cmd.exe /X /C "git rev-parse --show-prefix"
16:13:57 [main] INFO org.apache.maven.scm.manager.plexus.DefaultScmManager - Working directory: d:\jenkins\tools\ci-home\workspace\my-srv_master
16:13:57 [main] INFO org.apache.maven.scm.manager.plexus.DefaultScmManager - Executing: cmd.exe /X /C "git status --porcelain ."
16:13:57 [main] INFO org.apache.maven.scm.manager.plexus.DefaultScmManager - Working directory: d:\jenkins\tools\ci-home\workspace\my-srv_master
16:13:57 [Thread-4] WARNING org.apache.maven.scm.manager.plexus.DefaultScmManager - Ignoring unrecognized line: ?? effective-pom.xml
16:13:57 [main] INFO org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase - Checking dependencies and plugins for snapshots ...
16:13:57 [main] INFO org.apache.maven.shared.release.phase.RewritePomsForReleasePhase - Transforming 'WS-Proxy'...
16:13:57 [main] INFO org.apache.maven.shared.release.phase.GenerateReleasePomsPhase - Not generating release POMs
16:13:57 [main] INFO org.apache.maven.shared.release.phase.RunPrepareGoalsPhase - Executing goals 'clean verify'...
16:13:59 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] Scanning for projects...
16:13:59 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO]
16:13:59 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] --------------< com.mycompany.services:my-srv >---------------
16:13:59 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] Building WS-Proxy 1.8.13
16:13:59 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] --------------------------------[ pom ]---------------------------------
16:14:00 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO]
16:14:00 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # my-srv ---
16:14:00 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] Deleting D:\jenkins\tools\ci-home\workspace\my-srv_master\target
16:14:00 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO]
16:14:00 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] --- buildnumber-maven-plugin:1.4:create (create-buildnumber) # my-srv ---
16:14:00 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] Change the default 'git' provider implementation to 'jgit'.
16:14:01 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] Storing buildNumber: 31a2d2bb9470473ed8cb36d0493377ad6e8a5103 at timestamp: 1623680040903
16:14:01 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] Storing buildScmBranch: master
16:14:01 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO]
16:14:01 [Thread-6] INFO org.apache.maven.shared.release.exec.InvokerMavenExecutor - [INFO] --- buildnumber-maven-plugin:1.4:create-timestamp (create-timestamp) # my-srv ---
...
I use a fixed version for the parent pom
...
<parent>
<groupId>com.mycompany.services</groupId>
<artifactId>parent</artifactId>
<version>0.5.0</version>
</parent>
<artifactId>my-srv</artifactId>
<packaging>pom</packaging>
<version>1.8.14-SNAPSHOT</version>
...
No we actually want to use version ranges for the parent
...
<parent>
<groupId>com.mycompany.services</groupId>
<artifactId>parent</artifactId>
<version>[0.5.0,0.7.0)</version>
</parent>
<artifactId>my-srv</artifactId>
<packaging>pom</packaging>
<version>1.8.12-SNAPSHOT</version>
...
However, this now fails as follows
10:58:54 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
10:58:54 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-release-plugin:2.5.3:prepare (default-cli) # my-srv ---
10:58:54 [main] INFO org.apache.maven.shared.release.phase.ScmCheckModificationsPhase - Verifying that there are no local modifications...
10:58:54 [main] INFO org.apache.maven.shared.release.phase.ScmCheckModificationsPhase - ignoring changes on: **\pom.xml.next, **\release.properties, **\pom.xml.branch, **\pom.xml.tag, **\pom.xml.backup, **\pom.xml.releaseBackup
10:58:54 [main] INFO org.apache.maven.scm.manager.plexus.DefaultScmManager - Executing: cmd.exe /X /C "git rev-parse --show-prefix"
10:58:54 [main] INFO org.apache.maven.scm.manager.plexus.DefaultScmManager - Working directory: d:\jenkins\tools\ci-home\workspace\my-srv_master
10:58:55 [main] INFO org.apache.maven.scm.manager.plexus.DefaultScmManager - Executing: cmd.exe /X /C "git status --porcelain ."
10:58:55 [main] INFO org.apache.maven.scm.manager.plexus.DefaultScmManager - Working directory: d:\jenkins\tools\ci-home\workspace\my-srv_master
10:58:55 [Thread-4] WARNING org.apache.maven.scm.manager.plexus.DefaultScmManager - Ignoring unrecognized line: ?? effective-pom.xml
10:58:55 [main] INFO org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase - Checking dependencies and plugins for snapshots ...
10:58:55 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
10:58:55 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD FAILURE
10:58:55 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
10:58:55 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 2.863 s
10:58:55 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: 2021-06-21T10:58:55+02:00
10:58:55 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
10:58:55 [main] ERROR org.apache.maven.cli.MavenCli - Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project my-srv: Can't release project due to non released dependencies :
10:58:55 [main] ERROR org.apache.maven.cli.MavenCli - com.mycompany.services:parent:pom:0.6.1-SNAPSHOT
10:58:55 [main] ERROR org.apache.maven.cli.MavenCli - in project 'WS-Proxy' (com.mycompany.services:my-srv:pom:1.8.12-SNAPSHOT)
10:58:55 [main] ERROR org.apache.maven.cli.MavenCli - -> [Help 1]
10:58:55 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project my-srv: Can't release project due to non released dependencies :
10:58:55 com.mycompany.services:parent:pom:0.6.1-SNAPSHOT
10:58:55 in project 'WS-Proxy' (com.mycompany.services:my-srv:pom:1.8.12-SNAPSHOT)
I understand that the dependency com.mycompany.services:parent:pom:0.6.1-SNAPSHOT is a SNAPSHOT but why. According to Dependency Mediation and Conflict Resolution
Resolution of dependency ranges should not resolve to a snapshot (development version) unless it is included as an explicit boundary.
I addition, there is a release version com.mycompany.services:parent:pom:0.6.1 available.

Sonarqube runner exits with exit code 138 in TeamCity run

I'm migrating current stack to Teamcity and sonarqube build step suddenly fails with following output:
[09:56:54][Step 2/3] 09:56:54.862 INFO - Sensor SCM Sensor
[09:56:54][Step 2/3] 09:56:54.872 INFO - SCM provider for this project is: hg
<analysis>
[09:58:28][Step 2/3] 09:58:28.921 INFO - 1197/1831 files analyzed
[09:58:28][Step 2/3] 09:58:28.921 WARN - Missing blame information for the following files:
[09:58:28][Step 2/3] 09:58:28.921 WARN - * <list of paths>
...
[09:58:29][Step 2/3] 09:58:29.024 WARN - This may lead to missing/broken features in SonarQube
[09:58:30][Step 2/3] INFO: ------------------------------------------------------------------------
[09:58:30][Step 2/3] INFO: EXECUTION FAILURE
[09:58:30][Step 2/3] INFO: ------------------------------------------------------------------------
[09:58:30][Step 2/3] Total time: 3:27.871s
[09:58:30][Step 2/3] Final Memory: 18M/161M
[09:58:30][Step 2/3] INFO: ------------------------------------------------------------------------
[09:58:30][Step 2/3] ERROR: Error during Sonar runner execution
[09:58:30][Step 2/3] ERROR: Unable to execute Sonar
[09:58:30][Step 2/3] ERROR: Caused by: -1
[09:58:30][Step 2/3] ERROR:
[09:58:30][Step 2/3] ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
[09:58:30][Step 2/3] ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
[09:58:30][Step 2/3] Process exited with code 1
[09:58:30][Step 2/3] Step SonarQube Runner failed
How do i beat up that problem so the build would continue, or, at least, get the exact reason build fails? Mercurial data directory (.hg) should be in place, checkout is done on agent side.

Resources