0

I've seen maven plugins setting configurations tied to goals. I'd like to do that with my tomcat7-maven-plugin. However, this doesn't seem to work; when I run deploy it's defaulting to localhost. Does this plugin not accept different configs or am I doing something wrong?

<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <executions> <execution> <id>deploy</id> <goals> <goal>deploy</goal> <goal>redeploy</goal> </goals> <configuration> <url>${tomcat-manager-url}/manager/text</url> <username>${tomcat-manager-username}</username> <password>${tomcat-manager-password}</password> <path>/${project.artifactId}1</path> </configuration> </execution> <execution> <id>run</id> <goals> <goal>run</goal> </goals> <configuration> <path>/</path> </configuration> </execution> </executions> </plugin> 
5
  • When you're saying you're running deploy, you mean the Maven command you're using is mvn clean deploy? Commented Nov 10, 2016 at 17:38
  • Sorry, should have specified: mvn tomcat7:[re]deploy or mvn tomcat7:run Commented Nov 10, 2016 at 17:39
  • Ah, then this is normal, you missed this comment of mine on the linked question. You're using the default execution with this command, which is different than the ones you configured. See also stackoverflow.com/questions/38815961/… Commented Nov 10, 2016 at 17:43
  • ugh. that's irritating. Commented Nov 10, 2016 at 17:51
  • I amended my answer you linked over there, to include the rationale behind this as well. Commented Nov 10, 2016 at 17:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.