Jenkins throw an error with Maven goal cargo - maven

When using Jenkins to build our project it throws the following error:
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.4:redeploy (default-cli) on project xxxxx: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.4:redeploy failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [tomcat8x], type = [remote]], configuration type [runtime]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.4:redeploy (default-cli) on project xxxxxx: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.4:redeploy failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [tomcat8x], type = [remote]], configuration type [runtime]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it?
The plugin is declare as shown in the image below:
enter image description here
Thanks in advance for any help you can give me to solve this.

Related

How to run spring boot repackage goal

I want to run only repackage goal that comes from spring-boot-maven-plugin plugin.
I tried
mvn spring-boot-maven-plugin:2.2.0.RELEASE:repackage
but I got:
Plugin not found in any plugin repository
update
I also tried
mvn org.springframework.boot:spring-boot-maven-plugin:2.2.0.RELEASE:repackage
I got:
Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.2.0.RELEASE:repackage failed: Source file must be provided
and this is the full error log:
[ERROR] Failed to execute goal
org.springframework.boot:spring-boot-maven-plugin:2.2.0.RELEASE:repackage
(default-cli) on project MyServer: Execution default-cli of goal
org.springframework.boot:spring-boot-maven-plugin:2.2.0.RELEASE:repackage
failed: Source file must be provided -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.springframework.boot:spring-boot-maven-plugin:2.2.0.RELEASE:repackage
(default-cli) on project MyServer: Execution default-cli of goal
org.springframework.boot:spring-boot-maven-plugin:2.2.0.RELEASE:repackage
failed: Source file must be provided
It looks like you've encountered an issue, although the developers seem to indicate that this goal should not be run standalone at all.

maven verify (sonar) fail to resolve defined argument

I am trying to verify using this parameter (which work for other projects)
mvn -X verify sonar:sonar -Drevision=4.0.10
Maven fails to download dependency because of the argument not resolved
Failed to execute goal on project APP-ear: Could not resolve
dependencies for project com.orginternational:APP-ear:ear:4.0.10:
Failed to collect dependencies at
com.orginternational:APP-was:war:4.0.10: Failed to read artifact
descriptor for com.orginternational:APP-was:war:4.0.10: Could not
transfer artifact com.orginternational:APP:pom:${revision} from/to en
(https://nexus.example.com/repository/maven-central/): Failed to
transfer file
https://nexus.example.com/repository/maven-central/com/orginternational/APP/$%7Brevision%7D/APP-$%7Brevision%7D.pom
with status code 400 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal on project APP-ear: Could not resolve dependencies for
project com.orginternational:APP-ear:ear:4.0.10: Failed to collect
dependencies at com.orginternational:APP-was:war:4.0.10
Any clue how to fix this please?

Unable to load component class org.sonar.scanner.scan.filesystem.ProjectFileIndexer when doing analysis

I am using Jenkins 2.190.3 with Sonarqube 7.9.2 for doing build quality analysis.
When executing the following line in my jenkins job:
mvn -e sonar:sonar -Dsonar.branch.name=${ORIGIN_BRANCH_NAME}
I get this error message:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar default-cli) on project application-demo-back:
Unable to load component class org.sonar.scanner.scan.filesystem.ProjectFileIndexer:
Unable to load component class org.sonar.scanner.scan.filesystem.FileIndexer:
Unable to load component class org.sonarsource.dotnet.shared.plugins.WrongEncodingFileFilter:
org.sonarsource.dotnet.shared.plugins.WrongEncodingFileFilter has unsatisfied dependency 'class org.sonarsource.dotnet.shared.plugins.AbstractConfiguration' for constructor 'public org.sonarsource.dotnet.shared.plugins.WrongEncodingFileFilter(org.sonarsource.dotnet.shared.plugins.EncodingPerFile,org.sonarsource.dotnet.shared.plugins.AbstractConfiguration)' from org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer#7a0e7ecd:278<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer#67332b1e:43<| -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project application-demo-back:
Unable to load component class org.sonar.scanner.scan.filesystem.ProjectFileIndexer
Any idea about where can be the problem?
My sonarqube instance has these plugins installed:
sonar-auth-oidc-plugin-1.0.4.jar
sonar-csharp-plugin-6.5.0.3766.jar
sonar-flex-plugin-2.3.jar
sonar-java-plugin-4.15.0.12310.jar
sonar-javascript-plugin-3.2.0.5506.jar
sonar-ldap-plugin-2.2.0.608.jar
sonar-php-plugin-2.11.0.2485.jar
sonar-python-plugin-1.8.0.1496.jar.old
sonar-python-plugin-2.5.0.5733.jar
sonar-scm-git-plugin-1.3.0.869.jar
sonar-scm-svn-plugin-1.6.0.860.jar
sonar-typescript-plugin-1.1.0.1079.jar
sonar-xml-plugin-1.4.3.1027.jar
I have tried to delete the data folder as mentioned here but nothing changed.

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin

We are seeing below issue while analyzing the PR, even we are not spinning any version in the pom file and its failing while analyzing the code.
Even after removing the plugin version its the same issue. Can you please help with this.
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project amap-repo: PUT https://api.bitbucket.org/2.0/repositories/m/amap-common-lib/pullrequests/175/comments/130003966
returned a response status of 404 Not Found ->
[Help 1] 14:22:15
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar
(default-cli) on project amap-repo: PUT
https://api.bitbucket.org/2.0/repositories/mediaiq/amap-common-lib/pullrequests/175/comments/130003966
returned a response status of 404 Not Found 14:22:15 at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
14:22:15 at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
You can try below command to archive your issue. I was facing the same but below command worked.
- mvn verify sonar:sonar -Dsonar.host.url=http://localhost:Port -Dsonar.login=Token -Dsonar.login=Sonar_username -Dsonar.password=Sonar_password

SonarQube 5.6.6 - Failed to create working path

I recently updated to sonarqube 5.6.6(Oracle DB) from 5.1(MySQL). The Sonarqube instance is up but my jenkins builds are failing with below error. i have checked and all the permissions are in place. Any pointers would be appreciated
[ERROR] Failed to execute goal org.******source.scanner.maven:******-maven-plugin:3.2:****** (default-cli) on project XXXXXXXX: Unable to load component class org.******.core.platform.PluginLoader: Unable to load component class org.******.core.platform.PluginClassloaderFactory: Unable to load component interface org.******.api.utils.TempFolder: Failed to create working path: /home/abc/.****** -> [Help 1]

Resources