简体   繁体   中英

run mvn use tomcat7:deploy BUILD FAIL

I try to use mvn build a basic java web project.

at pom.xml, i add plugin:

<plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <url>http://localhost:8080/manager/text</url>
                <server>tomcat7</server>
                <path>/babasport</path>
                <username>tomcat</username>
                <password>password</password>
                <ignorePackaging>true</ignorePackaging>
                <charset>utf-8</charset>
            </configuration>
        </plugin>

then i run mvn with eclipse like this : tomcat7:redeploy

I donot know why it is fail, log like below, it is show BUILD FAILD. i try to run mvn use package , the war file created success. So the project files are right.

some fails log:

[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building babasport Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) > package @ babasport >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ babasport ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ babasport ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ babasport ---
[INFO] Not copying test resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ babasport ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ babasport ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ babasport ---
[INFO] Packaging webapp
[INFO] Assembling webapp [babasport] in [D:\github\eclipse_mars_template\babasport\target\babasport]
[INFO] Processing war project
[INFO] Copying webapp resources [D:\github\eclipse_mars_template\babasport\src\main\webapp]
[INFO] Webapp assembled in [22 msecs]
[INFO] Building war: D:\github\eclipse_mars_template\babasport\target\babasport.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) < package @ babasport <<<
[INFO] 
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ babasport ---
[WARNING] The POM for org.apache.tomcat:tomcat-jasper:jar:7.0.47 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.tomcat:tomcat-tribes:jar:7.0.47 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.google.guava:guava:jar:10.0.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.httpcomponents:httpclient:jar:4.3.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for commons-lang:commons-lang:jar:2.6 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for commons-cli:commons-cli:jar:1.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] Deploying war to http://localhost:8080/babasport  
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.195 s
[INFO] Finished at: 2017-12-02T21:34:44+08:00
[INFO] Final Memory: 17M/210M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:redeploy (default-cli) on project babasport: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:redeploy failed: A required class was missing while executing org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:redeploy: org/apache/http/HttpEntity
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.tomcat.maven:tomcat7-maven-plugin:2.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/maven/tomcat7-maven-plugin/2.2/tomcat7-maven-plugin-2.2.jar
[ERROR] urls[1] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/7.0.47/tomcat-embed-core-7.0.47.jar
[ERROR] urls[2] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-util/7.0.47/tomcat-util-7.0.47.jar
[ERROR] urls[3] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-coyote/7.0.47/tomcat-coyote-7.0.47.jar
[ERROR] urls[4] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-api/7.0.47/tomcat-api-7.0.47.jar
[ERROR] urls[5] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-jdbc/7.0.47/tomcat-jdbc-7.0.47.jar
[ERROR] urls[6] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-dbcp/7.0.47/tomcat-dbcp-7.0.47.jar
[ERROR] urls[7] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-servlet-api/7.0.47/tomcat-servlet-api-7.0.47.jar
[ERROR] urls[8] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-jsp-api/7.0.47/tomcat-jsp-api-7.0.47.jar
[ERROR] urls[9] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-jasper/7.0.47/tomcat-jasper-7.0.47.jar
[ERROR] urls[10] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-jasper-el/7.0.47/tomcat-jasper-el-7.0.47.jar
[ERROR] urls[11] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-el-api/7.0.47/tomcat-el-api-7.0.47.jar
[ERROR] urls[12] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-catalina/7.0.47/tomcat-catalina-7.0.47.jar
[ERROR] urls[13] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-tribes/7.0.47/tomcat-tribes-7.0.47.jar
[ERROR] urls[14] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-catalina-ha/7.0.47/tomcat-catalina-ha-7.0.47.jar
[ERROR] urls[15] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-annotations-api/7.0.47/tomcat-annotations-api-7.0.47.jar
[ERROR] urls[16] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/tomcat-juli/7.0.47/tomcat-juli-7.0.47.jar
[ERROR] urls[17] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/7.0.47/tomcat-embed-logging-juli-7.0.47.jar
[ERROR] urls[18] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.47/tomcat-embed-logging-log4j-7.0.47.jar
[ERROR] urls[19] = file:/C:/Users/LIUWEN/.m2/repository/org/eclipse/jdt/core/compiler/ecj/4.2.2/ecj-4.2.2.jar
[ERROR] urls[20] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/maven/common-tomcat-maven-plugin/2.2/common-tomcat-maven-plugin-2.2.jar
[ERROR] urls[21] = file:/C:/Users/LIUWEN/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[22] = file:/C:/Users/LIUWEN/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1.jar
[ERROR] urls[23] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/httpcomponents/httpclient/4.3.1/httpclient-4.3.1.jar
[ERROR] urls[24] = file:/C:/Users/LIUWEN/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[25] = file:/C:/Users/LIUWEN/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
[ERROR] urls[26] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/tomcat/maven/tomcat7-war-runner/2.2/tomcat7-war-runner-2.2.jar
[ERROR] urls[27] = file:/C:/Users/LIUWEN/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
[ERROR] urls[28] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.jar
[ERROR] urls[29] = file:/C:/Users/LIUWEN/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
[ERROR] urls[30] = file:/C:/Users/LIUWEN/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar
[ERROR] urls[31] = file:/C:/Users/LIUWEN/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] urls[32] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar
[ERROR] urls[33] = file:/C:/Users/LIUWEN/.m2/repository/org/tukaani/xz/1.0/xz-1.0.jar
[ERROR] urls[34] = file:/C:/Users/LIUWEN/.m2/repository/org/codehaus/plexus/plexus-archiver/2.1.1/plexus-archiver-2.1.1.jar
[ERROR] urls[35] = file:/C:/Users/LIUWEN/.m2/repository/junit/junit/4.10/junit-4.10.jar
[ERROR] urls[36] = file:/C:/Users/LIUWEN/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar
[ERROR] urls[37] = file:/C:/Users/LIUWEN/.m2/repository/org/codehaus/plexus/plexus-io/2.0.3/plexus-io-2.0.3.jar
[ERROR] urls[38] = file:/C:/Users/LIUWEN/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.jar
[ERROR] urls[39] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.jar
[ERROR] urls[40] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
[ERROR] urls[41] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
[ERROR] urls[42] = file:/C:/Users/LIUWEN/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[ERROR] urls[43] = file:/C:/Users/LIUWEN/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[44] = file:/C:/Users/LIUWEN/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[45] = file:/C:/Users/LIUWEN/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[46] = file:/C:/Users/LIUWEN/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
[ERROR] urls[47] = file:/C:/Users/LIUWEN/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.5/jcl-over-slf4j-1.7.5.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.apache.http.HttpEntity
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

With all those JAR corruptions i'd remove the ENTIRE ".m2" folder (maven's entire repostitory) and try again. Not telling else what's wrong in there. I'd never trust it again until doing a full cleanout.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM