Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.18:redeploy (default-cli) on project - maven

I am running and deploying on Windows. The app server is Tomcat 8. Not clear what this error means or how to resolve it.
Any help is greatly appreciated.

your question is similar my problem, I solved it. perhaps you have not properly started your server before using maven. for more details take a look at Deploying the JavaEE 8 Tutorial, by maven gets Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.6.4:redeploy (deploy) on project hello1

Related

Maven clean package lead to random "Application failed to start"

I encounter a very strange issue with my jhipster application (Spring Boot + Angular, v5.0.2).
Randomly, maven compilation (./mvnw -Pprod clean package -DskipTests) give me a war that cannot be executed : I can compile and launch the war and all work fine, and one minute later, without any change, I can compile but when I launch the war I get this stack trace :
11:46:32.286 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.NoSuchMethodError: org.yaml.snakeyaml.Yaml.<init>(Lorg/yaml/snakeyaml/constructor/BaseConstructor;Lorg/yaml/snakeyaml/representer/Representer;Lorg/yaml/snakeyaml/DumperOptions;Lorg/yaml/snakeyaml/LoaderOptions;Lorg/yaml/snakeyaml/resolver/Resolver;)V
This behaviour is seen on my laptop, my collegue laptop, and a Jenkins Docker image, so does not seem to be an environment issue.
** EDIT : **
Here is the pom : http://jsfiddle.net/ewn6qLzd/ (sorry I did not found something more appropriate to share it)
Any help would be much appreciated.
Best Regards,

Sonar-Maven-Plugin: The folder does not exist

we're having trouble with building a project in Jenkins. First of all some details on what we're using:
Jenkins 1.596.1
SonarQube 4.4
Java SE Development Kit, Update 92
Maven 3.3.3
sonar-maven-plugin 3.2
We're getting the following error:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project : The folder 'path-to-project-workspace\-ear\pom.xml' does not exist for 'path:project-ear' (base directory = path-to-project-workspace\ [Help 1]
Technically this could obviously be a problem on developer side. But I've been checking everything and it looks like it should work.
Maybe someone here has encountered a similiar problem? Any help would be appreciated.
Kind regards
Looks like the problem was indeed on developer side. It is working now.

How to run spring web app (jdk 8) with embedded Tomcat 8

We have a Spring web app (JDK 1.8) and (for development purposes) we're running it on embedded tomcat container, i.e. - we're using tomcat7-maven-plugin. The app is being started with
mvn tomcat7:run ...
For what I found out on I-net, there is no tomcat8-maven-plugin yet.
I found a few posts that claim that this also works with Tomcat 8, but it's not clear how to configure maven plugin to run Tomcat version 8, instead of version 7.
I tried this:
https://tomcat.apache.org/maven-plugin-2.2/tomcat7-maven-plugin/adjust-embedded-tomcat-version.html
and the build was successful, but the run failed with:
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:
run (default-cli) on project spotbuy: Execution default-cli of goal org.apache.t
omcat.maven:tomcat7-maven-plugin:2.2:run failed: An API incompatibility was encountered while executing org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run: java.lang.NoSuchMethodError: org.apache.catalina.startup.Tomcat.setDefaultRealm(Lorg/apache/catalina/Realm;)
I researched again and I found out, this is known unresolved problem.
Provided it's even possible, can anybody, please, give more details what and where should be configured?
It's not possible ... for now ...

jenkins - maven - sonar 3.7

we had
Jenkins 1.513 - Maven 3.0.5 - Sonar 3.5
combo setup for our projects.
After upgrading Sonar to version 3.7 i get the following error, on all projects:
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.1:sonar (default-cli) on project RC: Can not execute SonarQube analysis: Unable to execute Sonar: Task null does not exist -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.1:sonar (default-cli) on project RC: Can not execute SonarQube analysis
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
...
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute SonarQube analysis
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:109)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:67)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:109)
...
Caused by: org.sonar.api.utils.SonarException: Task null does not exist
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:78)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
Now, i get that it's a NullPointerException, but i couldn't find what/where to do to make things works again.
Any ideas would be appreciated :)
Thank you,
Marian
Ok, so obviously the error was human:
I should've understood, not just read this particular line:
If for any reason, has to change (moving the SonarQube distribution into another directory, generating the WAR and deploying it on different machines, etc.), set the SONAR_HOME environment variable to the new path to .
from the
Deploying SonarQube on Tomcat documentation.
Since I was doing an upgrade, i didn't want to remove the Sonar's old installation just yet, so i installed the new version in sonar-3.7 without updating the $SONAR_HOME variable which pointed to the /sonar folder (doh)
I found out after my initial post that the above mentioned error occured only when running SonarQube as webapp in Tomcat. In standalone mode, it was running fine.
Maybe this is one of the reasons why it is stated :
Note that the support of Tomcat will be dropped in version 4.1 of SonarQube.
Thus, it is highly recommended to stick with the standalone mode and not deploy SonarQube on Tomcat.
on the mentioned page.
It's easier to make an application more stupid proof just saying "don't do that" rather than fixing your own NullPointerExceptions. The only risk with this approach is that the stupid must understand what he's reading.

First time SONAR setup with Maven, getting a error on RulePriority, analysis fails

I am trying to setup SONAR on a server. I have Maven 3.0.3 and using Sonar 3.1.1 with a Java project.
Part way through the mvn sonar:sonar, I am getting the following error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXXXXXX-common: Can not execute Sonar: No enum const class org.sonar.api.rules.RulePriority.3 -> [Help 1]
I have setup Sonar before and never saw this, it has always been unzip and go. But on this particular server I keep getting this error.
I tried creating a blank rule set, but the error still pops up.
Any thoughts?
I think you are facing the same problem described here
http://sonar.15.n6.nabble.com/Xpath-rules-gt-Failed-startup-of-context-td3183230.html
You might find it useful

Resources