close

  Log4J的1.3版還在阿法貝塔階段。1.2版最新到1.2.15,但用於Eclipse上的Maven2卻有個Issue。在執行Maven Clean後再執行Maven Package會Build Failure,有以下的錯誤訊息:

[WARNING] Invalid POM for javax.jms:jms:jar:1.1, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Invalid POM for com.sun.jdmk:jmxtools:jar:1.2.1, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Invalid POM for com.sun.jmx:jmxri:jar:1.2.1, transitive dependencies (if any) will not be available, enable debug logging for more details

  這些loss的Jar在repository都空有其pom.xml檔卻無其jar檔。反而使用Eclipse的Project/Clean後,再執行Maven Package才能Build Success。但回到1.2.14版卻無此問題,經過Dependency Graph才得知Log4J 1.2.15依賴上述三個Jar之故。為何經過Project/Clean後再Package就沒問題?唔!無解,可能是循環依賴所致吧!

  2010/3/11補述。後來找到引用1.2.15的解法,dependency設定如下:

<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.15</version>
        <exclusions>
       <exclusion>
      <groupId>javax.jms</groupId>
      <artifactId>jms</artifactId>
       </exclusion>
       <exclusion>
      <groupId>com.sun.jdmk</groupId>
      <artifactId>jmxtools</artifactId>
       </exclusion>
       <exclusion>
      <groupId>com.sun.jmx</groupId>
      <artifactId>jmxri</artifactId>
       </exclusion>
       <exclusion>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
       </exclusion>
    </exclusions>
</dependency>

  利用排除之法就能引用1.2.15來Maven Package。

2010/5/12補充:1.2.16版就沒這個情形。

arrow
arrow
    全站熱搜

    Jemmy 發表在 痞客邦 留言(0) 人氣()