引起:org.apache.maven.plugin.PluginContainerException:

时间:2015-04-13 09:21:39

标签: java eclipse maven tomcat

Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy: org/apache/commons/codec/binary/Base64

当我尝试将示例Web项目部署到Tomcat时,我收到上述错误消息。 tomcat-maven-plugin:1.1 jar存在于我的本地存储库中。

的pom.xml

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
    <source>1.7</source>
    <target>1.7</target>
</configuration>
</plugin>
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.1</version>
    <configuration>
        <server>tomcat</server>
        <url>http://localhost:8080/manager/text</url>
    </configuration>
    <goals>
        <goal>deploy</goal>
    </goals>
</plugin>

1 个答案:

答案 0 :(得分:0)

它可能与commons-codec.jar相关联。从http://commons.apache.org/proper/commons-codec/download_codec.cgi下载。 然后添加项目构建路径。要做到这一点,请右键单击该项目,单击属性,单击&#34; Java Build Path&#34;,打开&#34; Library&#34;选项卡,然后单击&#34;添加外部JAR ...&#34;。

或者如果您正在使用maven添加依赖项

<dependency>
    <groupId>commons-codec</groupId>
    <artifactId>commons-codec</artifactId>
    <version>1.6</version>
</dependency>