0

Я хочу интегрировать приложение maven java с SonarQube5.4.Как интегрировать проект maven с помощью SonarQube5.4?

Использование maven3.3.3 и MySQL5.7.12

Уже SonarQube успешно установлен и его ход.

Если я иду в путь проекта в командной строке и запустить команду mvn sonar:sonar, я получаю следующую ошибку

[WARNING] Failed to retrieve plugin descriptor for org.codehaus.sonar:sonar-maven-plugin:2.4: 
Plugin org.codehaus.sonar:sonar-maven-plugin:2.4 or one of its dependencies could not be resolved: 
Failed to read artifact descriptor for org.codehaus.sonar:sonar-maven-plugin:jar:2.4 
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/sonar-maven-plugin/maven-metadata.xml 
[WARNING] Could not transfer metadata org.codehaus.mojo:sonar-maven-plugin/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org 
[ERROR] Error resolving version for plugin 'org.codehaus.mojo:sonar-maven-plugin' 
from the repositories [local (C:\Users\username\.m2\repository), 
central (https://repo.maven.apache.org/maven2)]: 
Plugin not found in any plugin repository -> [Help 1] 

Но если я иду в каталог .m2 орг/Codehaus/харизмы/sonar-maven-plugin Я могу найти maven-metadata.xml. Также я могу найти sonar-maven-plugin-2.4.jar, sonar-maven-plugin-2.4.pom в орге/Codehaus/харизма/сонар-Maven-плагин/2,4 папки

Я запутался, они доступны в локальном хранилище, то его пытается загрузить?

Помоги мне

Пожалуйста найти мой pom.xml ниже

<?xml version="1.0"?> 

<project 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>org.mycompany.server</groupId> 
    <version>0.0.1-SNAPSHOT</version> 
    <artifactId>MyProject</artifactId> 
    <packaging>war</packaging> 
    <name>MyProject</name> 

    <properties> 
     <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> 
     <!-- External Dependencies versions --> 
     <build-helper-maven-plugin.version>1.7</build-helper-maven-plugin.version> 
     <hibernate.jpa.version>1.0.1.Final</hibernate.jpa.version> 
     <hibernate.validator.version>4.3.1.Final</hibernate.validator.version> 
     <hibernate.version>4.2.6.Final</hibernate.version> 
     <java.version>1.7</java.version> 
     <javax.servlet.jsp.version>2.1</javax.servlet.jsp.version> 
     <jaxb.version>2.2.4</jaxb.version> 
     <jsp-api.version>2.2</jsp-api.version> 
     <jstl.version>1.2</jstl.version> 
     <junit.version>4.11</junit.version> 
     <log4j.version>1.2.15</log4j.version> 
     <slf4j.log4j.version>1.6.1</slf4j.log4j.version> 
     <maven.assembly.plugin>2.3</maven.assembly.plugin> 
     <maven.clean.plugin>2.5</maven.clean.plugin> 
     <maven.compiler.plugin>2.0.2</maven.compiler.plugin> 
     <maven.dependency.plugin>2.4</maven.dependency.plugin> 
     <maven.deploy.plugin>2.7</maven.deploy.plugin> 
     <maven.eclipse.plugin>2.9</maven.eclipse.plugin> 
     <maven.exec.plugin>1.2.1</maven.exec.plugin> 
     <maven.install.plugin>2.3.1</maven.install.plugin> 
     <maven.jar.plugin>2.4</maven.jar.plugin> 
     <maven.plugin.plugin>3.1</maven.plugin.plugin> 
     <maven.surefire.plugin>2.12</maven.surefire.plugin> 
     <maven.tomcat.plugin>2.0-beta-1</maven.tomcat.plugin> 
     <maven.version.range>[2.2.1,3.1.0)</maven.version.range> 
     <maven.versions.plugin>1.3.1</maven.versions.plugin> 
     <maven.war.plugin>2.2</maven.war.plugin> 
     <oracle.version>6</oracle.version> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
     <servlet-api.version>3.0.1</servlet-api.version> 
     <spring.version>4.0.6.RELEASE</spring.version> 
     <apache.core.http>4.3.2</apache.core.http> 
     <apache.http.client>4.3.4</apache.http.client> 
     <json.lib.jdk5>2.4</json.lib.jdk5> 
     <signpost.commonhttp4>1.2.1.1</signpost.commonhttp4> 
     <signpost.core>1.2.1.1</signpost.core> 
     <json.version>20140107</json.version> 
     <google.oauth.client>1.15.0-rc</google.oauth.client> 
     <org.restlet.org>2.0</org.restlet.org> 
     <org.restlet>2.0.8</org.restlet> 
    </properties> 

    <build> 

     <plugins> 
      <plugin> 
       <groupId>org.codehaus.sonar</groupId> 
        <artifactId>sonar-maven-plugin</artifactId> 
       <version>2.4</version> 

      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.3.2</version> 

       <configuration> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <version>2.3</version> 

       <configuration> 
        <warName>MyPoriject</warName> 
        <webappDirectory>${webappDirectory}</webappDirectory> 

        <webResources> 

         <resource> 
          <filtering>true</filtering> 
          <directory>src/main/webapp</directory> 

          <includes> 
           <include>**/*.xml</include> 
          </includes> 
         </resource> 
        </webResources> 

        <archive> 

         <manifest> 
          <addDefaultImplementationEntries>true</addDefaultImplementationEntries> 
          <addClasspath>true</addClasspath> 
         </manifest> 
        </archive> 
        <failOnMissingWebXml>false</failOnMissingWebXml> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

    <dependencies> 

     <dependency> 
      <groupId>commons-beanutils</groupId> 
      <artifactId>commons-beanutils</artifactId> 
      <version>${commons.beanutils.version}</version> 

      <exclusions> 

       <exclusion> 
        <groupId>commons-logging</groupId> 
        <artifactId>commons-logging</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 

     <dependency> 
      <groupId>commons-cli</groupId> 
      <artifactId>commons-cli</artifactId> 
      <version>${commons.cli.version}</version> 

      <exclusions> 

       <exclusion> 
        <groupId>junit</groupId> 
        <artifactId>junit</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 


     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>javax.servlet-api</artifactId> 
      <version>${servlet-api.version}</version> 
      <scope>provided</scope> 
     </dependency> 

     <dependency> 
      <groupId>javax.servlet.jsp</groupId> 
      <artifactId>jsp-api</artifactId> 
      <version>${jsp-api.version}</version> 
      <scope>provided</scope> 
     </dependency> 

     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>jstl</artifactId> 
      <version>${jstl.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>javax.validation</groupId> 
      <artifactId>validation-api</artifactId> 
      <version>${validation-api.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>${junit.version}</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-validator</artifactId> 
      <version>${hibernate.validator.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.apache.commons</groupId> 
      <artifactId>commons-exec</artifactId> 
      <version>${commons.exec.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-test</artifactId> 
      <version>${spring.version}</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-beans</artifactId> 
      <version>${spring.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-context</artifactId> 
      <version>${spring.version}</version> 
      <scope>compile</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-context-support</artifactId> 
      <version>${spring.version}</version> 
      <scope>compile</scope> 

      <exclusions> 

       <exclusion> 
        <groupId>quartz</groupId> 
        <artifactId>quartz</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 

     <dependency> 
      <groupId>org.codehaus.jackson</groupId> 
      <artifactId>jackson-mapper-asl</artifactId> 
      <version>${jackson.version}</version> 
     </dependency> 
      <dependency> 
      <groupId>org.hamcrest</groupId> 
      <artifactId>hamcrest-all</artifactId> 
      <version>${hamcrest.version}</version> 
      <scope>test</scope> 
     </dependency> 


     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-webmvc</artifactId> 
      <version>${spring.version}</version> 
      <scope>compile</scope> 
     </dependency> 

    </dependencies> 
</project> 
+0

разместим ваш pom.xml – Hohenheim

+0

попытаться заменить плагин гидроакустических этим: \t org.codehaus.sonar \t сонар-maven3-плагин \t 2,4 Hohenheim

+0

Готово. По-прежнему такая же ошибка – Prince

ответ

0

вы пробовали удалить орг/Codehaus/MOJO/сонар-Maven-плагин из локального репо и начать Maven снова?

+0

Да удалил его и запустил maven. По-прежнему получается такая же ошибка. – Prince

+0

Вы пробовали текущую версию плагина? org.codehaus.mojo сонар-Maven-плагин 3.0.1 UKoehler

+0

, если он еще не работает, я думаю, что у вас есть проблемы подключения к сети, специалист не может загрузить артефакт. ...... Загрузка: https://repo.maven.apache.org/maven2/org/codehaus/mojo/sonar-maven-plugin/maven-metadata.xml [ВНИМАНИЕ] Не удалось передать метаданные org.codehaus .mojo: sonar-maven-plugin/maven-metadata.xml от/до центра (https://repo.maven.apache.org/maven2): repo.maven.apache.org [ERROR] Ошибка при разрешении версии для плагина 'org.codehaus.mojo: sonar-maven-plugin' – UKoehler