2013-08-16 48 views
2

我試圖運行在一個詹金斯JIRA插件集成測試。我收到以下警告:詹金斯:類路徑中包含多個SLF4J綁定

Running xxx 
SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/prj/xxx/atlassian/repository/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/prj/xxx/atlassian/repository/org/slf4j/slf4j-simple/1.6.4/slf4j-simple-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 

任何想法如何禁用此?

我已經alrady閱讀:http://www.slf4j.org/codes.html#multiple_bindings

但這並沒有幫助我太多。

正是依賴或排斥(凡在pom.xml)做什麼,我需要設置爲擺脫這一警告的。

的pom.xml:

<?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>com.xxx</groupId> 
<artifactId>xxx</artifactId> 
<version>1.0</version> 

<organization> 
    <name>xxx</name> 
    <url>xxx</url> 
</organization> 

<name>ClearQuestIdTrimmer</name> 
<description>This plugin trims the ClearQuestIds.</description> 
<packaging>atlassian-plugin</packaging> 

<dependencies> 
    <dependency> 
     <groupId>com.atlassian.jira</groupId> 
     <artifactId>jira-api</artifactId> 
     <version>${jira.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <!-- Add dependency on jira-core if you want access to JIRA implementation classes as well as the sanctioned API. --> 
    <!-- This is not normally recommended, but may be required eg when migrating a plugin originally developed against JIRA 4.x --> 

    <dependency> 
     <groupId>com.atlassian.jira</groupId> 
     <artifactId>jira-core</artifactId> 
     <version>${jira.version}</version> 
     <scope>provided</scope> 
    </dependency> 
     <groupId>net.sourceforge.jexcelapi</groupId> 
     <artifactId>jxl</artifactId> 
     <version>2.6</version> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.11</version> 
     <scope>test</scope> 
    </dependency> 
    <!-- WIRED TEST RUNNER DEPENDENCIES --> 
    <dependency> 
     <groupId>com.atlassian.plugins</groupId> 
     <artifactId>atlassian-plugins-osgi-testrunner</artifactId> 
     <version>${plugin.testrunner.version}</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.ws.rs</groupId> 
     <artifactId>jsr311-api</artifactId> 
     <version>1.1.1</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.code.gson</groupId> 
     <artifactId>gson</artifactId> 
     <version>2.2.2-atlassian-1</version> 
    </dependency> 
    <!-- Uncomment to use TestKit in your project. Details at https://bitbucket.org/atlassian/jira-testkit --> 
    <!-- You can read more about TestKit at https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter+integration+testing+with+TestKit --> 
    <dependency> 
     <groupId>com.atlassian.jira</groupId> 
     <artifactId>jira-tests</artifactId> 
     <version>${jira.version}</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.atlassian.jira</groupId> 
     <artifactId>jira-func-tests</artifactId> 
     <version>${jira.version}</version> 
     <scope>test</scope> 
    </dependency> 
</dependencies> 
<build> 
    <plugins> 
     <plugin> 
      <groupId>com.atlassian.maven.plugins</groupId> 
      <artifactId>maven-jira-plugin</artifactId> 
      <version>${amps.version}</version> 
      <extensions>true</extensions> 
      <configuration> 
       <productDataPath>${project.basedir}/src/test/resources/generated-test-resources.zip</productDataPath> 
       <productVersion>${jira.version}</productVersion> 
       <productDataVersion>${jira.version}</productDataVersion> 
       <testGroups> 
        <testGroup> 
         <id>wired-integration</id> 
         <productIds> 
          <productId>jira</productId> 
         </productIds> 
         <includes> 
          <include>it/**/*WiredTest.java</include> 
         </includes> 
        </testGroup> 
        <testGroup> 
         <id>traditional-integration</id> 
         <productIds> 
          <productId>jira</productId> 
         </productIds> 
         <includes> 
          <include>it/**/*TrdTest.java</include> 
         </includes> 
        </testGroup> 
       </testGroups> 
       <!-- Uncomment to install TestKit backdoor in JIRA. --> 
       <!-- 
       <pluginArtifacts> 
        <pluginArtifact> 
         <groupId>com.atlassian.jira.tests</groupId> 
         <artifactId>jira-testkit-plugin</artifactId> 
         <version>${testkit.version}</version> 
        </pluginArtifact> 
       </pluginArtifacts> 
       --> 
      </configuration> 
     </plugin> 
     <plugin> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 
<properties> 
    <jira.version>6.1-20130626</jira.version> 
    <amps.version>4.2.3</amps.version> 
    <plugin.testrunner.version>1.1.1</plugin.testrunner.version> 
    <!-- TestKit version 5.x for JIRA 5.x, 6.x for JIRA 6.x --> 
    <testkit.version>6.0.25</testkit.version> 

    <!-- Set encoding to UTF 8 - needed for Jenkins Integration Test --> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 

    <!-- run integration tests in headless mode on CI --> 
    <xvfb.enable>true</xvfb.enable> 
</properties> 

+0

試試這個 MVN依賴性:樹要知道依賴關係樹 – mebada

回答

1

使用Maven Dependency插件跟蹤傳遞依賴的來源:

mvn dependency:tree -Dverbose -Dincludes=slf4j-simple 

與該輸出,你應該能夠添加所需的排除在pom.xml中。

+1

執行mvn依賴性:樹是我能找到的罐子我並不需要,並與標籤排除。 – user1337

1

我懷疑運行你的Maven構建本地當你沒有問題?如果是這樣,你可以忽略這個問題。如果你有同樣的問題,在本地則忽略接下來和使用依賴:樹:)

的原因是,詹金斯捆綁多個SLF4J綁定工作,圍繞一個致命的問題。

提交日誌是

捆綁SLF4J綁定到戰。見戰爭/ pom.xml中的 詳細討論了評論。這基本上是一個「該死的,如果我這樣做,該死的 ,如果我不這樣做」的情況下,但鑑於JENKINS-12334是一個致命錯誤, 和捆綁綁定jar的缺點是「多重綁定」 警告像小惡是將其捆綁和風險有些 警告。

Issue | Commit | More information