Problem Running Sample Maven SonarQube Scan

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem Running Sample Maven SonarQube Scan

Kyle Smith
Hello Everyone,

I am trying to run the sample project located here on github.

I modified the pom.xml file to include the Maven 3 plug-in specification. Here is my complete pom.xml file for the project:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.codehaus.sonar</groupId>
  <artifactId>example-java-maven</artifactId>
  <version>1.0-SNAPSHOT</version>

  <name>Simple Java Maven Project</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <sonar.language>java</sonar.language>
  </properties>


  <build>
     <pluginManagement>
       <plugins>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>sonar-maven-plugin</artifactId>
           <version>2.1</version>
         </plugin>
       </plugins>
     </pluginManagement>
  </build>

</project>

I am not sure if something is wrong with my settings.xml file located in the conf directory under the M2 repository or what.

The basic error message I receive is:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-install) on project example-java-maven: Failed to install artifact org.codehaus.sonar:example-java-maven:jar:1.0-SNAPSHOT: /foo/maven/m2/repo/org/codehaus/sonar/example-java-maven/1.0-SNAPSHOT/example-java-maven-1.0-SNAPSHOT.jar (No such file or directory) -> [Help 1]

This is probably a ridiculous question to someone familiar with Maven but I am completely confused as to why this simple example is not working.

I read this page: https://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException and did not find anything helpful. I do not think my proxy settings are incorrect because the settings.xml does not specify one. The other options, "Security and Deployment Settings" and "Guide to Remote Repository Access through Authenticated HTTPS" do not apply from my understanding at least.

Is the plugin, which I think is, 'example-java.maven.1.0-SNAPSHOT.jar' still available somewhere? Or is this pom.xml calling something that is no longer available?

Thank-you for reading this.

Respectfully,

Kyle Smith
Reply | Threaded
Open this post in threaded view
|

Re: Problem Running Sample Maven SonarQube Scan

Julien HENRY
Hi,

What is the Maven command you have launched? mvn clean install ?

Also please don't lock sonar-maven-plugin version to an old version like 2.1. Latest available is 2.4.

++

Julien

2014-11-18 1:04 GMT+01:00 Kyle Smith <[hidden email]>:
Hello Everyone,

I am trying to run the sample project located  here on github.
<https://github.com/SonarSource/sonar-examples/tree/master/projects/languages/java/maven/java-maven-simple>

I modified the pom.xml file to include the Maven 3 plug-in specification.
Here is my complete pom.xml file for the project:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.codehaus.sonar</groupId>
  <artifactId>example-java-maven</artifactId>
  <version>1.0-SNAPSHOT</version>

  <name>Simple Java Maven Project</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <sonar.language>java</sonar.language>
  </properties>


  <build>
     <pluginManagement>
       <plugins>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>sonar-maven-plugin</artifactId>
           <version>2.1</version>
         </plugin>
       </plugins>
     </pluginManagement>
  </build>

</project>

I am not sure if something is wrong with my settings.xml file located in the
conf directory under the M2 repository or what.

The basic error message I receive is:

*[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-install-plugin:2.4:install (default-install)
on project example-java-maven: Failed to install artifact
org.codehaus.sonar:example-java-maven:jar:1.0-SNAPSHOT:
/foo/maven/m2/repo/org/codehaus/sonar/example-java-maven/1.0-SNAPSHOT/example-java-maven-1.0-SNAPSHOT.jar
(No such file or directory) -> [Help 1]*

This is probably a ridiculous question to someone familiar with Maven but I
am completely confused as to why this simple example is not working.

I read this page:
https://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException and
did not find anything helpful. I do not think my proxy settings are
incorrect because the settings.xml does not specify one. The other options,
"Security and Deployment Settings" and "Guide to Remote Repository Access
through Authenticated HTTPS" do not apply from my understanding at least.

Is the plugin, which I think is, 'example-java.maven.1.0-SNAPSHOT.jar' still
available somewhere? Or is this pom.xml calling something that is no longer
available?

Thank-you for reading this.

Respectfully,

Kyle Smith




--
View this message in context: http://sonarqube.15.x6.nabble.com/Problem-Running-Sample-Maven-SonarQube-Scan-tp5030144.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Problem Running Sample Maven SonarQube Scan

Kyle Smith
Hi Julien,

Thank-you for the reply. I tried updating my pom.xml file to include the latest version that you mention and still Maven failed when executing mvn clean install.

I also tried using this for the version: <version>${sonarVersion}</version>

Both of these changes to the pom.xml failed.

Do you have any other ideas of what could be going on?

Respectfully,

Kyle Smith
Reply | Threaded
Open this post in threaded view
|

Re: Problem Running Sample Maven SonarQube Scan

Julien HENRY
mvn clean install do a build of the project. This has nothing to do with SonarQube (to start SQ analysis this is mvn sonar:sonar). So there is something wrong with your Maven installation and you should ask for help on Maven user mailing list.

++

Julien

2014-11-18 16:35 GMT+01:00 Kyle Smith <[hidden email]>:
Hi Julien,

Thank-you for the reply. I tried updating my pom.xml file to include the
latest version that you mention and still Maven failed when executing *mvn
clean install*.

I also tried using this for the version:
*<version>${sonarVersion}</version>*

Both of these changes to the pom.xml failed.

Do you have any other ideas of what could be going on?

Respectfully,

Kyle Smith



--
View this message in context: http://sonarqube.15.x6.nabble.com/Problem-Running-Sample-Maven-SonarQube-Scan-tp5030144p5030181.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email