Не могу установить плагин метрик на Дженкинс с mvn - PullRequest
0 голосов
/ 02 мая 2018

Я пытаюсь установить плагин metrics на сервере Jenkins и столкнулся с некоторыми проблемами, следуя инструкциям README проекта. Когда я пытаюсь release:prepare release:perform -B, я получаю это:

root@:/usr/share/jenkins/metrics-plugin# apache-maven-3.5.3/bin/mvn release:prepare release:perform -B
[INFO] Scanning for projects...
[WARNING] The project org.jenkins-ci.plugins:metrics:hpi:3.1.2.12 uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO]
[INFO] -------------------< org.jenkins-ci.plugins:metrics >-------------------
[INFO] Building Metrics Plugin 3.1.2.12
[INFO] --------------------------------[ hpi ]---------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.5.3:prepare (default-cli) @ metrics ---
[INFO] Resuming release from phase 'scm-tag'
[INFO] Tagging release with the label metrics-3.1.2.12...
[INFO] Executing: /bin/sh -c cd /usr/share/jenkins/metrics-plugin && git tag -F /tmp/maven-scm-946969304.commit metrics-3.1.2.12
[INFO] Working directory: /usr/share/jenkins/metrics-plugin
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.721 s
[INFO] Finished at: 2018-05-01T22:13:29Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project metrics: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-tag command failed.
[ERROR] Command output:
[ERROR] fatal: tag 'metrics-3.1.2.12' already exists
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Ссылка на apache бесполезна. Вот pom.xml, который я использую:

<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>

  <parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>2.37</version>
  </parent>

  <artifactId>metrics</artifactId>
  <version>3.1.2.12</version>
  <packaging>hpi</packaging>

  <name>Metrics Plugin</name>
  <description>
    This plugin exposes the Metrics API to Jenkins plugins.
  </description>
  <url>http://wiki.jenkins-ci.org/display/JENKINS/Metrics+Plugin</url>
  <licenses>
    <license>
      <name>The MIT license</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>stephenconnolly</id>
      <name>Stephen Connolly</name>
    </developer>
  </developers>

  <prerequisites>
    <maven>2.2.1</maven>
  </prerequisites>

  <scm>
    <connection>scm:git:git://github.com/jenkinsci/metrics-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:jenkinsci/metrics-plugin.git</developerConnection>
    <url>http://github.com/jenkinsci/metrics-plugin</url>
    <tag>metrics-3.1.2.12</tag>
  </scm>

  <properties>
    <jenkins.version>1.580</jenkins.version>
    <metrics.version>3.1.2</metrics.version>
    <java.level>6</java.level>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <project.build.outputEncoding>UTF-8</project.build.outputEncoding>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.findbugs.failure.strict>true</maven.findbugs.failure.strict>
  </properties>

  <repositories>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>http://repo.jenkins-ci.org/public/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>repo.jenkins-ci.org</id>
      <url>http://repo.jenkins-ci.org/public/</url>
    </pluginRepository>
  </pluginRepositories>

  <dependencies>
    <!-- regular dependencies -->
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-core</artifactId>
      <version>${metrics.version}</version>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-servlet</artifactId>
      <version>${metrics.version}</version>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-healthchecks</artifactId>
      <version>${metrics.version}</version>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-jvm</artifactId>
      <version>${metrics.version}</version>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-json</artifactId>
      <version>${metrics.version}</version>
      <exclusions>
        <exclusion>
          <!-- use the version supplied by jackson2-api -->
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-databind</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- plugin dependencies -->
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>jackson2-api</artifactId>
      <version>2.5.4</version>
    </dependency>
    <!-- jenkins dependencies -->
    <!-- test dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.infradna.tool</groupId>
        <artifactId>bridge-method-injector</artifactId>
        <version>1.14</version>
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project> 
...