Bitbucket pipeline with Jfrog failing to download plugins for build - maven

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.

Related

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.

Maven build failure in Jenkins pipeline

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] }

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.

mvn sonar:sonar not generating dashboard data

We use maven for building our projects.
I implemented the configuration mentioned in http://docs.codehaus.org/display/SONAR/Installing+and+Configuring+Maven to analyze the project using sonar.
Snapshot of my .m2/settings.xml
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.jdbc.url>jdbc:oracle:thin:#10.207.67.95/XE</sonar.jdbc.url>
<sonar.jdbc.username>sonarqube</sonar.jdbc.username>
<sonar.jdbc.password>sonarqube</sonar.jdbc.password>
<sonar.jdbc.driver>oracle.jdbc.OracleDriver</sonar.jdbc.driver>
<sonar.host.url>http://localhost:9000</sonar.host.url>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
<activeProfile>sonar</activeProfile>
</activeProfiles>
When i run mvn sonar:sonar from the directory containing my pom.xml, it shows build success.
I checked the dashboard, the project shows up, and the LOC shown is empty.
Dashboard shows up no issues.
Output from mvn sonar:sonar
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxx 2.2.0.29-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:2.0:sonar (default-cli) # xxxx ---
[INFO] Sonar version: 3.6.2
[INFO] [15:18:16.984] Load batch settings
[INFO] [15:18:17.043] User cache: /home/jsaluja/.sonar/cache
[INFO] [15:18:17.048] Install plugins
[INFO] [15:18:17.589] Install JDBC driver
[INFO] [15:18:17.596] Create JDBC datasource for jdbc:oracle:thin:#10.207.67.95/XE
[INFO] [15:18:19.296] Initializing Hibernate
[INFO] [15:18:21.830] Load project settings
[INFO] [15:18:21.858] Apply project exclusions
[INFO] [15:18:22.003] ------------- Scan xxxx
[INFO] [15:18:22.008] Load module settings
[INFO] [15:18:22.607] Quality profile : [name=Sonar way,language=java]
[INFO] [15:18:22.625] Excluded tests:
[INFO] [15:18:22.625] **/package-info.java
[INFO] [15:18:22.660] Configure Maven plugins
[INFO] [15:18:22.728] Compare to previous analysis (2013-08-08)
[INFO] [15:18:22.750] Compare over 5 days (2013-08-03, analysis of 2013-08-07 12:55:06.0)
[INFO] [15:18:22.763] Compare over 30 days (2013-07-09, analysis of 2013-08-07 12:55:06.0)
[INFO] [15:18:22.890] Base dir: /home/jsaluja/0801/frontend/yyyy/xxxx
[INFO] [15:18:22.890] Working dir: /home/jsaluja/0801/frontend/yyyy/xxxx/target/sonar
[INFO] [15:18:22.890] Binary dirs: /home/jsaluja/0801/frontend/yyyy/xxxx/target/classes
[INFO] [15:18:22.890] Source encoding: UTF-8, default locale: en_US
[INFO] [15:18:22.894] Sensor JavaSourceImporter...
[INFO] [15:18:22.894] Sensor JavaSourceImporter done: 0 ms
[INFO] [15:18:22.894] Sensor JavaSquidSensor...
[INFO] [15:18:22.894] Sensor JavaSquidSensor done: 0 ms
[INFO] [15:18:22.894] Sensor SurefireSensor...
[INFO] [15:18:22.895] parsing /home/jsaluja/0801/frontend/yyyy/xxxx/target/surefire-reports
[INFO] [15:18:22.898] Sensor SurefireSensor done: 4 ms
[INFO] [15:18:22.898] Sensor CpdSensor...
[INFO] [15:18:22.898] SonarEngine is used
[INFO] [15:18:22.898] Sensor CpdSensor done: 0 ms
[INFO] [15:18:22.898] Sensor InitialOpenIssuesSensor...
[INFO] [15:18:22.901] Sensor InitialOpenIssuesSensor done: 3 ms
[INFO] [15:18:22.901] Sensor ProfileSensor...
[INFO] [15:18:23.209] Sensor ProfileSensor done: 308 ms
[INFO] [15:18:23.209] Sensor ProfileEventsSensor...
[INFO] [15:18:23.236] Sensor ProfileEventsSensor done: 27 ms
[INFO] [15:18:23.236] Sensor ProjectLinksSensor...
[INFO] [15:18:23.241] Sensor ProjectLinksSensor done: 5 ms
[INFO] [15:18:23.241] Sensor VersionEventsSensor...
[INFO] [15:18:23.253] Sensor VersionEventsSensor done: 12 ms
[INFO] [15:18:23.253] Sensor Maven dependencies...
[INFO] [15:18:23.805] Sensor Maven dependencies done: 552 ms
[INFO] [15:18:23.805] Sensor JaCoCoSensor...
[INFO] [15:18:23.809] Project coverage is set to 0% since there is no directories with classes.
[INFO] [15:18:23.809] Sensor JaCoCoSensor done: 4 ms
[INFO] [15:18:24.112] Execute decorators...
[INFO] [15:18:24.287] Store results in database
[INFO] [15:18:24.336] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/a.b.c.d.e:xxxx
[INFO] [15:18:24.337] Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
[INFO] [15:18:24.337] Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
[INFO] [15:18:24.387] Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
[INFO] [15:18:24.398] -> Keep one snapshot per day between 2013-07-11 and 2013-08-07
[INFO] [15:18:24.400] -> Keep one snapshot per week between 2012-08-09 and 2013-07-11
[INFO] [15:18:24.401] -> Keep one snapshot per month between 2008-08-14 and 2012-08-09
[INFO] [15:18:24.402] -> Delete data prior to: 2008-08-14
[INFO] [15:18:24.404] -> Clean xxxx [id=10080]
[INFO] [15:18:24.409] <- Clean snapshot 13758
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.637s
[INFO] Finished at: Thu Aug 08 15:18:24 EDT 2013
[INFO] Final Memory: 19M/277M
I could independently run sonar runner from the same directory using sonar-project.properties and dashboard shows up data, and a bunch of issues.
Output from sonar runner:
~/sonar-runner-2.3/bin/sonar-runner
SonarQube Runner 2.3
Java 1.6.0_21 Sun Microsystems Inc. (64-bit)
Linux 2.6.18-238.5.1.el5 amd64
INFO: Runner configuration file: /home/jsaluja/sonar-runner-2.3/conf/sonar-runner.properties
INFO: Project configuration file: /home/jsaluja/0801/frontend/yyyy/xxxx/sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: /home/jsaluja/0801/frontend/yyyy/xxxx/.sonar
INFO: SonarQube Server 3.6.2
15:19:14.377 INFO - Load batch settings
15:19:14.440 INFO - User cache: /home/jsaluja/.sonar/cache
15:19:14.444 INFO - Install plugins
15:19:14.944 INFO - Install JDBC driver
15:19:14.952 INFO - Create JDBC datasource for jdbc:oracle:thin:#10.207.67.95/XE
15:19:16.300 INFO - Initializing Hibernate
15:19:18.517 INFO - Load project settings
15:19:18.548 INFO - Apply project exclusions
15:19:18.682 INFO - ------------- Scan xxxx
15:19:18.688 INFO - Load module settings
15:19:19.295 INFO - Quality profile : [name=Sonar way,language=java]
15:19:19.314 INFO - Excluded tests:
15:19:19.314 INFO - **/package-info.java
15:19:19.355 INFO - Configure Maven plugins
15:19:19.439 INFO - Compare to previous analysis (2013-08-08)
15:19:19.463 INFO - Compare over 5 days (2013-08-03, analysis of 2013-08-08 14:38:22.472)
15:19:19.478 INFO - Compare over 30 days (2013-07-09, analysis of 2013-08-08 14:38:22.472)
15:19:19.647 INFO - Base dir: /home/jsaluja/0801/frontend/yyyy/xxxx
15:19:19.647 INFO - Working dir: /home/jsaluja/0801/frontend/yyyy/xxxx/.sonar
15:19:19.648 INFO - Source dirs: /home/jsaluja/0801/frontend/yyyy/xxxx/src
15:19:19.648 INFO - Source encoding: UTF-8, default locale: en_US
15:19:19.691 INFO - Sensor JavaSourceImporter...
15:19:20.048 INFO - Sensor JavaSourceImporter done: 357 ms
15:19:20.048 INFO - Sensor JavaSquidSensor...
15:19:20.115 INFO - Java AST scan...
15:19:22.213 INFO - Java AST scan done: 2098 ms
15:19:22.354 INFO - Sensor JavaSquidSensor done: 2306 ms
15:19:22.354 INFO - Sensor SurefireSensor...
15:19:22.355 INFO - parsing /home/jsaluja/0801/frontend/yyyy/xxxx/.sonar/build/surefire-reports
15:19:22.355 INFO - Sensor SurefireSensor done: 1 ms
15:19:22.355 INFO - Sensor CpdSensor...
15:19:22.355 INFO - SonarEngine is used
15:19:22.360 INFO - Cross-project analysis disabled
15:19:22.635 INFO - Sensor CpdSensor done: 280 ms
15:19:22.636 INFO - Sensor CheckstyleSensor...
15:19:22.637 INFO - Execute Checkstyle 5.6...
15:19:22.648 INFO - Checkstyle configuration: /home/jsaluja/0801/frontend/yyyy/xxxx/.sonar/checkstyle.xml
15:19:23.990 INFO - Execute Checkstyle 5.6 done: 1353 ms
15:19:24.001 INFO - Sensor CheckstyleSensor done: 1365 ms
15:19:24.001 INFO - Sensor PmdSensor...
15:19:24.004 INFO - Execute PMD 4.3...
15:19:24.024 INFO - Java version: 1.5
15:19:24.066 INFO - PMD configuration: /home/jsaluja/0801/frontend/yyyy/xxxx/.sonar/pmd.xml
15:19:27.017 INFO - Execute PMD 4.3 done: 3013 ms
15:19:27.110 INFO - Sensor PmdSensor done: 3109 ms
15:19:27.110 INFO - Sensor InitialOpenIssuesSensor...
15:19:27.363 INFO - Sensor InitialOpenIssuesSensor done: 253 ms
15:19:27.363 INFO - Sensor ProfileSensor...
15:19:27.638 INFO - Sensor ProfileSensor done: 275 ms
15:19:27.638 INFO - Sensor ProfileEventsSensor...
15:19:27.654 INFO - Sensor ProfileEventsSensor done: 16 ms
15:19:27.655 INFO - Sensor ProjectLinksSensor...
15:19:27.660 INFO - Sensor ProjectLinksSensor done: 5 ms
15:19:27.660 INFO - Sensor VersionEventsSensor...
15:19:27.674 INFO - Sensor VersionEventsSensor done: 14 ms
15:19:27.674 INFO - Sensor JaCoCoSensor...
15:19:27.677 INFO - Project coverage is set to 0% since there is no directories with classes.
15:19:27.677 INFO - Sensor JaCoCoSensor done: 3 ms
15:19:28.164 INFO - Execute decorators...
15:19:31.041 INFO - Store results in database
15:19:31.214 INFO - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/a.b.c.d.xxxx
15:19:31.216 INFO - Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
15:19:31.230 INFO - Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
15:19:31.279 INFO - Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
15:19:31.288 INFO - -> Keep one snapshot per day between 2013-07-11 and 2013-08-07
15:19:31.289 INFO - -> Keep one snapshot per week between 2012-08-09 and 2013-07-11
15:19:31.289 INFO - -> Keep one snapshot per month between 2008-08-14 and 2012-08-09
15:19:31.289 INFO - -> Delete data prior to: 2008-08-14
15:19:31.292 INFO - -> Clean xxxx [id=11882]
15:19:31.296 INFO - <- Clean snapshot 13716
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 17.946s
Final Memory: 20M/732M
INFO: --------------------------------------------
The dashboard screenshot for the mvn and sonar runner executed for the same project
https://docs.google.com/file/d/0B2TK6N3XnvavRmdrX0ZYb2V3Q0k/edit?usp=sharing
Red one shows output for mvn - no LOC
Green one shows output for sonar runner - LOC and issues identified
What am i missing with mvn configuration ?
It seems that sonar does not find any class files
15:19:27.677 INFO - Project coverage is set to 0% since there is no directories with classes.
Did you run
mvn clean install -DskipTests
before mvn sonar:sonar as recommended? mvn sonar:sonar will not compile the source code anymore (I think since sonar 3.6).

Maven/Jenkins - trouble running Maven from Jenkins

So I have a project that runs Jenkins, which calls Maven, which calls Ant (dont ask why) which runs a series of JMeter tests.
I know the Ant and JMeter stuff works fine. The issue Im having is when trying to add Maven to the mix.
I have it calling the pom.xml which simple references the ant build.xml file. the error I get is below:
Started by user anonymous
Building in workspace C:\Users\MURPHYA1\.jenkins\jobs\JMeter-Running-Mavin\workspace
Parsing POMs
Discovered a new module JMeter-Running-Maven:JMeter-Running-Maven JMeter-Running-Maven
Modules changed, recalculating dependency graph
[workspace] $ java -cp "C:\Users\MURPHYA1\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-agent-1.4.jar;C:\Users\MURPHYA1\Desktop\Code samples\apache-maven-3.1.0-bin\apache-maven-3.1.0\boot\plexus-classworlds-2.4.2.jar" jenkins.maven3.agent.Maven31Main "C:\Users\MURPHYA1\Desktop\Code samples\apache-maven-3.1.0-bin\apache-maven-3.1.0" C:\Users\MURPHYA1\.jenkins\war\WEB-INF\lib\remoting-2.30.jar C:\Users\MURPHYA1\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-interceptor-1.4.jar C:\Users\MURPHYA1\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.4.jar 56391
<===[JENKINS REMOTING CAPACITY]===>channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f C:\Users\MURPHYA1\.jenkins\jobs\JMeter-Running-Mavin\workspace\pom.xml run
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Scanning for projects...
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener -
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Building JMeter-Running-Maven 1.0-SNAPSHOT
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building JMeter-Running-Maven 1.0-SNAPSHOT
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - BUILD FAILURE
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Total time: 0.749s
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Finished at: Wed Aug 07 11:10:02 BST 2013
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Final Memory: 3M/61M
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[JENKINS] Archiving C:\Users\MURPHYA1\.jenkins\jobs\JMeter-Running-Mavin\workspace\pom.xml to C:\Users\MURPHYA1\.jenkins\jobs\JMeter-Running-Mavin\modules\JMeter-Running-Maven$JMeter-Running-Maven\builds\2013-08-07_11-09-52\archive\JMeter-Running-Maven\JMeter-Running-Maven\1.0-SNAPSHOT\JMeter-Running-Maven-1.0-SNAPSHOT.pom
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD FAILURE
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 4.863s
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: Wed Aug 07 11:10:06 BST 2013
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Final Memory: 3M/61M
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
channel stopped
Finished: FAILURE
and my pom.xml is below:
<project>
<modelVersion>4.0.0</modelVersion>
<artifactId>JMeter-Running-Maven</artifactId>
<groupId>JMeter-Running-Maven</groupId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<ant antfile="${basedir}/build.xml">
<target name="prepare-JMeter-Running-Maven" />
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Is anyone able to point out where I have gone wrong?
Thanks
UPDATE
I am running this off a clients VDI machine, which I has having issues running commands such as mvn install, which was giving me errors such as connection refused:forbidden and timed out. Do you think this is the issue, or is my pom.xml just not correct?
So the issue was that the vdi was blocking me downloading the relevant jar and pom files. So what I did was run the task on my local machine, copied the files across to my vdi repo and for the jar files, I registered them with the following maven command:
mvn install:install-file -Dfile=.\lib\com.ibm.mq.jar -DgroupId=com.ibm.mq -DartifactId=WebsphereMQClassesForJava -Dversion=7.0.1.5 -Dpackaging=jar

Resources