After searching a bunch of articles on the Internet, we found no solution, only the plugin of tomcat7 Maven plugin, as follows:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
There is no plugin for tomcat8 Maven plugin. There is no such plugin in Maven’s central warehouse
https://repository.apache.org/content/repositories/snapshots/org/apache/tomcat/maven/
One was found in the MVN repository
Adding the above dependency to pom.xml either prompts that the dependency cannot be found or cannot be downloaded. After searching for a long time, we found a solution, which is to use & lt; in Maven; pluginRepositories> ,& lt; pluginRepositories> It is used to configure the plug-in address, because all functions of Maven are implemented by plug-ins, so you need to download the plug-in package from a specific address
Add the following to POM. XML
<pluginRepositories>
<pluginRepository>
<id>alfresco-public</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</pluginRepository>
<pluginRepository>
<id>alfresco-public-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>beardedgeeks-releases</id>
<url>http://beardedgeeks.googlecode.com/svn/repository/releases</url>
</pluginRepository>
</pluginRepositories>
Add the tomcat8-maven-plugin dependency
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat8-maven-plugin</artifactId>
<version>3.0-r1655215</version>
<configuration>
<url>http://localhost:8080/manager/html</url>
<server>tomcat</server>
</configuration>
</plugin>
Then you can use tomcat8-maven-plugin plugin.
When you deploy for the first time, you can change the command to tomcat8:redeploy when you redeploy.
Similar Posts:
- Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]
- How to Solve Error: spring-boot-maven-plugin not found
- [Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0
- [Solved] SpringBoot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-res
- [Solved] Plugin ‘org.springframework.boot:spring-boot-maven-plugin:’not found
- [Solved] Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central
- Springboot always reports an error when importing JSP dependencies
- Maven no main manifest attribute when generate jar for project
- Failed to initialize end point associated with ProtocolHandler [“http-bio-8080”]
- Unregistering JMX-exposed beans on shutdown Solution