Hi,

I am trying to configure the maven tomcat plugin to use a non-default server
as well as username/password.
In my pom.xml I added:

<build>
        <finalName>cdbweb2</finalName>

        ...

        <plugins>
           <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <configuration>
                       <url>http://lxdev27/manager</url>
                       <server>myserver</server>
                </configuration>
            </plugin>
        </plugins>
</build>

And created a settings.xml file (in the same directory as pom.xml) with the
contents:

<server>
        <id>myserver</id>
        <username>tomcat</username>
        <password>qwerty</password>
</server>

When I run any goals, like tomcat:info for example, I get:

# mvn tomcat:info
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'tomcat'.
[INFO]
----------------------------------------------------------------------------
[INFO] Building CDBWEB2
[INFO]    task-segment: [tomcat:info]
[INFO]
----------------------------------------------------------------------------
[INFO] [tomcat:info]
[INFO] Listing server information at http://lxdev27/manager
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Server not defined in settings.xml: myserver
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Fri Jan 11 10:21:41 CET 2008
[INFO] Final Memory: 2M/6M
[INFO]
------------------------------------------------------------------------


Although, if I do a wget with the same credentials, it succeeds:

# wget --user=tomcat --password=qwerty http://lxdev27/manager/serverinfo
--10:22:32--  http://lxdev27/manager/serverinfo
           => `serverinfo.1'
Resolving lxdev27... 128.142.200.202
Connecting to lxdev27|128.142.200.202|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]

    [ <=>                                                                  ]
189           --.--K/s

10:22:32 (3.56 MB/s) - `serverinfo.1' saved [189]


Am I missing something?
I am using Maven 2 and Tomcat 5.5.23.

cheers

-- 
Filipe David Manana,
[EMAIL PROTECTED]

Obvious facts are like secrets to those not trained to see them.

Reply via email to