Maven - No plugin found for prefix 'tomcat7' in the current project and in the plugin groups

后端 未结 6 1152
醉梦人生
醉梦人生 2021-02-12 03:49

I\'ve created a Maven project. This is the structure:

-parent
    -core
    -web

but when I try to dep

6条回答
  •  半阙折子戏
    2021-02-12 03:58

    Plugins goals can be called using their 'FQN': groupId:artifactId:version:goal or, if applicable, shorter commands (many variants available). Using only the short name of a plugin (in your tomcat7:deploy, tomcat7 is the short name, deploy being the goal/mojo) is applicable if:

    1) the groupId of the plugin is contained in the known plugin groups of Maven. org.apache.maven.plugins being in the list by default.

    OR

    the pom.xml of the project you're invoking the Maven command on declares the plugin

    2) the artifactId is [short-name]-maven-plugin or maven-[short-name]-plugin (maven-[short-name]-plugin being 'reserved' for plugins provided by Maven project.

    That explains why mvn compiler:compile can work out of the box on any project, but not tomcat7:deploy

    In your case, the second condition is true, so you just have to declare the plugin on the project you're launching the command on, or add this to your user settings.xml file:

    
      org.apache.tomcat.maven
    
    

    See here for more info

提交回复
热议问题