08 March 2017

blog

Utilisation du plugin tomcat7

Il convient d'ajouter la section suivante dans le pom.

      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <url>http://localhost:8080/manager/text</url>
          <server>hnltomcat8</server>
        </configuration>
      </plugin>

Le serveur indiqué dans le tag server, doit être configuré dans le fichier settings.xml de maven.

Sur windows le fichier est situé en : C:\Users\hnlocher.m2

	<settings>
		<servers>
			<server>
				<id>hnltomcat8</id>
				<username>hnl</username>
				<password>tomcat</password>
			</server>
		</servers>
	</settings>

Ensuite, en ligne de commande :

> mvn tomcat7:deploy

Références