Configure the following content (in the <tomcat-users> tag </tomcat-users>) in the tomcat conf directory tomcat-users.xml for deployment:
<role rolename="manager"/> <role rolename="manager-gui"/> <role rolename="admin"/> <role rolename="admin-gui"/> <role rolename="admin-gui"/> <role rolename="manager-script"/
Start tomcat, access http:ip:8080/manager to verify that tomcat user is successfully configured
Configure plugin in pom.xml of maven project
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <configuration> <port>8080</port> <path>/mvc</path> <url>http://192.168.43.128:8080/manager/text</url> <username>tomcat</username> <password>tomcat</password> </configuration> </plugin>
Run the configuration
Click Run-->Edit Configurations
Click the + sign and select Maven.
Enter information
Name The name given to the run configuration
Working directory (project directory)
Command line command tomcat7:deploy or tomcat7:redeploy
Click OK to save.
Find the newly prepared configuration under the Run menu and run
[INFO] Scanning for projects...[WARNING] [WARNING] Some problems were encountered while building the effective model for org.jstudioframework:jstudio-mvc:war:1.0-SNAPSHOT[WARNING] 'build.plugins.plugin.version' for org.apache.tomcat.maven:tomcat7-maven-plugin is missing. @ line 91, column 21[WARNING] [WARNING] It is highly recommended to fix these problems Because they threaten the stability of your building.[WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.[WARNING] [INFO] [INFO] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) @ jstudio-mvc >>>[INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ jstudio-mvc ---[debug] execute contextualize[INFO] Using 'UTF-8' encoding to copy filtered resources.[INFO] Copying 5 resources[INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ jstudio-mvc ---[INFO] Nothing to compile - all classes are up to date[INFO] [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ jstudio-mvc ---[debug] execute contextualize[INFO] Using 'UTF-8' encoding to copy filtered resources.[INFO] skip non existing resourceDirectory E:/JstudioProject1/JstudioMvc/src/test/resources[INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ jstudio-mvc ---[INFO] Nothing to compile - all classes are up to date[INFO] [INFO] --- maven-surefire-plugin:2.14:test (default-test) @ jstudio-mvc ---[INFO] Tests are skipped.[INFO] [INFO] --- maven-war-plugin:2.1.1:war (default-war) @ jstudio-mvc ---[INFO] Packaging webapp[INFO] Assembling webapp [jstudio-mvc] in [E:/JstudioProject1/JstudioMvc/target/jstudio-mvc-1.0-SNAPSHOT][INFO] Processing war project[INFO] Copying webapp resources [E:/JstudioProject1/JstudioMvc/src/main/webapp][INFO] Webapp assembled in [177 msecs][INFO] Building war: E:/JstudioProject1/JstudioMvc/target/jstudio-mvc-1.0-SNAPSHOT.war[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored (webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')[INFO] [INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) @ jstudio-mvc <<<[INFO] [INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ jstudio-mvc ---[INFO] Deploying war to http://192.168.43.128:8080/mvc SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Defaulting to no-operation (NOP) logger implementationSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.Uploading: http://192.168.43.128:8080/manager/text/deploy?path=%2Fmvc&update=trueUploaded: http://192.168.43.128:8080/manager/text/deploy?path=%2Fmvc&update=true (7445 KB at 7083.3 KB/sec)[INFO] tomcatManager status code:200, ReasonPhrase:OK[INFO] OK - Deployed application at context path /mvc[INFO] -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- exit code 0
Release was successful.
You can see newly released apps in tomcat manager.
Method 2:
These red-labeled menus can be published remotely
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.