I am having trouble in deploying to remote machine with tomcat installed as aservice.
My tomcat-users is as follows:
<tomcat-users>
<role rolename="manager"/>
<user username="admin" password="admin" roles="tomcat, admin, manager-gui, manager-script"/>
</tomcat-users>
My settings.xml is:
<settings>
<pluginGroups>
<pluginGroup>org.apache.tomcat.maven</pluginGroup>
</pluginGroups>
<servers>
<server>
<id>tomcat7</id>
<username>admin</username>
<password>admin</password>
</server>
</servers>
</settings>
And my pom.xml has the following:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<server>tomcat7</server>
<url>http://localhost:8081/manager/text</url>
<warFile>target/editor-${project.version}.war</warFile>
</configuration>
And I keep on getting the 401 Unauthorized on the output of maven console. Can you tell me what am I doing wrong?
try to run mvn with -x -e
then you will see what kind of info is sending to server. my guess is that the server doesnt get username/pass. which means something wrong with the configuration file i.e:settings.xml
how does tomcat7-maven-plugin knows where settings.xml is ?
EDIT: check out this which-maven-settings-xml-files
elek offered there to run mvn with -X and in the begining you see
“Reading user settings from .user/.m2/settings.xml..