[ 
https://issues.apache.org/jira/browse/MTOMCAT-283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14390175#comment-14390175
 ] 

Mikko Tommila commented on MTOMCAT-283:
---------------------------------------

The use case is that we want to specify a tomcat-users.xml file, but we don't 
want to specify a server.xml file (because, mostly for everything we want to 
use the defaults, and then just use command line arguments to specify what we 
want differently).

We want to do this in a similar fashion in development and in production 
deployment, so we want it to work the same way when you launch an embedded 
Tomcat from Maven (with "mvn tomcat7:run" or "mvn tomcat7:run-war") and when 
you run an executable über-jar from the command line.

By default MemoryRealm is used.

Steps for running the test application (it will only work properly with the 
attached patch applied to tomcat-maven-plugin):

Unzip the attached tomcat-maven-plugin-test.zip
Go to the tomcat-maven-plugin-test directory

Run:
mvn clean install
mvn -Puber clean package

Now there are two ways we want to run the application:
Way 1)
mvn tomcat7:run

When you go to http://localhost:8080/test/protected.jsp
Login as admin/admin
-> Then you can see the page

Way 2)
cd target
java -cp .;tomcat-uber.jar org.apache.tomcat.maven.runner.Tomcat7RunnerCli

When you go to http://localhost:8080/test/protected.jsp
Login as admin/admin
-> Then you can also see the page


> Tomcat7Runner does not use tomcat-users.xml when used without a server.xml
> --------------------------------------------------------------------------
>
>                 Key: MTOMCAT-283
>                 URL: https://issues.apache.org/jira/browse/MTOMCAT-283
>             Project: Apache Tomcat Maven Plugin
>          Issue Type: Bug
>          Components: tomcat7
>    Affects Versions: 2.2
>         Environment: any
>            Reporter: Pasi Niemi
>            Assignee: Olivier Lamy (*$^¨%`£)
>         Attachments: tomcat-maven-plugin-test.zip, 
> tomcat-maven-plugin-use-tomcat-users-xml-in-war-exec.diff
>
>
> Tomcat7Runner does not use a tomcat-users.xml even though one is extracted 
> into the conf directory from the executable jar file. Also the exec-war-only 
> mojo lacks the configuration for the file, even though the same configuration 
> exists for RunWarMojo.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to