Skip to content

Instantly share code, notes, and snippets.

@ezhov-da
Last active March 10, 2019 12:15
Show Gist options
  • Save ezhov-da/01ea912f62da161fd3d62168250bb298 to your computer and use it in GitHub Desktop.
Save ezhov-da/01ea912f62da161fd3d62168250bb298 to your computer and use it in GitHub Desktop.
Для того, чтоб деплоить war на сервер tomcat, необходимо:
1. В файле: /бла-бла/apache-tomcat-7.0.65/conf/tomcat-users.xml
Определить роль:
<role rolename="manager-script"/>
Добавить роль к пользователю:
<user username="username" password="password" roles="manager-script"/>
2. Добавить в pom.xml:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>https://host:port/manager/text</url>
<path>/путь к приложению (обычно как название war)</path>
<username>пользователь</username>
<password>пароль</password>
<update>true</update>
</configuration>
</plugin>
3. Использовать команды:
mvn tomcat7:deploy
mvn tomcat7:undeploy
mvn tomcat7:redeploy
В случае успеха:
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] OK - Deployed application at context path /groovy-service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment