Sonar-Maven-Plugin: The folder does not exist - maven

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.

Related

Could not find artifact org.apache.pulsar:pulsar-broker:pom:2.12.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots)

While following the instructions to setup IntelliJ for pulsar development I got the below error
Could not find artifact org.apache.pulsar:pulsar-broker:pom:2.12.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots)
Digging deeper into the snapshots, I don't see pulsar-broker at 2.12.0 either: https://repository.apache.org/content/groups/snapshots/org/apache/pulsar/pulsar-broker/
Is there some configuration step missing?
Attempted Fix [RESOLVED]
accepted answers steps and fix an issue with SDKMAN to have mvn call Java 17
I tried the command mvn -Pcore-modules,-main clean install -DskipTests -Dspotbugs.skip=true and got the new error below.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project buildtools: Compilation failure
[ERROR] /Users/brandon.hoffman/Projects/pulsar/buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java:[30,18] cannot access org.testng.ITestResult
[ERROR] bad class file: /Users/brandon.hoffman/.m2/repository/org/testng/testng/7.7.0/testng-7.7.0.jar(org/testng/ITestResult.class)
[ERROR] class file has wrong version 55.0, should be 52.0
[ERROR] Please remove or make sure it appears in the correct subdirectory of the classpath.
Running this on the command line will fix that problem:
mvn -Pcore-modules,-main clean install -DskipTests -Dspotbugs.skip=true
You must use Java 17 for compiling the master branch version of Pulsar (requirements).
It's possible that there has been some change in the maven build after the instructions were originally written.
It does not look like the project is currently using the repository.apache.org for nightly snapshots. You should ask your question on the dev#pulsar.apache.org mailing list.
Also we have not yet cut the 2.12 branch. The VOTE for the first release of 2.11.0 just passed the PMC.
(FYI I am an Apache Pulsar PMC Member)

How to build orekit from maven?

I am having issues building orekit. I am following this guide below:
https://www.orekit.org/site-orekit-latest/building.html
I have installed jdk and installed java (version 14.0.2) to the path as well as incorporated the necessary users paths (JAVA_HOME, M2_HOME, and MAVEN_HOME). I also installed the latest version of maven version 3.6.3). I tried running "mvn package" and it came up with a build failure:
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users####). Please verify you invoked Maven from the correct directory. -> [Help 1]
I am not very technically proficient using the command prompt. I assume I need something relating to orekit in the same directory. I have a folder labeled orekit which I got from github in the same directory but I still get the error.
Help please.

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

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

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