Maven多模块项目在eclipse上运行tomcat

时间:2017-05-07 13:40:22

标签: java maven web tomcat7 multi-module

我是一个maven多模块项目,其结构定义如下[{3}}

我想使用maven在tomcat上运行这个项目,不要制作战争,然后在服务器上部署,但为此使用maven插件。

我已在网络模块中添加了此插件。

<plugins>
            <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>mytomcat</server>
                    <path>/BATest</path>
                    <username>tomcat</username>
                    <password>s3cret</password>
                </configuration>
            </plugin>

使用package tomcat7:run

运行根项目

但是收到错误

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] desktop
[INFO] JavaLearning
[INFO] web
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 6.2 KB/sec)
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 9.3 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] desktop ............................................ SKIPPED
[INFO] JavaLearning ....................................... SKIPPED
[INFO] web ................................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.897 s
[INFO] Finished at: 2017-05-07T18:25:07+05:00
[INFO] Final Memory: 12M/108M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'tomcat7' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (D:\Development\MAVEN_REPO), central (https://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException

这种方法在简单的maven web项目中运行良好。请帮助多模块maven项目。

0 个答案:

没有答案