Deploy aplicacion springMVC en Sevidor local Tomcat 9, Manualmente
Creamos una aplicación spring MVC con el template de Eclipse Ide https://jalbertomr.blogspot.com/2019/08/configurar-ambiente-springmvc-apache.htmlLe hacemos algunas modificaciones, como acortar la version en el POM para que el war salga más corto. y una página extra con miController.java y mi.jsp.
desde terminal damos mvn clean, mvn install
bext@bext-VPCF13WFX:~/eclipse-workspace/springMVCTomcat$ mvn clean [INFO] Scanning for projects... [INFO] [INFO] -------------------------< com.bext:springMVC >------------------------- [INFO] Building springMVCTomcat 1 [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ springMVC --- [INFO] Deleting /home/bext/eclipse-workspace/springMVCTomcat/target [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.510 s [INFO] Finished at: 2019-08-02T18:16:28-05:00 [INFO] ------------------------------------------------------------------------ bext@bext-VPCF13WFX:~/eclipse-workspace/springMVCTomcat$ mvn install [INFO] Scanning for projects... [INFO] [INFO] -------------------------< com.bext:springMVC >------------------------- [INFO] Building springMVCTomcat 1 [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ springMVC --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ springMVC --- [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 2 source files to /home/bext/eclipse-workspace/springMVCTomcat/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ springMVC --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ springMVC --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ springMVC --- [INFO] [INFO] --- maven-war-plugin:2.2:war (default-war) @ springMVC --- [INFO] Packaging webapp [INFO] Assembling webapp [springMVC] in [/home/bext/eclipse-workspace/springMVCTomcat/target/springMVC-1] [INFO] Processing war project [INFO] Copying webapp resources [/home/bext/eclipse-workspace/springMVCTomcat/src/main/webapp] [INFO] Webapp assembled in [90 msecs] [INFO] Building war: /home/bext/eclipse-workspace/springMVCTomcat/target/springMVC-1.war [INFO] WEB-INF/web.xml already added, skipping [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ springMVC --- [INFO] Installing /home/bext/eclipse-workspace/springMVCTomcat/target/springMVC-1.war to /home/bext/.m2/repository/com/bext/springMVC/1/springMVC-1.war [INFO] Installing /home/bext/eclipse-workspace/springMVCTomcat/pom.xml to /home/bext/.m2/repository/com/bext/springMVC/1/springMVC-1.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.493 s [INFO] Finished at: 2019-08-02T18:16:41-05:00 [INFO] ------------------------------------------------------------------------ bext@bext-VPCF13WFX:~/eclipse-workspace/springMVCTomcat$
Nos genera el war que llamaremos en la página de administración de tomcat.
Nuestro servidor tomcat debe estar arriba.
bext@bext-VPCF13WFX:/opt/tomcat$ sudo systemctl start tomcat
En la página de tomcat elegimos el archivo war y le damos deploy.
Aparecera en la lista de aplicaciones
La llamamos con un click desde la lista de aplicaciones o con la url ingresada manualmente.
Podemos indicarle otro Context Path en lugar de springMVC que en este caso lo heredo del idArtifact cuando creamos el POM. Para ello undeployamos la aplicación, y el apache admin especificamos la ruta del war (/home/bext/eclipse-workspace/springMVCTomcat/target/springMVC-1.war) y el Context Path, por ejemplo /otroCamino
En la lista de aplicaciones ya nos aparece como /otroCamino, el cual clickeamos para verificarlo.
eot
No hay comentarios:
Publicar un comentario