如何找到我应该排除库的依赖项?

时间:2018-04-03 11:41:29

标签: maven maven-site-plugin

我将Maven从 3.0.5 更新为 3.5.3 版本。我使用 maven-site-plugin-3.7

更新后,我尝试执行命令“mvn site site:deploy”。我有以下错误:

[ERROR] : org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: Invalid class loader 
hierarchy.  You have more than one version of 
'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by 
org.apache.commons.logging.LogConfigurationException: Invalid class loader 
hierarchy.  You have more than one version of 
'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by     
org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: Invalid class loader 
hierarchy.  You have more than one version of 
'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by 
org.apache.commons.logging.LogConfigurationException: Invalid class loader 
hierarchy.  You have more than one version of 
'org.apache.commons.logging.Log' visible, which is not allowed.))

当我执行依赖:树依赖:list 时,我有空的依赖列表。当我执行依赖:resolve-pugins 时,我有以下内容:

 --- maven-dependency-plugin:2.1:resolve-plugins (default-cli) @ ftpbc ---
[INFO] Plugin Resolved: maven-enforcer-plugin-1.0.jar
[INFO]     Plugin Dependency Resolved: maven-artifact-2.0.9.jar
[INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.9.jar
[INFO]     Plugin Dependency Resolved: maven-project-2.0.9.jar
[INFO]     Plugin Dependency Resolved: maven-core-2.0.9.jar
[INFO]     Plugin Dependency Resolved: plexus-utils-1.5.8.jar
[INFO]     Plugin Dependency Resolved: commons-lang-2.3.jar
[INFO]     Plugin Dependency Resolved: enforcer-api-1.0.jar
[INFO]     Plugin Dependency Resolved: enforcer-rules-1.0.jar
[INFO] Plugin Resolved: maven-site-plugin-3.7.jar
[INFO]     Plugin Dependency Resolved: maven-reporting-exec-1.4.jar
[INFO]     Plugin Dependency Resolved: maven-shared-utils-3.1.0.jar
[INFO]     Plugin Dependency Resolved: maven-core-3.0.jar
[INFO]     Plugin Dependency Resolved: maven-model-3.0.jar
[INFO]     Plugin Dependency Resolved: maven-plugin-api-3.0.jar
[INFO]     Plugin Dependency Resolved: maven-settings-3.0.jar
[INFO]     Plugin Dependency Resolved: maven-settings-builder-3.0.jar
[INFO]     Plugin Dependency Resolved: maven-archiver-3.1.1.jar
[INFO]     Plugin Dependency Resolved: sisu-inject-plexus-1.4.2.jar
[INFO]     Plugin Dependency Resolved: plexus-archiver-3.4.jar
[INFO]     Plugin Dependency Resolved: plexus-i18n-1.0-beta-10.jar
[INFO]     Plugin Dependency Resolved: plexus-utils-3.0.24.jar
[INFO]     Plugin Dependency Resolved: plexus-classworlds-2.5.2.jar
[INFO]     Plugin Dependency Resolved: doxia-sink-api-1.8.jar
[INFO]     Plugin Dependency Resolved: doxia-module-xhtml-1.8.jar
[INFO]     Plugin Dependency Resolved: doxia-module-apt-1.8.jar
[INFO]     Plugin Dependency Resolved: doxia-module-xdoc-1.8.jar
[INFO]     Plugin Dependency Resolved: doxia-module-fml-1.8.jar
[INFO]     Plugin Dependency Resolved: doxia-module-markdown-1.8.jar
[INFO]     Plugin Dependency Resolved: servlet-api-2.5.jar
[INFO]     Plugin Dependency Resolved: doxia-decoration-model-1.8.jar
[INFO]     Plugin Dependency Resolved: doxia-site-renderer-1.8.jar
[INFO]     Plugin Dependency Resolved: doxia-integration-tools-1.8.jar
[INFO]     Plugin Dependency Resolved: wagon-provider-api-1.0.jar
[INFO]     Plugin Dependency Resolved: jetty-6.1.25.jar
[INFO]     Plugin Dependency Resolved: jetty-util-6.1.25.jar
[INFO]     Plugin Dependency Resolved: commons-lang3-3.4.jar
[INFO]     Plugin Dependency Resolved: commons-io-2.5.jar
[INFO] Plugin Resolved: maven-clean-plugin-2.4.1.jar
[INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
[INFO]     Plugin Dependency Resolved: plexus-utils-2.0.5.jar
[INFO] Plugin Resolved: maven-deploy-plugin-2.5.jar
[INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
[INFO]     Plugin Dependency Resolved: maven-project-2.0.6.jar
[INFO]     Plugin Dependency Resolved: maven-model-2.0.6.jar
[INFO]     Plugin Dependency Resolved: maven-artifact-2.0.6.jar
[INFO]     Plugin Dependency Resolved: plexus-utils-1.5.6.jar
[INFO] Plugin Resolved: maven-clover2-plugin-2.6.3.jar
[INFO]     Plugin Dependency Resolved: plexus-compiler-api-1.5.3.jar
[INFO]     Plugin Dependency Resolved: plexus-resources-1.0-alpha-4.jar
[INFO]     Plugin Dependency Resolved: plexus-utils-1.5.6.jar
[INFO]     Plugin Dependency Resolved: maven-project-2.0.9.jar
[INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.9.jar
[INFO]     Plugin Dependency Resolved: ant-1.7.1.jar
[INFO]     Plugin Dependency Resolved: ant-launcher-1.7.1.jar
[INFO]     Plugin Dependency Resolved: maven-reporting-impl-2.0.4.jar
[INFO]     Plugin Dependency Resolved: maven-artifact-2.0.9.jar
[INFO]     Plugin Dependency Resolved: clover-2.6.3.jar
[INFO] Plugin Resolved: maven-install-plugin-2.3.1.jar
[INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.6.jar
[INFO]     Plugin Dependency Resolved: maven-project-2.0.6.jar
[INFO]     Plugin Dependency Resolved: maven-model-2.0.6.jar
[INFO]     Plugin Dependency Resolved: maven-artifact-manager-2.0.6.jar
[INFO]     Plugin Dependency Resolved: maven-artifact-2.0.6.jar
[INFO]     Plugin Dependency Resolved: plexus-utils-2.0.5.jar
[INFO]     Plugin Dependency Resolved: plexus-digest-1.0.jar

当我从 commons-logging 库中找不到 org.apache.commons.logging.Log 时,需要从某个依赖项中排除该库。但我在依赖列表中没有看到 commons-logging

问题是我找不到哪里可以排除 commons-logging

如何找到 commons-logging 依赖项?或者还有其他问题吗?

1 个答案:

答案 0 :(得分:0)

尝试将特定版本的依赖项添加到pom中,例如:

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
    </dependency>

我看到有时可以解决此问题,有时可以为您提供有关传递依赖的更多信息