You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by emerson <ec...@gmail.com> on 2011/02/18 23:22:18 UTC

Maven tomcat-maven-plugin doesn't take configuration in the pom.xml in account

I'm trying to set up my maven2 project to deploy to my local tomcat.
In the pom I added:

...
<build>
<plugins>
 <plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>tomcat-maven-plugin</artifactId>
 <configuration>
    <server>tomcat</server>
    <url>http://localhost:8081/manager</url>
    <path>/freecologic</path>
 </configuration>
 </plugin>
...
But when I run:

mvn tomcat:deploy

Maven seems to deploy to the default port:

[INFO] Processing war project
[INFO] Copying webapp resources[C:\dev\workspace\appjsf\src\main\webapp]
[INFO] Webapp assembled in[3301 msecs]
[INFO] Building war: C:\dev\workspace\appjsf\targetappjsf-1.0-SNAPSHOT.war
[INFO] [tomcat:deploy {execution: default-cli}]
[INFO] Deploying war to http://localhost:8080/appjsf
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot invoke Tomcat manager
Embedded error: Connection refused: connect
[INFO] ------------------------------------------------------------------------


Would be that maven isn't taking the configuration in account? I
doubled checked and everything seems to be right.

thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven tomcat-maven-plugin doesn't take configuration in the pom.xml in account

Posted by Wayne Fay <wa...@gmail.com>.
Perhaps try adding a default-cli execution as below:

>  <plugin>
>  <groupId>org.codehaus.mojo</groupId>
>  <artifactId>tomcat-maven-plugin</artifactId>
<executions>
<execution>
      <id>default-cli</id>
>  <configuration>
>    <server>tomcat</server>
>    <url>http://localhost:8081/manager</url>
>    <path>/freecologic</path>
>  </configuration>
</execution>
</executions>
>  </plugin>

This is documented here:
http://maven.apache.org/guides/mini/guide-default-execution-ids.html

Otherwise, check was "mvn help:effective-pom" tells you about your
tomcat-m-p configuration. Maybe a parent is affecting the build
config?

Also, you should add a version to the plugin node, its a best practice.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org