【问题标题】:Wro4j maven plugin - required class is missingWro4j Maven 插件 - 缺少必需的类
【发布时间】:2012-10-22 06:59:10
【问题描述】:

我正在尝试根据documentation 运行 wro4j maven 插件

我将插件添加到我的 pom.xml:

<plugin>
    <groupId>ro.isdc.wro4j</groupId>
    <artifactId>wro4j-maven-plugin</artifactId>
    <version>1.5.0</version>
</plugin>

并运行目标:

mvn wro4j:run -Dminimize=true -DtargetGroups=all

但是构建失败并出现错误:

org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the pl
ugin manager executing goal 'ro.isdc.wro4j:wro4j-maven-plugin:1.5.0:run': Unable
to load the mojo 'ro.isdc.wro4j:wro4j-maven-plugin:1.5.0:run' in the plugin 'ro
.isdc.wro4j:wro4j-maven-plugin'. A required class is missing: org/codehaus/plexu
s/util/Scanner

你知道如何避免这个错误吗?

【问题讨论】:

  • 使用最新版本 (1.6.0) 可以解决问题吗?
  • 我不知道。 1.6.0 版本使用的 slf4j 版本比我的应用程序依赖的版本更高,因此由于 slf4j 向后不兼容,我无法使用它。

标签: maven plexus wro4j


【解决方案1】:

从 wro4j-1.5.0 开始,运行插件需要 maven 3.0。原因是一个称为增量构建支持的功能,它依赖于一个默认情况下在旧版本的 maven 上不可用的库。

【讨论】:

    【解决方案2】:

    问题在于您的本地环境。

    在我的 Windows 机器上转到这个文件夹:${user.home}/.m2/repository,然后删除这个文件夹中的所有内容。 (嗯,你可以保留一份。)

    删除后,运行Maven命令:mvn clean install -U

    见:https://groups.google.com/forum/#!topic/wro4j/ZPSFBQ_5lI8

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-13
      • 2020-12-11
      • 1970-01-01
      • 1970-01-01
      • 2015-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多